41#include "specialize.h"
44#ifdef SOFTFLOAT_FAST_INT64
63 struct uint128 sig128Z;
66 struct uint128 sig128C;
84 if ( expA == 0x7FF ) {
85 if ( sigA || ((expB == 0x7FF) && sigB) )
goto propagateNaN_ABC;
86 magBits = expB | sigB;
89 if ( expB == 0x7FF ) {
90 if ( sigB )
goto propagateNaN_ABC;
91 magBits = expA | sigA;
94 if ( expC == 0x7FF ) {
105 if ( ! sigA )
goto zeroProd;
107 expA = normExpSig.exp;
108 sigA = normExpSig.sig;
111 if ( ! sigB )
goto zeroProd;
113 expB = normExpSig.exp;
114 sigB = normExpSig.sig;
118 expZ = expA + expB - 0x3FE;
119 sigA = (sigA |
UINT64_C( 0x0010000000000000 ))<<10;
120 sigB = (sigB |
UINT64_C( 0x0010000000000000 ))<<10;
122 if ( sig128Z.v64 <
UINT64_C( 0x2000000000000000 ) ) {
126 sig128Z.v64, sig128Z.v0, sig128Z.v64, sig128Z.v0 );
131 sigZ = sig128Z.v64<<1 | (sig128Z.v0 != 0);
135 expC = normExpSig.exp;
136 sigC = normExpSig.sig;
138 sigC = (sigC |
UINT64_C( 0x0010000000000000 ))<<9;
141 expDiff = expZ - expC;
144 if ( (signZ == signC) || (expDiff < -1) ) {
150 }
else if ( expDiff ) {
155 if ( signZ == signC ) {
158 if ( expDiff <= 0 ) {
159 sigZ = (sigC + sig128Z.v64) | (sig128Z.v0 != 0);
163 sig128Z.v64, sig128Z.v0, sig128C.v64, sig128C.v0 );
164 sigZ = sig128Z.v64 | (sig128Z.v0 != 0);
166 if ( sigZ <
UINT64_C( 0x4000000000000000 ) ) {
176 }
else if ( ! expDiff ) {
177 sig128Z.v64 = sig128Z.v64 - sigC;
178 if ( ! (sig128Z.v64 | sig128Z.v0) )
goto completeCancellation;
179 if ( sig128Z.v64 &
UINT64_C( 0x8000000000000000 ) ) {
186 sig128Z.v64, sig128Z.v0, sig128C.v64, sig128C.v0 );
190 if ( ! sig128Z.v64 ) {
192 sig128Z.v64 = sig128Z.v0;
197 if ( shiftDist < 0 ) {
202 sig128Z.v64, sig128Z.v0, shiftDist );
205 sigZ |= (sig128Z.v0 != 0);
213 goto propagateNaN_ZC;
219 if ( expC != 0x7FF )
goto uiZ;
220 if ( sigC )
goto propagateNaN_ZC;
221 if ( signZ == signC )
goto uiZ;
232 if ( ! (expC | sigC) && (signZ != signC) ) {
233 completeCancellation:
283 if ( expA == 0x7FF ) {
284 if ( sigA || ((expB == 0x7FF) && sigB) )
goto propagateNaN_ABC;
285 magBits = expB | sigB;
288 if ( expB == 0x7FF ) {
289 if ( sigB )
goto propagateNaN_ABC;
290 magBits = expA | sigA;
293 if ( expC == 0x7FF ) {
296 goto propagateNaN_ZC;
304 if ( ! sigA )
goto zeroProd;
306 expA = normExpSig.
exp;
307 sigA = normExpSig.
sig;
310 if ( ! sigB )
goto zeroProd;
312 expB = normExpSig.
exp;
313 sigB = normExpSig.
sig;
317 expZ = expA + expB - 0x3FE;
318 sigA = (sigA |
UINT64_C( 0x0010000000000000 ))<<10;
319 sigB = (sigB |
UINT64_C( 0x0010000000000000 ))<<11;
324 if ( ! (sigZ &
UINT64_C( 0x4000000000000000 )) ) {
330 if ( shiftDist ) sigZ <<= 1;
334 expC = normExpSig.
exp;
335 sigC = normExpSig.
sig;
337 sigC = (sigC |
UINT64_C( 0x0010000000000000 ))<<10;
340 expDiff = expZ - expC;
343 if ( (signZ == signC) || (expDiff < -1) ) {
344 shiftDist -= expDiff;
369 if ( signZ == signC ) {
372 if ( expDiff <= 0 ) {
380 if ( sigZ &
UINT64_C( 0x8000000000000000 ) ) {
389 if ( expDiff < -1 ) {
394 sigZ = (sigZ - 1) | 1;
396 if ( ! (sigZ &
UINT64_C( 0x4000000000000000 )) ) {
408 }
else if ( ! expDiff ) {
414 goto completeCancellation;
418 if ( sigZ &
UINT64_C( 0x8000000000000000 ) ) {
428 if ( ! (sigZ &
UINT64_C( 0x4000000000000000 )) ) {
464 goto propagateNaN_ZC;
470 if ( expC != 0x7FF )
goto uiZ;
471 if ( sigC )
goto propagateNaN_ZC;
472 if ( signZ == signC )
goto uiZ;
483 if ( ! (expC | sigC) && (signZ != signC) ) {
484 completeCancellation:
uint_fast64_t softfloat_propagateNaNF64UI(uint_fast64_t uiA, uint_fast64_t uiB)
void softfloat_raiseFlags(uint_fast8_t flags)
float64_t softfloat_roundPackToF64(bool, int_fast16_t, uint_fast64_t)
struct exp16_sig64 softfloat_normSubnormalF64Sig(uint_fast64_t)
#define packToF64UI(sign, exp, sig)
@ softfloat_mulAdd_subProd
#define indexWord(total, n)
#define softfloat_add128M(aPtr, bPtr, zPtr)
uint64_t softfloat_shortShiftRightJam64(uint64_t a, uint_fast8_t dist)
#define softfloat_sub128M(aPtr, bPtr, zPtr)
void softfloat_mul64To128M(uint64_t a, uint64_t b, uint32_t *zPtr)
#define softfloat_shiftRightJam128M(aPtr, dist, zPtr)
#define softfloat_negX128M(zPtr)
#define softfloat_shiftLeft128M(aPtr, dist, zPtr)
uint64_t softfloat_shiftRightJam64(uint64_t a, uint_fast32_t dist)
#define softfloat_shortShiftRight128M(aPtr, dist, zPtr)
THREAD_LOCAL uint_fast8_t softfloat_roundingMode
struct uint128 softfloat_add128(uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0)
#define softfloat_countLeadingZeros64
struct uint128 softfloat_mul64To128(uint64_t a, uint64_t b)
float64_t softfloat_mulAddF64(uint_fast64_t uiA, uint_fast64_t uiB, uint_fast64_t uiC, uint_fast8_t op)
struct uint128 softfloat_shiftRightJam128(uint64_t a64, uint64_t a0, uint_fast32_t dist)
struct uint128 softfloat_shortShiftLeft128(uint64_t a64, uint64_t a0, uint_fast8_t dist)
struct uint128 softfloat_shortShiftRightJam128(uint64_t a64, uint64_t a0, uint_fast8_t dist)
struct uint128 softfloat_sub128(uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0)
unsigned __int64 uint64_t