Lines Matching +full:non +full:- +full:sticky
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
5 * Floating-point emulation code
6 * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org>
9 PA header file -- do not include this header file for non-PA builds.
12 /* 32-bit word grabbing functions */
40 Dallp1(srcdst) &= Dmantissap1((unsigned int)-1)
53 Dallp2(srcdstB) = Dallp1(srcdstA) >> (varamount-32); \
64 Dallp2(srcdstB) = Dexponentmantissap1(srcdstA) >> (varamount-32); \
76 Dallp1(srcdstA) = Dallp2(srcdstB) << (varamount-32); \
82 (Dallp2(srcdstB) >> (32-(varamount))); \
110 if( Dallp2(dbl_valueB) == 0 ) Dallp1(dbl_valueA) -= 1; \
111 Dallp2(dbl_valueB) -= 1
216 * 1st greater? -------------
218 * 1st less?-----------------+---------
220 * 2nd greater or equal----->| |
250 Dallp1(desta) = src->wd0; \
251 Dallp2(destb) = src->wd1
253 dest->wd0 = Dallp1(srca); \
254 dest->wd1 = Dallp2(srcb)
261 (DBL_INFINITY_EXPONENT << (32-(1+DBL_EXP_LENGTH)))); \
265 = (DBL_INFINITY_EXPONENT << (32-(1+DBL_EXP_LENGTH))); \
269 (DBL_INFINITY_EXPONENT << (32-(1+DBL_EXP_LENGTH))); \
273 (DBL_INFINITY_EXPONENT << (32-(1+DBL_EXP_LENGTH))); \
303 #define ovfl -
309 Dallp1(dbl_valueA) = ((DBL_EMAX+DBL_BIAS) << (32-(1+DBL_EXP_LENGTH))) \
310 | ((1<<(32-(1+DBL_EXP_LENGTH))) - 1 ); \
313 Dallp1(dbl_valueA) = ((DBL_EMAX+DBL_BIAS) << (32-(1+DBL_EXP_LENGTH))) \
314 | ((1<<(32-(1+DBL_EXP_LENGTH))) - 1 ) \
319 (((DBL_EMAX+DBL_BIAS) << (32-(1+DBL_EXP_LENGTH))) \
320 | ((1<<(32-(1+DBL_EXP_LENGTH))) - 1 ))); \
325 << (32-(1+DBL_EXP_LENGTH)) ; \
329 ((DBL_EMAX+DBL_BIAS) << (32-(1+DBL_EXP_LENGTH))) | \
330 ((1 << (32-(1+DBL_EXP_LENGTH))) - 1 ); \
345 shift-32, Extall(extent)); \
346 if(Dallp2(srcdstB) << 64 - (shift)) Ext_setone_low(extent); \
349 Dallp2(srcdstB) = Dallp1(srcdstA) >> (shift - 32); \
364 Extall(extent) = Dallp2(srcdstB) << 32 - (shift); \
377 Extall(extent) = Dallp2(srcdstB) << 32 - (shift); \
378 Dallp2(srcdstB) = (Dallp1(srcdstA) << 32 - (shift)) | \
388 if( Dallp2(rightb) > Dallp2(leftb) ) Dallp1(lefta)--; \
389 Dallp2(resultb) = Dallp2(leftb) - Dallp2(rightb); \
390 Dallp1(resulta) = Dallp1(lefta) - Dallp1(righta)
396 if( (Extall(extent) = 0-Extall(extent)) ) \
398 if((Dallp2(resultb)--) == 0) Dallp1(resulta)--; \
421 Dallp1(desta) = ((DBL_EMAX+DBL_BIAS)+1)<< (32-(1+DBL_EXP_LENGTH)) \
422 | (1<<(32-(1+DBL_EXP_LENGTH+2))); \
425 Dallp1(desta) = ((DBL_EMAX+DBL_BIAS)+1)<< (32-(1+DBL_EXP_LENGTH)) \
426 | (1<<(32-(1+DBL_EXP_LENGTH+1))); \
432 exponent -= 8; \
436 exponent -= 4; \
440 exponent -= 1; \
459 if ((src1dstB) < (src2B)) Dallp1(src1dstA)--; \
460 Dallp1(src1dstA) -= (src2A); \
461 Dallp2(src1dstB) -= (src2B)
489 #define Dbl_denormalize(opndp1,opndp2,exponent,guard,sticky,inexact) \ argument
491 if (exponent >= (1-DBL_P)) { \
492 if (exponent >= -31) { \
493 guard = (Dallp2(opndp2) >> -exponent) & 1; \
494 if (exponent < 0) sticky |= Dallp2(opndp2) << (32+exponent); \
495 if (exponent > -31) { \
496 Variable_shift_double(opndp1,opndp2,1-exponent,opndp2); \
497 Dallp1(opndp1) >>= 1-exponent; \
505 guard = (Dallp1(opndp1) >> -32-exponent) & 1; \
506 if (exponent == -32) sticky |= Dallp2(opndp2); \
507 else sticky |= (Dallp2(opndp2) | Dallp1(opndp1) << 64+exponent); \
508 Dallp2(opndp2) = Dallp1(opndp1) >> -31-exponent; \
511 inexact = guard | sticky; \
515 sticky |= (Dallp1(opndp1) | Dallp2(opndp2)); \
517 inexact = sticky; \
560 {int shiftamt, sticky; \
562 sticky = 0; \
565 sticky = Dextallp4(srcdstD) << 32 - (shiftamt); \
576 sticky = (Dextallp3(srcdstC) << 31 - shiftamt) | \
584 sticky = Dextallp4(srcdstD); \
592 sticky = (Dextallp2(srcdstB) << 31 - shiftamt) | \
598 sticky = Dextallp3(srcdstC) | Dextallp4(srcdstD); \
605 sticky = (Dextallp1(srcdstA) << 31 - shiftamt) | \
610 sticky = Dextallp2(srcdstB) | Dextallp3(srcdstC) | \
618 if (sticky) Dblext_setone_lowmantissap4(srcdstD); \
624 if( (Dextallp3(leftc)--) == 0) \
625 if( (Dextallp2(leftb)--) == 0) Dextallp1(lefta)--; \
626 Dextallp4(resultd) = Dextallp4(leftd) - Dextallp4(rightd); \
628 if( (Dextallp2(leftb)--) == 0) Dextallp1(lefta)--; \
629 Dextallp3(resultc) = Dextallp3(leftc) - Dextallp3(rightc); \
630 if( Dextallp2(rightb) > Dextallp2(leftb) ) Dextallp1(lefta)--; \
631 Dextallp2(resultb) = Dextallp2(leftb) - Dextallp2(rightb); \
632 Dextallp1(resulta) = Dextallp1(lefta) - Dextallp1(righta)
763 {int shiftamt, sticky; \
796 if (exponent >= (1-QUAD_P)) { \
797 shiftamt = (1-exponent) % 32; \
798 switch((1-exponent)/32) { \
799 case 0: sticky = Dextallp4(opndp4) << 32-(shiftamt); \
805 case 1: sticky = (Dextallp3(opndp3) << 32-(shiftamt)) | \
812 case 2: sticky = (Dextallp2(opndp2) << 32-(shiftamt)) | \
818 case 3: sticky = (Dextallp1(opndp1) << 32-(shiftamt)) | \
828 sticky = Dextallp1(opndp1) | Dextallp2(opndp2) | \
832 if (sticky) Dblext_setone_lowmantissap4(opndp4); \