Skip to content

Commit 8f025ac

Browse files
committed
fixed s_roundPackToF32/64 and removed unused softfloat files
1 parent f709445 commit 8f025ac

File tree

4 files changed

+4
-137
lines changed

4 files changed

+4
-137
lines changed

src/softfloat/i64_to_f64.c

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/softfloat/s_roundPackToF32.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ float32_t
4646
uint_fast8_t roundingMode;
4747
bool roundNearEven;
4848
uint_fast8_t roundIncrement, roundBits;
49-
#if 0
5049
bool isTiny;
51-
#endif
5250
uint_fast32_t uiZ;
5351
union ui32_f32 uZ;
5452

@@ -71,34 +69,27 @@ float32_t
7169
if ( exp < 0 ) {
7270
/*----------------------------------------------------------------
7371
*----------------------------------------------------------------*/
74-
#if 0
7572
isTiny =
7673
(softfloat_detectTininess == softfloat_tininess_beforeRounding)
7774
|| (exp < -1) || (sig + roundIncrement < 0x80000000);
78-
#endif
7975
sig = softfloat_shiftRightJam32( sig, -exp );
8076
exp = 0;
8177
roundBits = sig & 0x7F;
82-
#if 0
8378
if ( isTiny && roundBits ) {
8479
softfloat_raiseFlags( softfloat_flag_underflow );
8580
}
86-
#endif
8781
} else if ( (0xFD < exp) || (0x80000000 <= sig + roundIncrement) ) {
8882
/*----------------------------------------------------------------
8983
*----------------------------------------------------------------*/
90-
#if 0
9184
softfloat_raiseFlags(
9285
softfloat_flag_overflow | softfloat_flag_inexact );
93-
#endif
9486
uiZ = packToF32UI( sign, 0xFF, 0 ) - ! roundIncrement;
9587
goto uiZ;
9688
}
9789
}
9890
/*------------------------------------------------------------------------
9991
*------------------------------------------------------------------------*/
10092
sig = (sig + roundIncrement)>>7;
101-
#if 0
10293
if ( roundBits ) {
10394
softfloat_exceptionFlags |= softfloat_flag_inexact;
10495
#ifdef SOFTFLOAT_ROUND_ODD
@@ -108,14 +99,13 @@ float32_t
10899
}
109100
#endif
110101
}
111-
#endif
112102
sig &= ~(uint_fast32_t) (! (roundBits ^ 0x40) & roundNearEven);
113103
if ( ! sig ) exp = 0;
114104
/*------------------------------------------------------------------------
115105
*------------------------------------------------------------------------*/
116-
#if 0
106+
#if SOFTFLOAT_ROUND_ODD
117107
packReturn:
118-
#endif
108+
#endif
119109
uiZ = packToF32UI( sign, exp, sig );
120110
uiZ:
121111
uZ.ui = uiZ;

src/softfloat/s_roundPackToF64.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ float64_t
4646
uint_fast8_t roundingMode;
4747
bool roundNearEven;
4848
uint_fast16_t roundIncrement, roundBits;
49-
#if 0
5049
bool isTiny;
51-
#endif
5250
uint_fast64_t uiZ;
5351
union ui64_f64 uZ;
5452

@@ -71,20 +69,16 @@ float64_t
7169
if ( exp < 0 ) {
7270
/*----------------------------------------------------------------
7371
*----------------------------------------------------------------*/
74-
#if 0
7572
isTiny =
7673
(softfloat_detectTininess == softfloat_tininess_beforeRounding)
7774
|| (exp < -1)
7875
|| (sig + roundIncrement < UINT64_C( 0x8000000000000000 ));
79-
#endif
8076
sig = softfloat_shiftRightJam64( sig, -exp );
8177
exp = 0;
8278
roundBits = sig & 0x3FF;
83-
#if 0
8479
if ( isTiny && roundBits ) {
8580
softfloat_raiseFlags( softfloat_flag_underflow );
8681
}
87-
#endif
8882
} else if (
8983
(0x7FD < exp)
9084
|| (UINT64_C( 0x8000000000000000 ) <= sig + roundIncrement)
@@ -113,9 +107,9 @@ float64_t
113107
if ( ! sig ) exp = 0;
114108
/*------------------------------------------------------------------------
115109
*------------------------------------------------------------------------*/
116-
#if 0
110+
#if SOFTFLOAT_ROUND_ODD
117111
packReturn:
118-
#endif
112+
#endif
119113
uiZ = packToF64UI( sign, exp, sig );
120114
uiZ:
121115
uZ.ui = uiZ;

src/softfloat/ui64_to_f64.c

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)