67 struct exp32_sig128 normExpSig;
80 signA = signF128UI64( uiA64 );
81 expA = expF128UI64( uiA64 );
82 sigA.v64 = fracF128UI64( uiA64 );
84 signB = signF128UI64( uiB64 );
85 expB = expF128UI64( uiB64 );
86 sigB.v64 = fracF128UI64( uiB64 );
89 expC = expF128UI64( uiC64 );
90 sigC.v64 = fracF128UI64( uiC64 );
95 if ( expA == 0x7FFF ) {
97 (sigA.v64 | sigA.v0) || ((expB == 0x7FFF) && (sigB.v64 | sigB.v0))
99 goto propagateNaN_ABC;
101 magBits = expB | sigB.v64 | sigB.v0;
104 if ( expB == 0x7FFF ) {
105 if ( sigB.v64 | sigB.v0 )
goto propagateNaN_ABC;
106 magBits = expA | sigA.v64 | sigA.v0;
109 if ( expC == 0x7FFF ) {
110 if ( sigC.v64 | sigC.v0 ) {
113 goto propagateNaN_ZC;
122 if ( ! (sigA.v64 | sigA.v0) )
goto zeroProd;
124 expA = normExpSig.exp;
125 sigA = normExpSig.sig;
128 if ( ! (sigB.v64 | sigB.v0) )
goto zeroProd;
130 expB = normExpSig.exp;
131 sigB = normExpSig.sig;
135 expZ = expA + expB - 0x3FFE;
136 sigA.v64 |=
UINT64_C( 0x0001000000000000 );
137 sigB.v64 |=
UINT64_C( 0x0001000000000000 );
144 if ( ! (sigZ.v64 &
UINT64_C( 0x0100000000000000 )) ) {
149 if ( ! (sigC.v64 | sigC.v0) ) {
154 expC = normExpSig.exp;
155 sigC = normExpSig.sig;
157 sigC.v64 |=
UINT64_C( 0x0001000000000000 );
161 expDiff = expZ - expC;
164 if ( (signZ == signC) || (expDiff < -1) ) {
165 shiftDist -= expDiff;
177 sig256Z[
indexWord( 4, 1 )] = (sigZ.v0<<63) | x128.v64;
200 if ( signZ == signC ) {
203 if ( expDiff <= 0 ) {
210 if ( sigZ.v64 &
UINT64_C( 0x0200000000000000 ) ) {
219 if ( expDiff < -1 ) {
227 if ( ! (sigZ.v64 &
UINT64_C( 0x0100000000000000 )) ) {
231 goto shiftRightRoundPack;
239 }
else if ( ! expDiff ) {
242 ! (sigZ.v64 | sigZ.v0) && ! sig256Z[
indexWord( 4, 1 )]
245 goto completeCancellation;
249 if ( sigZ.v64 &
UINT64_C( 0x8000000000000000 ) ) {
258 if ( ! (sigZ.v64 &
UINT64_C( 0x0100000000000000 )) ) {
272 if ( sig256Z0 ) sigZExtra |= 1;
277 sigZExtra = sig256Z0;
291 expZ += 7 - shiftDist;
292 shiftDist = 15 - shiftDist;
293 if ( 0 < shiftDist )
goto shiftRightRoundPack;
295 shiftDist = -shiftDist;
306 sigZExtra = (
uint64_t) (sigZ.v0<<(64 - shiftDist)) | (sigZExtra != 0);
311 signZ, expZ - 1, sigZ.v64, sigZ.v0, sigZExtra );
316 goto propagateNaN_ZC;
321 uiZ.v64 = packToF128UI64( signZ, 0x7FFF, 0 );
323 if ( expC != 0x7FFF )
goto uiZ;
324 if ( sigC.v64 | sigC.v0 )
goto propagateNaN_ZC;
325 if ( signZ == signC )
goto uiZ;
338 if ( ! (expC | sigC.v64 | sigC.v0) && (signZ != signC) ) {
339 completeCancellation: