55 bool isTiny, doIncrement;
56 struct uint64_extra sig64Extra;
63 if ( roundingPrecision == 80 )
goto precision80;
64 if ( roundingPrecision == 64 ) {
65 roundIncrement =
UINT64_C( 0x0000000000000400 );
66 roundMask =
UINT64_C( 0x00000000000007FF );
67 }
else if ( roundingPrecision == 32 ) {
68 roundIncrement =
UINT64_C( 0x0000008000000000 );
69 roundMask =
UINT64_C( 0x000000FFFFFFFFFF );
73 sig |= (sigExtra != 0);
81 roundBits = sig & roundMask;
84 if ( 0x7FFD <= (
uint32_t) (exp - 1) ) {
92 || (sig <= (
uint64_t) (sig + roundIncrement));
94 roundBits = sig & roundMask;
98#ifdef SOFTFLOAT_ROUND_ODD
100 sig |= roundMask + 1;
104 sig += roundIncrement;
105 exp = ((sig &
UINT64_C( 0x8000000000000000 )) != 0);
106 roundIncrement = roundMask + 1;
107 if ( roundNearEven && (roundBits<<1 == roundIncrement) ) {
108 roundMask |= roundIncrement;
115 || ((exp == 0x7FFE) && ((
uint64_t) (sig + roundIncrement) < sig))
124#ifdef SOFTFLOAT_ROUND_ODD
126 sig = (sig & ~roundMask) | (roundMask + 1);
131 sig = (
uint64_t) (sig + roundIncrement);
132 if ( sig < roundIncrement ) {
134 sig =
UINT64_C( 0x8000000000000000 );
136 roundIncrement = roundMask + 1;
137 if ( roundNearEven && (roundBits<<1 == roundIncrement) ) {
138 roundMask |= roundIncrement;
145 doIncrement = (
UINT64_C( 0x8000000000000000 ) <= sigExtra);
154 if ( 0x7FFD <= (
uint32_t) (exp - 1) ) {
163 || (sig <
UINT64_C( 0xFFFFFFFFFFFFFFFF ));
168 sigExtra = sig64Extra.extra;
172#ifdef SOFTFLOAT_ROUND_ODD
179 doIncrement = (
UINT64_C( 0x8000000000000000 ) <= sigExtra);
193 (! (sigExtra &
UINT64_C( 0x7FFFFFFFFFFFFFFF ))
195 exp = ((sig &
UINT64_C( 0x8000000000000000 )) != 0);
201 || ((exp == 0x7FFE) && (sig ==
UINT64_C( 0xFFFFFFFFFFFFFFFF ))
217 sig =
UINT64_C( 0x8000000000000000 );
229#ifdef SOFTFLOAT_ROUND_ODD
240 sig =
UINT64_C( 0x8000000000000000 );
244 (! (sigExtra &
UINT64_C( 0x7FFFFFFFFFFFFFFF ))