57 struct exp32_sig64 normExpSig;
59 struct uint128 rem, shiftedSigB;
62 struct uint128 term, altRem, meanRem;
84 if ( expA == 0x7FFF ) {
86 (sigA &
UINT64_C( 0x7FFFFFFFFFFFFFFF ))
87 || ((expB == 0x7FFF) && (sigB &
UINT64_C( 0x7FFFFFFFFFFFFFFF )))
93 if ( expB == 0x7FFF ) {
94 if ( sigB &
UINT64_C( 0x7FFFFFFFFFFFFFFF ) )
goto propagateNaN;
104 if ( ! expB ) expB = 1;
105 if ( ! (sigB &
UINT64_C( 0x8000000000000000 )) ) {
106 if ( ! sigB )
goto invalid;
108 expB += normExpSig.exp;
109 sigB = normExpSig.sig;
111 if ( ! expA ) expA = 1;
112 if ( ! (sigA &
UINT64_C( 0x8000000000000000 )) ) {
118 expA += normExpSig.exp;
119 sigA = normExpSig.sig;
123 expDiff = expA - expB;
124 if ( expDiff < -1 )
goto copyA;
137 rem.v64, rem.v0, shiftedSigB.v64, shiftedSigB.v0 );
145 if ( expDiff < 0 )
break;
146 q = (q64 + 0x80000000)>>32;
150 if ( rem.v64 &
UINT64_C( 0x8000000000000000 ) ) {
153 rem.v64, rem.v0, shiftedSigB.v64, shiftedSigB.v0 );
160 q = (
uint32_t) (q64>>32)>>(~expDiff & 31);
164 if ( rem.v64 &
UINT64_C( 0x8000000000000000 ) ) {
167 rem.v64, rem.v0, shiftedSigB.v64, shiftedSigB.v0 );
178 rem.v64, rem.v0, shiftedSigB.v64, shiftedSigB.v0 );
179 }
while ( ! (rem.v64 &
UINT64_C( 0x8000000000000000 )) );
183 (meanRem.v64 &
UINT64_C( 0x8000000000000000 ))
184 || (! (meanRem.v64 | meanRem.v0) && (q & 1))
189 if ( rem.v64 &
UINT64_C( 0x8000000000000000 ) ) {
195 signRem, rem.v64 | rem.v0 ? expB + 32 : 0, rem.v64, rem.v0, 80 );
220 uZ.s.signExp = uiZ64;