diff options
author | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2011-06-12 20:27:10 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2011-06-12 20:27:10 -0700 |
commit | 740f981cfd55604d46598144dccac26dd53f643c (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /softfloat/s_roundPackToF32.c | |
parent | c0ebf99d6bb3ef3cf252703b50b849bcbaa2ec59 (diff) | |
download | spike-740f981cfd55604d46598144dccac26dd53f643c.zip spike-740f981cfd55604d46598144dccac26dd53f643c.tar.gz spike-740f981cfd55604d46598144dccac26dd53f643c.tar.bz2 |
[sim] renamed to riscv-isa-run
Diffstat (limited to 'softfloat/s_roundPackToF32.c')
-rwxr-xr-x | softfloat/s_roundPackToF32.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/softfloat/s_roundPackToF32.c b/softfloat/s_roundPackToF32.c deleted file mode 100755 index 11764f1..0000000 --- a/softfloat/s_roundPackToF32.c +++ /dev/null @@ -1,65 +0,0 @@ - -#include <stdbool.h> -#include <stdint.h> -#include "platform.h" -#include "primitives.h" -#include "internals.h" -#include "softfloat.h" - -float32_t - softfloat_roundPackToF32( bool sign, int_fast16_t exp, uint_fast32_t sig ) -{ - int roundingMode; - bool roundNearestEven; - int roundIncrement, roundBits; - bool isTiny; - uint_fast32_t uiZ; - union ui32_f32 uZ; - - roundingMode = softfloat_roundingMode; - roundNearestEven = ( roundingMode == softfloat_round_nearest_even ); - roundIncrement = 0x40; - if ( - ! roundNearestEven - && ( roundingMode != softfloat_round_nearest_maxMag ) - ) { - roundIncrement = - ( roundingMode == softfloat_round_minMag ) - || ( roundingMode - == ( sign ? softfloat_round_max : softfloat_round_min ) ) - ? 0 - : 0x7F; - } - roundBits = sig & 0x7F; - if ( 0xFD <= (uint16_t) exp ) { - if ( exp < 0 ) { - isTiny = - ( softfloat_detectTininess - == softfloat_tininess_beforeRounding ) - || ( exp < -1 ) - || ( sig + roundIncrement < 0x80000000 ); - sig = softfloat_shift32RightJam( sig, - exp ); - exp = 0; - roundBits = sig & 0x7F; - if ( isTiny && roundBits ) { - softfloat_raiseFlags( softfloat_flag_underflow ); - } - } else if ( - ( 0xFD < exp ) || ( 0x80000000 <= sig + roundIncrement ) - ) { - softfloat_raiseFlags( - softfloat_flag_overflow | softfloat_flag_inexact ); - uiZ = packToF32UI( sign, 0xFF, 0 ) - ! roundIncrement; - goto uiZ; - } - } - if ( roundBits ) softfloat_exceptionFlags |= softfloat_flag_inexact; - sig = ( sig + roundIncrement )>>7; - sig &= ~ ( ! ( roundBits ^ 0x40 ) & roundNearestEven ); - uiZ = packToF32UI( sign, sig ? exp : 0, sig ); - uiZ: - uZ.ui = uiZ; - return uZ.f; - -} - |