OSDN Git Service

Fix previous change to work on both endian hosts and targets
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Oct 1996 20:14:15 +0000 (20:14 +0000)
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Oct 1996 20:14:15 +0000 (20:14 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12909 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/rs6000/rs6000.md

index e80f66e..795afca 100644 (file)
   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);
+  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);
+    }
 
-  split_double (operands[1], &high_rtx, &low_rtx);
   high = INTVAL (high_rtx);
   low  = INTVAL (low_rtx);
 
   rtx high_rtx, low_rtx;
   HOST_WIDE_INT high;
   HOST_WIDE_INT low;
+  rtx high_reg, low_reg;
 
-  split_double (operands[1], &high_rtx, &low_rtx);
-  high = INTVAL (high_rtx);
-  low  = INTVAL (low_rtx);
+  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);
+    }
 
   operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
   operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);