From 2f68265422fe2d4691379802b6e1f5d09a03fa4b Mon Sep 17 00:00:00 2001 From: rth Date: Mon, 21 Jun 1999 17:52:47 +0000 Subject: Jakub Jelinek * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27675 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/real.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/real.c') diff --git a/gcc/real.c b/gcc/real.c index e6a15fed515..2d615757af1 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 -- cgit v1.2.1