aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorJakub Jelinek <jj@ultra.linux.cz>1999-06-21 19:52:47 +0200
committerRichard Henderson <rth@gcc.gnu.org>1999-06-21 10:52:47 -0700
commit8fc4af0f11b77630079ff1e33a527d933aca1ee0 (patch)
treef88a2e0fc3c24e36bc72c12f112b74f2249cbb76 /gcc/real.c
parent2be15d0fe6c4baaa54a75580fc5333c4b092009f (diff)
downloadgcc-8fc4af0f11b77630079ff1e33a527d933aca1ee0.zip
gcc-8fc4af0f11b77630079ff1e33a527d933aca1ee0.tar.gz
gcc-8fc4af0f11b77630079ff1e33a527d933aca1ee0.tar.bz2
Jakub Jelinek <jj@ultra.linux.cz>
Jakub Jelinek <jj@ultra.linux.cz> * real.c (ereal_from_double): Fix for 64-bit big endian hosts. * emit-rtl.c (gen_lowpart_common): Add case for hosts where double fits in HOST_WIDE_INT and one uses union to access a long constant as double. From-SVN: r27675
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/real.c b/gcc/real.c
index e6a15fe..2d61575 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -6400,17 +6400,19 @@ ereal_from_double (d)
/* Convert array of HOST_WIDE_INT to equivalent array of 16-bit pieces. */
if (REAL_WORDS_BIG_ENDIAN)
{
+#if HOST_BITS_PER_WIDE_INT == 32
s[0] = (unsigned EMUSHORT) (d[0] >> 16);
s[1] = (unsigned EMUSHORT) d[0];
-#if HOST_BITS_PER_WIDE_INT == 32
s[2] = (unsigned EMUSHORT) (d[1] >> 16);
s[3] = (unsigned EMUSHORT) d[1];
#else
/* 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);
+ s[0] = (unsigned EMUSHORT) (d[0] >> 48);
+ s[1] = (unsigned EMUSHORT) (d[0] >> 32);
+ s[2] = (unsigned EMUSHORT) (d[0] >> 16);
+ s[3] = (unsigned EMUSHORT) d[0];
#endif
}
else