249{
250 bool signA;
253 bool signB;
256 bool signC;
259 bool signZ;
268
269
270
281
282
283 if ( expA == 0x7FF ) {
284 if ( sigA || ((expB == 0x7FF) && sigB) ) goto propagateNaN_ABC;
285 magBits = expB | sigB;
286 goto infProdArg;
287 }
288 if ( expB == 0x7FF ) {
289 if ( sigB ) goto propagateNaN_ABC;
290 magBits = expA | sigA;
291 goto infProdArg;
292 }
293 if ( expC == 0x7FF ) {
294 if ( sigC ) {
295 uiZ = 0;
296 goto propagateNaN_ZC;
297 }
298 uiZ = uiC;
299 goto uiZ;
300 }
301
302
303 if ( ! expA ) {
304 if ( ! sigA ) goto zeroProd;
306 expA = normExpSig.exp;
307 sigA = normExpSig.sig;
308 }
309 if ( ! expB ) {
310 if ( ! sigB ) goto zeroProd;
312 expB = normExpSig.exp;
313 sigB = normExpSig.sig;
314 }
315
316
317 expZ = expA + expB - 0x3FE;
318 sigA = (sigA |
UINT64_C( 0x0010000000000000 ))<<10;
319 sigB = (sigB |
UINT64_C( 0x0010000000000000 ))<<11;
321 sigZ =
323 shiftDist = 0;
324 if ( ! (sigZ &
UINT64_C( 0x4000000000000000 )) ) {
325 --expZ;
326 shiftDist = -1;
327 }
328 if ( ! expC ) {
329 if ( ! sigC ) {
330 if ( shiftDist ) sigZ <<= 1;
331 goto sigZ;
332 }
334 expC = normExpSig.exp;
335 sigC = normExpSig.sig;
336 }
337 sigC = (sigC |
UINT64_C( 0x0010000000000000 ))<<10;
338
339
340 expDiff = expZ - expC;
341 if ( expDiff < 0 ) {
342 expZ = expC;
343 if ( (signZ == signC) || (expDiff < -1) ) {
344 shiftDist -= expDiff;
345 if ( shiftDist) {
347 }
348 } else {
349 if ( ! shiftDist ) {
351 }
352 }
353 } else {
355 if ( ! expDiff ) {
356 sigZ =
359 } else {
365 }
366 }
367
368
369 if ( signZ == signC ) {
370
371
372 if ( expDiff <= 0 ) {
373 sigZ += sigC;
374 } else {
376 sigZ =
379 }
380 if ( sigZ &
UINT64_C( 0x8000000000000000 ) ) {
381 ++expZ;
383 }
384 } else {
385
386
387 if ( expDiff < 0 ) {
388 signZ = signC;
389 if ( expDiff < -1 ) {
390 sigZ = sigC - sigZ;
391 if (
393 ) {
394 sigZ = (sigZ - 1) | 1;
395 }
396 if ( ! (sigZ &
UINT64_C( 0x4000000000000000 )) ) {
397 --expZ;
398 sigZ <<= 1;
399 }
400 goto roundPack;
401 } else {
407 }
408 } else if ( ! expDiff ) {
409 sigZ -= sigC;
410 if (
413 ) {
414 goto completeCancellation;
415 }
418 if ( sigZ &
UINT64_C( 0x8000000000000000 ) ) {
419 signZ = ! signZ;
421 }
422 } else {
424 if ( 1 < expDiff ) {
425 sigZ =
428 if ( ! (sigZ &
UINT64_C( 0x4000000000000000 )) ) {
429 --expZ;
430 sigZ <<= 1;
431 }
432 goto sigZ;
433 }
434 }
435
436
437 shiftDist = 0;
438 sigZ =
441 if ( ! sigZ ) {
442 shiftDist = 64;
443 sigZ =
446 }
448 if ( shiftDist ) {
449 expZ -= shiftDist;
451 sigZ =
454 }
455 }
456 sigZ:
458 roundPack:
460
461
462 propagateNaN_ABC:
464 goto propagateNaN_ZC;
465
466
467 infProdArg:
468 if ( magBits ) {
470 if ( expC != 0x7FF ) goto uiZ;
471 if ( sigC ) goto propagateNaN_ZC;
472 if ( signZ == signC ) goto uiZ;
473 }
476 propagateNaN_ZC:
478 goto uiZ;
479
480
481 zeroProd:
482 uiZ = uiC;
483 if ( ! (expC | sigC) && (signZ != signC) ) {
484 completeCancellation:
485 uiZ =
488 }
489 uiZ:
490 uZ.ui = uiZ;
491 return uZ.f;
492
493}
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
#define softfloat_countLeadingZeros64
unsigned __int64 uint64_t