45{
53 bool signZ;
58
59
60
65
66
67 expDiff = expA - expB;
68 if ( ! expDiff ) {
69
70
71 if ( expA == 0xFF ) {
72 if ( sigA | sigB ) goto propagateNaN;
75 goto uiZ;
76 }
77 sigDiff = sigA - sigB;
78 if ( ! sigDiff ) {
79 uiZ =
82 goto uiZ;
83 }
84 if ( expA ) --expA;
86 if ( sigDiff < 0 ) {
87 signZ = ! signZ;
88 sigDiff = -sigDiff;
89 }
91 expZ = expA - shiftDist;
92 if ( expZ < 0 ) {
93 shiftDist = expA;
94 expZ = 0;
95 }
96 uiZ =
packToF32UI( signZ, expZ, sigDiff<<shiftDist );
97 goto uiZ;
98 } else {
99
100
102 sigA <<= 7;
103 sigB <<= 7;
104 if ( expDiff < 0 ) {
105
106
107 signZ = ! signZ;
108 if ( expB == 0xFF ) {
109 if ( sigB ) goto propagateNaN;
111 goto uiZ;
112 }
113 expZ = expB - 1;
114 sigX = sigB | 0x40000000;
115 sigY = sigA + (expA ? 0x40000000 : sigA);
116 expDiff = -expDiff;
117 } else {
118
119
120 if ( expA == 0xFF ) {
121 if ( sigA ) goto propagateNaN;
122 uiZ = uiA;
123 goto uiZ;
124 }
125 expZ = expA - 1;
126 sigX = sigA | 0x40000000;
127 sigY = sigB + (expB ? 0x40000000 : sigB);
128 }
129 return
132 );
133 }
134
135
136 propagateNaN:
138 uiZ:
139 uZ.ui = uiZ;
140 return uZ.f;
141
142}
uint_fast32_t softfloat_propagateNaNF32UI(uint_fast32_t uiA, uint_fast32_t uiB)
void softfloat_raiseFlags(uint_fast8_t flags)
float32_t softfloat_normRoundPackToF32(bool, int_fast16_t, uint_fast32_t)
#define packToF32UI(sign, exp, sig)
uint32_t softfloat_shiftRightJam32(uint32_t a, uint_fast16_t dist)
THREAD_LOCAL uint_fast8_t softfloat_roundingMode
#define softfloat_countLeadingZeros32