diff options
author | Jeffrey A Law <law@cygnus.com> | 1997-08-12 17:13:25 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1997-08-12 11:13:25 -0600 |
commit | 7bb6fbd1c6cab78c8b626caac74a387f8e1dc5b5 (patch) | |
tree | 6af686cdfe6c11c549f23151dfd216cd90b4573f /gcc/real.c | |
parent | 8f87a56384ff536fb794390a541437b4261b2fd2 (diff) | |
download | gcc-7bb6fbd1c6cab78c8b626caac74a387f8e1dc5b5.zip gcc-7bb6fbd1c6cab78c8b626caac74a387f8e1dc5b5.tar.gz gcc-7bb6fbd1c6cab78c8b626caac74a387f8e1dc5b5.tar.bz2 |
version.c: Bump version to "gcc-3.0.0 970802 experimental".
* version.c: Bump version to "gcc-3.0.0 970802 experimental".
* gcc.info*: Rebuilt.
* COPYING.g77, README.g77: New files.
* real.c (ereal_unto_float, ereal_unto_double): New functions.
* real.h (ereal_unto_float, ereal_unto_double): Declare them.
(REAL_VALUE_UNTO_TARGET_DOUBLE, REAL_VALUE_UNTO_TARGET_SINGLE): Define.
Get g77 to work with gcc3.
From-SVN: r14776
Diffstat (limited to 'gcc/real.c')
-rw-r--r-- | gcc/real.c | 74 |
1 files changed, 70 insertions, 4 deletions
@@ -5799,11 +5799,77 @@ make_nan (nan, sign, mode) *nan = (sign << 15) | *p; } -/* Convert an SFmode target `float' value to a REAL_VALUE_TYPE. - This is the inverse of the function `etarsingle' invoked by +/* This is the inverse of the function `etarsingle' invoked by REAL_VALUE_TO_TARGET_SINGLE. */ REAL_VALUE_TYPE +ereal_unto_float (f) + long f; +{ + REAL_VALUE_TYPE r; + unsigned EMUSHORT s[2]; + unsigned EMUSHORT e[NE]; + + /* Convert 32 bit integer to array of 16 bit pieces in target machine order. + This is the inverse operation to what the function `endian' does. */ + if (REAL_WORDS_BIG_ENDIAN) + { + s[0] = (unsigned EMUSHORT) (f >> 16); + s[1] = (unsigned EMUSHORT) f; + } + else + { + s[0] = (unsigned EMUSHORT) f; + s[1] = (unsigned EMUSHORT) (f >> 16); + } + /* Convert and promote the target float to E-type. */ + e24toe (s, e); + /* Output E-type to REAL_VALUE_TYPE. */ + PUT_REAL (e, &r); + return r; +} + + +/* This is the inverse of the function `etardouble' invoked by + REAL_VALUE_TO_TARGET_DOUBLE. */ + +REAL_VALUE_TYPE +ereal_unto_double (d) + long d[]; +{ + REAL_VALUE_TYPE r; + unsigned EMUSHORT s[4]; + unsigned EMUSHORT e[NE]; + + /* Convert array of HOST_WIDE_INT to equivalent array of 16-bit pieces. */ + if (REAL_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]; + } + 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); + } + /* Convert target double to E-type. */ + e53toe (s, e); + /* Output E-type to REAL_VALUE_TYPE. */ + PUT_REAL (e, &r); + return r; +} + + +/* Convert an SFmode target `float' value to a REAL_VALUE_TYPE. + This is somewhat like ereal_unto_float, but the input types + for these are different. */ + +REAL_VALUE_TYPE ereal_from_float (f) HOST_WIDE_INT f; { @@ -5832,8 +5898,8 @@ ereal_from_float (f) /* Convert a DFmode target `double' value to a REAL_VALUE_TYPE. - This is the inverse of the function `etardouble' invoked by - REAL_VALUE_TO_TARGET_DOUBLE. + This is somewhat like ereal_unto_double, but the input types + for these are different. 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 |