Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
s_propagateNaNF128UI.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "specialize.h"
#include "softfloat.h"
Include dependency graph for s_propagateNaNF128UI.c:

Go to the source code of this file.

Functions

struct uint128 softfloat_propagateNaNF128UI (uint_fast64_t uiA64, uint_fast64_t uiA0, uint_fast64_t uiB64, uint_fast64_t uiB0)
 

Function Documentation

◆ softfloat_propagateNaNF128UI()

struct uint128 softfloat_propagateNaNF128UI ( uint_fast64_t uiA64,
uint_fast64_t uiA0,
uint_fast64_t uiB64,
uint_fast64_t uiB0 )

Definition at line 54 of file s_propagateNaNF128UI.c.

60{
61 bool isSigNaNA, isSigNaNB;
62 uint_fast64_t uiNonsigA64, uiNonsigB64, uiMagA64, uiMagB64;
63 struct uint128 uiZ;
64
65 /*------------------------------------------------------------------------
66 *------------------------------------------------------------------------*/
67 isSigNaNA = softfloat_isSigNaNF128UI( uiA64, uiA0 );
68 isSigNaNB = softfloat_isSigNaNF128UI( uiB64, uiB0 );
69 /*------------------------------------------------------------------------
70 | Make NaNs non-signaling.
71 *------------------------------------------------------------------------*/
72 uiNonsigA64 = uiA64 | UINT64_C( 0x0000800000000000 );
73 uiNonsigB64 = uiB64 | UINT64_C( 0x0000800000000000 );
74 /*------------------------------------------------------------------------
75 *------------------------------------------------------------------------*/
76 if ( isSigNaNA | isSigNaNB ) {
78 if ( isSigNaNA ) {
79 if ( isSigNaNB ) goto returnLargerMag;
80 if ( isNaNF128UI( uiB64, uiB0 ) ) goto returnB;
81 goto returnA;
82 } else {
83 if ( isNaNF128UI( uiA64, uiA0 ) ) goto returnA;
84 goto returnB;
85 }
86 }
87 returnLargerMag:
88 uiMagA64 = uiA64 & UINT64_C( 0x7FFFFFFFFFFFFFFF );
89 uiMagB64 = uiB64 & UINT64_C( 0x7FFFFFFFFFFFFFFF );
90 if ( uiMagA64 < uiMagB64 ) goto returnB;
91 if ( uiMagB64 < uiMagA64 ) goto returnA;
92 if ( uiA0 < uiB0 ) goto returnB;
93 if ( uiB0 < uiA0 ) goto returnA;
94 if ( uiNonsigA64 < uiNonsigB64 ) goto returnA;
95 returnB:
96 uiZ.v64 = uiNonsigB64;
97 uiZ.v0 = uiB0;
98 return uiZ;
99 returnA:
100 uiZ.v64 = uiNonsigA64;
101 uiZ.v0 = uiA0;
102 return uiZ;
103
104}
void softfloat_raiseFlags(uint_fast8_t flags)
@ softfloat_flag_invalid
Definition softfloat.h:89
uint64_t uint_fast64_t
Definition stdint.h:157
#define UINT64_C(val)
Definition stdint.h:284
Here is the call graph for this function: