From: wilson Date: Wed, 10 Feb 1999 17:28:24 +0000 (+0000) Subject: Fix 64b-x-32b cross compiler breakage. Make alpha-x-m32r work again. X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=eb294a2f2c9c562b10e723e654e4187b5b4aa341;p=pf3gnuchains%2Fgcc-fork.git Fix 64b-x-32b cross compiler breakage. Make alpha-x-m32r work again. * emit-rtl.c (operand_subword): Sign extend REAL_VALUE_TO_TARGET_SINGLE result. * final.c (split_double): Sign extend REAL_VALUE_TO_TARGET_DOUBLE result. * real.c (endian): Delete sign extension code. * config/m32r/m32r.md (movsf_insn+1): REAL_VALUE_TO_TARGET_SINGLE call replaced with operand_subword call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25140 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6fd861ea697..5fb1e563d1a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +Wed Feb 10 17:12:21 1999 Jim Wilson + + * emit-rtl.c (operand_subword): Sign extend REAL_VALUE_TO_TARGET_SINGLE + result. + * final.c (split_double): Sign extend REAL_VALUE_TO_TARGET_DOUBLE + result. + * real.c (endian): Delete sign extension code. + * config/m32r/m32r.md (movsf_insn+1): REAL_VALUE_TO_TARGET_SINGLE call + replaced with operand_subword call. + Wed Feb 10 15:16:39 1999 Richard Henderson * alpha.md (cmov compound patterns): Delete. Jump can now diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md index f52a5257d23..3f1e6e51f71 100644 --- a/gcc/config/m32r/m32r.md +++ b/gcc/config/m32r/m32r.md @@ -589,14 +589,8 @@ [(set (match_dup 2) (match_dup 3))] " { - long l; - REAL_VALUE_TYPE rv; - - REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]); - REAL_VALUE_TO_TARGET_SINGLE (rv, l); - operands[2] = operand_subword (operands[0], 0, 0, SFmode); - operands[3] = GEN_INT (l); + operands[3] = operand_subword (operands[1], 0, 0, SFmode); }") (define_expand "movdf" diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 2e48bde2983..a761c45745a 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1303,6 +1303,18 @@ operand_subword (op, i, validate_address, mode) REAL_VALUE_FROM_CONST_DOUBLE (rv, op); REAL_VALUE_TO_TARGET_SINGLE (rv, l); + /* If 32 bits is an entire word for the target, but not for the host, + then sign-extend on the host so that the number will look the same + way on the host that it would on the target. See for instance + simplify_unary_operation. The #if is needed to avoid compiler + warnings. */ + +#if HOST_BITS_PER_LONG > 32 + if (BITS_PER_WORD < HOST_BITS_PER_LONG && BITS_PER_WORD == 32 + && (l & ((long) 1 << 31))) + l |= ((long) (-1) << 32); +#endif + if (BITS_PER_WORD == 16) { if ((i & 0x1) == !WORDS_BIG_ENDIAN) diff --git a/gcc/final.c b/gcc/final.c index 74c36c2467b..602c27823fd 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3929,6 +3929,22 @@ split_double (value, first, second) not necessarily BITS_PER_WORD bits. */ REAL_VALUE_TO_TARGET_DOUBLE (r, l); + /* If 32 bits is an entire word for the target, but not for the host, + then sign-extend on the host so that the number will look the same + way on the host that it would on the target. See for instance + simplify_unary_operation. The #if is needed to avoid compiler + warnings. */ + +#if HOST_BITS_PER_LONG > 32 + if (BITS_PER_WORD < HOST_BITS_PER_LONG && BITS_PER_WORD == 32) + { + if (l[0] & ((long) 1 << 31)) + l[0] |= ((long) (-1) << 32); + if (l[1] & ((long) 1 << 31)) + l[1] |= ((long) (-1) << 32); + } +#endif + *first = GEN_INT ((HOST_WIDE_INT) l[0]); *second = GEN_INT ((HOST_WIDE_INT) l[1]); #else diff --git a/gcc/real.c b/gcc/real.c index 3a3f4be50ba..8c5e3fe805b 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -558,23 +558,6 @@ endian (e, x, mode) abort (); } } - - /* If 32 bits is an entire word for the target, but not for the host, - then sign-extend on the host so that the number will look the same - way on the host that it would on the target. See for instance - simplify_unary_operation. The #if is needed to avoid compiler - warnings. */ - -#if HOST_BITS_PER_WIDE_INT > 32 - if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT && BITS_PER_WORD == 32) - { - if (x[0] & ((HOST_WIDE_INT) 1 << 31)) - x[0] |= ((HOST_WIDE_INT) (-1) << 32); - - if (x[1] & ((HOST_WIDE_INT) 1 << 31)) - x[1] |= ((HOST_WIDE_INT) (-1) << 32); - } -#endif }