Patch for Granlund's soft-fp lib

Hartmut Schirmer hartmut.schirmer@arcor.de
Mon Jun 30 16:05:00 GMT 2003


Hi,

Torbjorn Granlund  published a soft-fp lib for GCC in 1999
(see http://gcc.gnu.org/ml/gcc/1999-07n/msg00553.html)

There's a bug in the float comparison routines.
The patch below fixes this problem.

Hartmut

*** gieee/ieeelib.c Thu Mar 27 10:21:35 2003
--- ieeelib.c Mon Jun 30 12:41:16 2003
***************
*** 116,122 ****
    do {         \
      union real_extract_1 di;      \
      di.d = (dbl);       \
!     (exp) = ((di.u >> (MANTISSA_BITS - 1)) & EXP_MASK) ^ (di.u >>
SIGN_POS); \
      (m) = (di.u & (((COMPUTE_TYPE) 1 << (MANTISSA_BITS - 1)) - 1)) <<
EXP_BITS; \
    } while (0)

--- 131,137 ----
    do {         \
      union real_extract_1 di;      \
      di.d = (dbl);       \
!     (exp) = ((di.u >> (MANTISSA_BITS - 1)) & EXP_MASK) ^
((COMPUTE_STYPE)di.u >> SIGN_POS); \
      (m) = (di.u & (((COMPUTE_TYPE) 1 << (MANTISSA_BITS - 1)) - 1)) <<
EXP_BITS; \
    } while (0)






More information about the Gcc mailing list