1 /* Software floating-point emulation. Common operations.
2 Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Richard Henderson (rth@cygnus.com),
5 Jakub Jelinek (jj@ultra.linux.cz),
6 David S. Miller (davem@redhat.com) and
7 Peter Maydell (pmaydell@chiark.greenend.org.uk).
9 The GNU C Library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
14 The GNU C Library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public
20 License along with the GNU C Library; see the file COPYING.LIB. If
21 not, write to the Free Software Foundation, Inc.,
22 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24 #define _FP_DECL(wc, X) \
25 _FP_I_TYPE X##_c, X##_s, X##_e; \
29 * Finish truely unpacking a native fp value by classifying the kind
30 * of fp value and normalizing both the exponent and the fraction.
33 #define _FP_UNPACK_CANONICAL(fs, wc, X) \
38 _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs; \
39 _FP_FRAC_SLL_##wc(X, _FP_WORKBITS); \
40 X##_e -= _FP_EXPBIAS_##fs; \
41 X##_c = FP_CLS_NORMAL; \
45 if (_FP_FRAC_ZEROP_##wc(X)) \
46 X##_c = FP_CLS_ZERO; \
49 /* a denormalized number */ \
51 _FP_FRAC_CLZ_##wc(_shift, X); \
52 _shift -= _FP_FRACXBITS_##fs; \
53 _FP_FRAC_SLL_##wc(X, (_shift+_FP_WORKBITS)); \
54 X##_e -= _FP_EXPBIAS_##fs - 1 + _shift; \
55 X##_c = FP_CLS_NORMAL; \
56 FP_SET_EXCEPTION(FP_EX_DENORM); \
60 case _FP_EXPMAX_##fs: \
61 if (_FP_FRAC_ZEROP_##wc(X)) \
66 /* Check for signaling NaN */ \
67 if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \
68 FP_SET_EXCEPTION(FP_EX_INVALID); \
75 * Before packing the bits back into the native fp result, take care
76 * of such mundane things as rounding and overflow. Also, for some
77 * kinds of fp values, the original parts may not have been fully
78 * extracted -- but that is ok, we can regenerate them now.
81 #define _FP_PACK_CANONICAL(fs, wc, X) \
86 X##_e += _FP_EXPBIAS_##fs; \
90 if (_FP_FRAC_OVERP_##wc(fs, X)) \
92 _FP_FRAC_SRL_##wc(X, (_FP_WORKBITS+1)); \
96 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
97 if (X##_e >= _FP_EXPMAX_##fs) \
100 switch (FP_ROUNDMODE) \
102 case FP_RND_NEAREST: \
103 X##_c = FP_CLS_INF; \
106 if (!X##_s) X##_c = FP_CLS_INF; \
109 if (X##_s) X##_c = FP_CLS_INF; \
112 if (X##_c == FP_CLS_INF) \
114 /* Overflow to infinity */ \
115 X##_e = _FP_EXPMAX_##fs; \
116 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
120 /* Overflow to maximum normal */ \
121 X##_e = _FP_EXPMAX_##fs - 1; \
122 _FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc); \
124 FP_SET_EXCEPTION(FP_EX_OVERFLOW); \
125 FP_SET_EXCEPTION(FP_EX_INEXACT); \
130 /* we've got a denormalized number */ \
131 X##_e = -X##_e + 1; \
132 if (X##_e <= _FP_WFRACBITS_##fs) \
134 _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \
136 if (_FP_FRAC_HIGH_##fs(X) \
137 & (_FP_OVERFLOW_##fs >> 1)) \
140 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
145 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
146 FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \
151 /* underflow to zero */ \
153 if (!_FP_FRAC_ZEROP_##wc(X)) \
155 _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \
157 _FP_FRAC_LOW_##wc(X) >>= (_FP_WORKBITS); \
159 FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \
166 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
170 X##_e = _FP_EXPMAX_##fs; \
171 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
175 X##_e = _FP_EXPMAX_##fs; \
176 if (!_FP_KEEPNANFRACP) \
178 _FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs); \
179 X##_s = _FP_NANSIGN_##fs; \
182 _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs; \
187 /* This one accepts raw argument and not cooked, returns
188 * 1 if X is a signaling NaN.
190 #define _FP_ISSIGNAN(fs, wc, X) \
193 if (X##_e == _FP_EXPMAX_##fs) \
195 if (!_FP_FRAC_ZEROP_##wc(X) \
196 && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \
207 * Main addition routine. The input values should be cooked.
210 #define _FP_ADD(fs, wc, R, X, Y) \
212 switch (_FP_CLS_COMBINE(X##_c, Y##_c)) \
214 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL): \
216 /* shift the smaller number so that its exponent matches the larger */ \
217 _FP_I_TYPE diff = X##_e - Y##_e; \
222 if (diff <= _FP_WFRACBITS_##fs) \
223 _FP_FRAC_SRS_##wc(X, diff, _FP_WFRACBITS_##fs); \
224 else if (!_FP_FRAC_ZEROP_##wc(X)) \
225 _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \
232 if (diff <= _FP_WFRACBITS_##fs) \
233 _FP_FRAC_SRS_##wc(Y, diff, _FP_WFRACBITS_##fs); \
234 else if (!_FP_FRAC_ZEROP_##wc(Y)) \
235 _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc); \
240 R##_c = FP_CLS_NORMAL; \
242 if (X##_s == Y##_s) \
245 _FP_FRAC_ADD_##wc(R, X, Y); \
246 if (_FP_FRAC_OVERP_##wc(fs, R)) \
248 _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \
255 _FP_FRAC_SUB_##wc(R, X, Y); \
256 if (_FP_FRAC_ZEROP_##wc(R)) \
258 /* return an exact zero */ \
259 if (FP_ROUNDMODE == FP_RND_MINF) \
263 R##_c = FP_CLS_ZERO; \
267 if (_FP_FRAC_NEGP_##wc(R)) \
269 _FP_FRAC_SUB_##wc(R, Y, X); \
273 /* renormalize after subtraction */ \
274 _FP_FRAC_CLZ_##wc(diff, R); \
275 diff -= _FP_WFRACXBITS_##fs; \
279 _FP_FRAC_SLL_##wc(R, diff); \
286 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN): \
287 _FP_CHOOSENAN(fs, wc, R, X, Y); \
290 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \
292 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL): \
293 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \
294 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \
295 _FP_FRAC_COPY_##wc(R, X); \
300 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL): \
302 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN): \
303 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \
304 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \
305 _FP_FRAC_COPY_##wc(R, Y); \
310 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \
311 if (X##_s != Y##_s) \
313 /* +INF + -INF => NAN */ \
314 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
315 R##_s = _FP_NANSIGN_##fs; \
316 R##_c = FP_CLS_NAN; \
317 FP_SET_EXCEPTION(FP_EX_INVALID); \
322 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \
323 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO): \
325 R##_c = FP_CLS_INF; \
328 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF): \
329 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF): \
331 R##_c = FP_CLS_INF; \
334 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \
335 /* make sure the sign is correct */ \
336 if (FP_ROUNDMODE == FP_RND_MINF) \
337 R##_s = X##_s | Y##_s; \
339 R##_s = X##_s & Y##_s; \
340 R##_c = FP_CLS_ZERO; \
350 * Main negation routine. FIXME -- when we care about setting exception
351 * bits reliably, this will not do. We should examine all of the fp classes.
354 #define _FP_NEG(fs, wc, R, X) \
356 _FP_FRAC_COPY_##wc(R, X); \
364 * Main multiplication routine. The input values should be cooked.
367 #define _FP_MUL(fs, wc, R, X, Y) \
369 R##_s = X##_s ^ Y##_s; \
370 switch (_FP_CLS_COMBINE(X##_c, Y##_c)) \
372 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL): \
373 R##_c = FP_CLS_NORMAL; \
374 R##_e = X##_e + Y##_e + 1; \
376 _FP_MUL_MEAT_##fs(R,X,Y); \
378 if (_FP_FRAC_OVERP_##wc(fs, R)) \
379 _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \
384 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN): \
385 _FP_CHOOSENAN(fs, wc, R, X, Y); \
388 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL): \
389 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \
390 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \
393 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \
394 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \
395 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL): \
396 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \
397 _FP_FRAC_COPY_##wc(R, X); \
401 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN): \
402 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \
403 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \
406 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF): \
407 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \
408 _FP_FRAC_COPY_##wc(R, Y); \
412 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO): \
413 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF): \
414 R##_s = _FP_NANSIGN_##fs; \
415 R##_c = FP_CLS_NAN; \
416 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
417 FP_SET_EXCEPTION(FP_EX_INVALID); \
427 * Main division routine. The input values should be cooked.
430 #define _FP_DIV(fs, wc, R, X, Y) \
432 R##_s = X##_s ^ Y##_s; \
433 switch (_FP_CLS_COMBINE(X##_c, Y##_c)) \
435 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL): \
436 R##_c = FP_CLS_NORMAL; \
437 R##_e = X##_e - Y##_e; \
439 _FP_DIV_MEAT_##fs(R,X,Y); \
442 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN): \
443 _FP_CHOOSENAN(fs, wc, R, X, Y); \
446 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL): \
447 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \
448 case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \
450 _FP_FRAC_COPY_##wc(R, X); \
454 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN): \
455 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \
456 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \
458 _FP_FRAC_COPY_##wc(R, Y); \
462 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF): \
463 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF): \
464 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL): \
465 R##_c = FP_CLS_ZERO; \
468 case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \
469 FP_SET_EXCEPTION(FP_EX_DIVZERO); \
470 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO): \
471 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \
472 R##_c = FP_CLS_INF; \
475 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \
476 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \
477 R##_s = _FP_NANSIGN_##fs; \
478 R##_c = FP_CLS_NAN; \
479 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
480 FP_SET_EXCEPTION(FP_EX_INVALID); \
490 * Main differential comparison routine. The inputs should be raw not
491 * cooked. The return is -1,0,1 for normal values, 2 otherwise.
494 #define _FP_CMP(fs, wc, ret, X, Y, un) \
496 /* NANs are unordered */ \
497 if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \
498 || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) \
507 __is_zero_x = (!X##_e && _FP_FRAC_ZEROP_##wc(X)) ? 1 : 0; \
508 __is_zero_y = (!Y##_e && _FP_FRAC_ZEROP_##wc(Y)) ? 1 : 0; \
510 if (__is_zero_x && __is_zero_y) \
512 else if (__is_zero_x) \
513 ret = Y##_s ? 1 : -1; \
514 else if (__is_zero_y) \
515 ret = X##_s ? -1 : 1; \
516 else if (X##_s != Y##_s) \
517 ret = X##_s ? -1 : 1; \
518 else if (X##_e > Y##_e) \
519 ret = X##_s ? -1 : 1; \
520 else if (X##_e < Y##_e) \
521 ret = X##_s ? 1 : -1; \
522 else if (_FP_FRAC_GT_##wc(X, Y)) \
523 ret = X##_s ? -1 : 1; \
524 else if (_FP_FRAC_GT_##wc(Y, X)) \
525 ret = X##_s ? 1 : -1; \
532 /* Simplification for strict equality. */
534 #define _FP_CMP_EQ(fs, wc, ret, X, Y) \
536 /* NANs are unordered */ \
537 if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \
538 || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) \
544 ret = !(X##_e == Y##_e \
545 && _FP_FRAC_EQ_##wc(X, Y) \
546 && (X##_s == Y##_s || !X##_e && _FP_FRAC_ZEROP_##wc(X))); \
551 * Main square root routine. The input value should be cooked.
554 #define _FP_SQRT(fs, wc, R, X) \
556 _FP_FRAC_DECL_##wc(T); _FP_FRAC_DECL_##wc(S); \
561 _FP_FRAC_COPY_##wc(R, X); \
563 R##_c = FP_CLS_NAN; \
568 R##_s = _FP_NANSIGN_##fs; \
569 R##_c = FP_CLS_NAN; /* NAN */ \
570 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
571 FP_SET_EXCEPTION(FP_EX_INVALID); \
576 R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */ \
581 R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */ \
583 case FP_CLS_NORMAL: \
587 R##_c = FP_CLS_NAN; /* sNAN */ \
588 R##_s = _FP_NANSIGN_##fs; \
589 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
590 FP_SET_EXCEPTION(FP_EX_INVALID); \
593 R##_c = FP_CLS_NORMAL; \
595 _FP_FRAC_SLL_##wc(X, 1); \
596 R##_e = X##_e >> 1; \
597 _FP_FRAC_SET_##wc(S, _FP_ZEROFRAC_##wc); \
598 _FP_FRAC_SET_##wc(R, _FP_ZEROFRAC_##wc); \
599 q = _FP_OVERFLOW_##fs >> 1; \
600 _FP_SQRT_MEAT_##wc(R, S, T, X, q); \
605 * Convert from FP to integer
608 /* RSIGNED can have following values:
609 * 0: the number is required to be 0..(2^rsize)-1, if not, NV is set plus
610 * the result is either 0 or (2^rsize)-1 depending on the sign in such case.
611 * 1: the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is
612 * set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
613 * on the sign in such case.
614 * -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
615 * set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
616 * on the sign in such case.
618 #define _FP_TO_INT(fs, wc, r, X, rsize, rsigned) \
622 case FP_CLS_NORMAL: \
625 FP_SET_EXCEPTION(FP_EX_INEXACT); \
629 else if (X##_e >= rsize - (rsigned > 0 || X##_s) \
630 || (!rsigned && X##_s)) \
644 FP_SET_EXCEPTION(FP_EX_INVALID); \
648 if (_FP_W_TYPE_SIZE*wc < rsize) \
650 _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \
651 r <<= X##_e - _FP_WFRACBITS_##fs; \
655 if (X##_e >= _FP_WFRACBITS_##fs) \
656 _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1)); \
657 else if (X##_e < _FP_WFRACBITS_##fs - 1) \
659 _FP_FRAC_SRS_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 2), \
660 _FP_WFRACBITS_##fs); \
661 if (_FP_FRAC_LOW_##wc(X) & 1) \
662 FP_SET_EXCEPTION(FP_EX_INEXACT); \
663 _FP_FRAC_SRL_##wc(X, 1); \
665 _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \
667 if (rsigned && X##_s) \
674 #define _FP_FROM_INT(fs, wc, X, r, rsize, rtype) \
678 X##_c = FP_CLS_NORMAL; \
680 if ((X##_s = (r < 0))) \
683 if (rsize <= _FP_W_TYPE_SIZE) \
684 __FP_CLZ(X##_e, r); \
686 __FP_CLZ_2(X##_e, (_FP_W_TYPE)(r >> _FP_W_TYPE_SIZE), \
688 if (rsize < _FP_W_TYPE_SIZE) \
689 X##_e -= (_FP_W_TYPE_SIZE - rsize); \
690 X##_e = rsize - X##_e - 1; \
692 if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \
693 __FP_FRAC_SRS_1(r, (X##_e - _FP_WFRACBITS_##fs), rsize); \
694 r &= ~((rtype)1 << X##_e); \
695 _FP_FRAC_DISASSEMBLE_##wc(X, ((unsigned rtype)r), rsize); \
696 _FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1)); \
700 X##_c = FP_CLS_ZERO, X##_s = 0; \
705 #define FP_CONV(dfs,sfs,dwc,swc,D,S) \
707 _FP_FRAC_CONV_##dwc##_##swc(dfs, sfs, D, S); \
717 /* Count leading zeros in a word. */
720 #if _FP_W_TYPE_SIZE < 64
721 /* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */
722 #define __FP_CLZ(r, x) \
724 _FP_W_TYPE _t = (x); \
725 r = _FP_W_TYPE_SIZE - 1; \
726 if (_t > 0xffff) r -= 16; \
727 if (_t > 0xffff) _t >>= 16; \
728 if (_t > 0xff) r -= 8; \
729 if (_t > 0xff) _t >>= 8; \
730 if (_t & 0xf0) r -= 4; \
731 if (_t & 0xf0) _t >>= 4; \
732 if (_t & 0xc) r -= 2; \
733 if (_t & 0xc) _t >>= 2; \
734 if (_t & 0x2) r -= 1; \
736 #else /* not _FP_W_TYPE_SIZE < 64 */
737 #define __FP_CLZ(r, x) \
739 _FP_W_TYPE _t = (x); \
740 r = _FP_W_TYPE_SIZE - 1; \
741 if (_t > 0xffffffff) r -= 32; \
742 if (_t > 0xffffffff) _t >>= 32; \
743 if (_t > 0xffff) r -= 16; \
744 if (_t > 0xffff) _t >>= 16; \
745 if (_t > 0xff) r -= 8; \
746 if (_t > 0xff) _t >>= 8; \
747 if (_t & 0xf0) r -= 4; \
748 if (_t & 0xf0) _t >>= 4; \
749 if (_t & 0xc) r -= 2; \
750 if (_t & 0xc) _t >>= 2; \
751 if (_t & 0x2) r -= 1; \
753 #endif /* not _FP_W_TYPE_SIZE < 64 */
754 #endif /* ndef __FP_CLZ */
756 #define _FP_DIV_HELP_imm(q, r, n, d) \
758 q = n / d, r = n % d; \