45{
47 bool roundNearEven;
49 bool isTiny;
52
53
54
57 roundIncrement = 0x8;
59 roundIncrement =
60 (roundingMode
62 ? 0xF
63 : 0;
64 }
65 roundBits = sig & 0xF;
66
67
68 if ( 0x1D <= (unsigned int) exp ) {
69 if ( exp < 0 ) {
70
71
72 isTiny =
74 || (exp < -1) || (sig + roundIncrement < 0x8000);
76 exp = 0;
77 roundBits = sig & 0xF;
78 if ( isTiny && roundBits ) {
80 }
81 } else if ( (0x1D < exp) || (0x8000 <= sig + roundIncrement) ) {
82
83
86 uiZ =
packToF16UI( sign, 0x1F, 0 ) - ! roundIncrement;
87 goto uiZ;
88 }
89 }
90
91
92 sig = (sig + roundIncrement)>>4;
93 if ( roundBits ) {
95#ifdef SOFTFLOAT_ROUND_ODD
97 sig |= 1;
98 goto packReturn;
99 }
100#endif
101 }
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 packToF16UI(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