diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-16 17:44:34 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-16 17:44:34 -0400 |
commit | 04ae9e4ccd10764edd8330e6fa5351e5997f1ead (patch) | |
tree | 40f772ec466705d03c1c5e1f1378c12c1aaf4bf5 | |
parent | 403cd5d7f822a8e000cf814275f4fecaa25fa591 (diff) | |
download | gcc-04ae9e4ccd10764edd8330e6fa5351e5997f1ead.zip gcc-04ae9e4ccd10764edd8330e6fa5351e5997f1ead.tar.gz gcc-04ae9e4ccd10764edd8330e6fa5351e5997f1ead.tar.bz2 |
(ereal_from_float, .._double): Change arg from long to HOST_WIDE_INT
and unpack the HOST_WIDE_INTs.
From-SVN: r7312
-rw-r--r-- | gcc/real.c | 38 |
1 files changed, 28 insertions, 10 deletions
@@ -5489,7 +5489,7 @@ make_nan (nan, sign, mode) REAL_VALUE_TYPE ereal_from_float (f) - unsigned long f; + HOST_WIDE_INT f; { REAL_VALUE_TYPE r; unsigned EMUSHORT s[2]; @@ -5516,31 +5516,49 @@ ereal_from_float (f) This is the inverse of the function `etardouble' invoked by REAL_VALUE_TO_TARGET_DOUBLE. - The DFmode is stored as an array of long ints - with 32 bits of the value per each long. The first element + The DFmode is stored as an array of HOST_WIDE_INT in the target's + data format, with no holes in the bit packing. The first element of the input array holds the bits that would come first in the target computer's memory. */ REAL_VALUE_TYPE ereal_from_double (d) - unsigned long d[]; + HOST_WIDE_INT d[]; { REAL_VALUE_TYPE r; unsigned EMUSHORT s[4]; unsigned EMUSHORT e[NE]; - /* Convert array of 32 bit pieces to equivalent array of 16 bit pieces. - This is the inverse of `endian'. */ + /* Convert array of HOST_WIDE_INT to equivalent array of 16-bit pieces. */ #if FLOAT_WORDS_BIG_ENDIAN s[0] = (unsigned EMUSHORT) (d[0] >> 16); s[1] = (unsigned EMUSHORT) d[0]; - s[2] = (unsigned EMUSHORT) (d[1] >> 16); - s[3] = (unsigned EMUSHORT) d[1]; + if (HOST_BITS_PER_WIDE_INT >= 64) + { + /* In this case the entire target double is contained in the + first array element. The second element of the input is ignored. */ + s[2] = (unsigned EMUSHORT) (d[0] >> 48); + s[3] = (unsigned EMUSHORT) (d[0] >> 32); + } + else + { + s[2] = (unsigned EMUSHORT) (d[1] >> 16); + s[3] = (unsigned EMUSHORT) d[1]; + } #else +/* Target float words are little-endian. */ s[0] = (unsigned EMUSHORT) d[0]; s[1] = (unsigned EMUSHORT) (d[0] >> 16); - s[2] = (unsigned EMUSHORT) d[1]; - s[3] = (unsigned EMUSHORT) (d[1] >> 16); + if (HOST_BITS_PER_WIDE_INT >= 64) + { + s[2] = (unsigned EMUSHORT) (d[0] >> 32); + s[3] = (unsigned EMUSHORT) (d[0] >> 48); + } + else + { + s[2] = (unsigned EMUSHORT) d[1]; + s[3] = (unsigned EMUSHORT) (d[1] >> 16); + } #endif /* Convert target double to E-type. */ e53toe (s, e); |