OSDN Git Service

Fix 64b-x-32b cross compiler breakage. Make alpha-x-m32r work again.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Feb 1999 17:28:24 +0000 (17:28 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Feb 1999 17:28:24 +0000 (17:28 +0000)
* 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

gcc/ChangeLog
gcc/config/m32r/m32r.md
gcc/emit-rtl.c
gcc/final.c
gcc/real.c

index 6fd861e..5fb1e56 100644 (file)
@@ -1,3 +1,13 @@
+Wed Feb 10 17:12:21 1999  Jim Wilson  <wilson@cygnus.com>
+
+       * 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  <rth@cygnus.com>
 
        * alpha.md (cmov compound patterns): Delete.  Jump can now
index f52a525..3f1e6e5 100644 (file)
   [(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"
index 2e48bde..a761c45 100644 (file)
@@ -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)
index 74c36c2..602c278 100644 (file)
@@ -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
index 3a3f4be..8c5e3fe 100644 (file)
@@ -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
 }