Fix last change; fix large stack frames and int->double conversion
authorMichael Meissner <meissner@gcc.gnu.org>
Thu, 10 Oct 1996 19:33:48 +0000 (19:33 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 10 Oct 1996 19:33:48 +0000 (19:33 +0000)
From-SVN: r12944

gcc/config/rs6000/rs6000.md

index 795afca840ded042673db49f33bed4ad25f6e61e..b24704ebc634ede3428efead65b7220211e380c6 100644 (file)
   "*
 {
   rtx indx;
+  HOST_WIDE_INT offset = rs6000_fpmem_offset;
 
   if (rs6000_fpmem_offset > 32760)
-    indx = operands[1];
+    {
+      indx = operands[1];
+      offset &= 0xffff;
+    }
   else if (frame_pointer_needed)
     indx = frame_pointer_rtx;
   else
     indx = stack_pointer_rtx;
 
   operands[2] = gen_rtx (MEM, SImode,
-                        gen_rtx (PLUS, Pmode,
-                                 indx,
-                                 GEN_INT (rs6000_fpmem_offset)));
+                        gen_rtx (PLUS, Pmode, indx, GEN_INT (offset)));
 
   return \"lfd %0,%2\";
 }"
 {
   operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
   operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
-  split_double (operands[1], &operands[4], &operands[5]);
+
+#ifdef HOST_WORDS_BIG_ENDIAN
+  operands[4] = GEN_INT (CONST_DOUBLE_LOW  (operands[1]));
+  operands[5] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+#else
+  operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+  operands[5] = GEN_INT (CONST_DOUBLE_LOW  (operands[1]));
+#endif
 }")
 
 (define_split
    (set (match_dup 2) (ior:SI (match_dup 2) (match_dup 6)))]
   "
 {
-  rtx high_rtx, low_rtx;
   HOST_WIDE_INT high;
   HOST_WIDE_INT low;
   rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
   rtx low_reg  = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
 
-  split_double (operands[1], &high_rtx, &low_rtx);
-  high = INTVAL (high_rtx);
-  low  = INTVAL (low_rtx);
+#ifdef HOST_WORDS_BIG_ENDIAN
+  high = CONST_DOUBLE_LOW  (operands[1]);
+  low  = CONST_DOUBLE_HIGH (operands[1]);
+#else
+  high = CONST_DOUBLE_HIGH (operands[1]);
+  low  = CONST_DOUBLE_LOW  (operands[1]);
+#endif
 
   if (((unsigned HOST_WIDE_INT) (low + 0x8000) < 0x10000)
       || (low & 0xffff) == 0)
    (set (match_dup 3) (ior:SI (match_dup 3) (match_dup 7)))]
   "
 {
-  rtx high_rtx, low_rtx;
-  HOST_WIDE_INT high;
-  HOST_WIDE_INT low;
-
-  split_double (operands[1], &high_rtx, &low_rtx);
-  high = INTVAL (high_rtx);
-  low  = INTVAL (low_rtx);
+  HOST_WIDE_INT high = CONST_DOUBLE_HIGH (operands[1]);
+  HOST_WIDE_INT low  = CONST_DOUBLE_LOW  (operands[1]);
 
   operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
   operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
 
       if (GET_CODE (operands[1]) == CONST_DOUBLE)
        {
-         rtx high_rtx, low_rtx;
-         split_double (operands[1], &high_rtx, &low_rtx);
-         high = INTVAL (high_rtx);
-         low  = INTVAL (low_rtx);
+         low = CONST_DOUBLE_LOW (operands[1]);
+         high = CONST_DOUBLE_HIGH (operands[1]);
        }
       else
 #if HOST_BITS_PER_WIDE_INT == 32
 {
   operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
   operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
-  split_double (operands[1], &operands[4], &operands[5]);
+  operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+  operands[5] = GEN_INT (CONST_DOUBLE_LOW  (operands[1]));
 }")
 
 (define_split
    (set (match_dup 2) (ior:SI (match_dup 2) (match_dup 6)))]
   "
 {
-  rtx high_rtx, low_rtx;
-  HOST_WIDE_INT high;
-  HOST_WIDE_INT low;
-  rtx high_reg, low_reg;
-
-  if (WORDS_BIG_ENDIAN)
-    {
-      high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
-      low_reg  = gen_rtx (SUBREG, SImode, operands[0], 1);
-      split_double (operands[1], &high_rtx, &low_rtx);
-    }
-  else
-    {
-      high_reg = gen_rtx (SUBREG, SImode, operands[0], 1);
-      low_reg  = gen_rtx (SUBREG, SImode, operands[0], 0);
-      split_double (operands[1], &low_rtx, &high_rtx);
-    }
-
-  high = INTVAL (high_rtx);
-  low  = INTVAL (low_rtx);
+  HOST_WIDE_INT high = CONST_DOUBLE_HIGH (operands[1]);
+  HOST_WIDE_INT low  = CONST_DOUBLE_LOW  (operands[1]);
+  rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+  rtx low_reg  = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
 
   if (((unsigned HOST_WIDE_INT) (low + 0x8000) < 0x10000)
       || (low & 0xffff) == 0)
    (set (match_dup 3) (ior:SI (match_dup 3) (match_dup 7)))]
   "
 {
-  rtx high_rtx, low_rtx;
-  HOST_WIDE_INT high;
-  HOST_WIDE_INT low;
-  rtx high_reg, low_reg;
-
-  if (WORDS_BIG_ENDIAN)
-    {
-      high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
-      low_reg  = gen_rtx (SUBREG, SImode, operands[0], 1);
-      split_double (operands[1], &high_rtx, &low_rtx);
-    }
-  else
-    {
-      high_reg = gen_rtx (SUBREG, SImode, operands[0], 1);
-      low_reg  = gen_rtx (SUBREG, SImode, operands[0], 0);
-      split_double (operands[1], &low_rtx, &high_rtx);
-    }
+  HOST_WIDE_INT high = CONST_DOUBLE_HIGH (operands[1]);
+  HOST_WIDE_INT low  = CONST_DOUBLE_LOW  (operands[1]);
 
   operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
   operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
 
   if (GET_CODE (operands[1]) == CONST_DOUBLE)
     {
-      rtx high_rtx, low_rtx;
-      split_double (operands[1], &high_rtx, &low_rtx);
-      high = INTVAL (high_rtx);
-      low  = INTVAL (low_rtx);
+      low = CONST_DOUBLE_LOW (operands[1]);
+      high = CONST_DOUBLE_HIGH (operands[1]);
     }
   else
 #if HOST_BITS_PER_WIDE_INT == 32