45{
47 bool roundNearEven;
49 bool isTiny;
52
53
54
57 roundIncrement = 0x40;
59 roundIncrement =
60 (roundingMode
62 ? 0x7F
63 : 0;
64 }
65 roundBits = sig & 0x7F;
66
67
68 if ( 0xFD <= (unsigned int) exp ) {
69 if ( exp < 0 ) {
70
71
72 isTiny =
74 || (exp < -1) || (sig + roundIncrement < 0x80000000);
76 exp = 0;
77 roundBits = sig & 0x7F;
78 if ( isTiny && roundBits ) {
80 }
81 } else if ( (0xFD < exp) || (0x80000000 <= sig + roundIncrement) ) {
82
83
86 uiZ =
packToF32UI( sign, 0xFF, 0 ) - ! roundIncrement;
87 goto uiZ;
88 }
89 }
90
91
92 sig = (sig + roundIncrement)>>7;
93 if ( roundBits ) {
95#ifdef SOFTFLOAT_ROUND_ODD
97 sig |= 1;
98 goto packReturn;
99 }
100#endif
101 }
102 sig &= ~(
uint_fast32_t) (! (roundBits ^ 0x40) & roundNearEven);
103 if ( ! sig ) exp = 0;
104
105
106 packReturn:
108 uiZ:
109 uZ.ui = uiZ;
110 return uZ.f;
111
112}
void softfloat_raiseFlags(uint_fast8_t flags)
#define packToF32UI(sign, exp, sig)
uint32_t softfloat_shiftRightJam32(uint32_t a, uint_fast16_t dist)
THREAD_LOCAL uint_fast8_t softfloat_roundingMode
@ softfloat_flag_underflow
@ softfloat_flag_overflow
THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags
THREAD_LOCAL uint_fast8_t softfloat_detectTininess
@ softfloat_round_near_even
@ softfloat_round_near_maxMag
@ softfloat_tininess_beforeRounding