re PR target/19137 (ICE with load of TImode constant)
authorAlan Modra <amodra@bigpond.net.au>
Sat, 25 Dec 2004 12:41:02 +0000 (12:41 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Sat, 25 Dec 2004 12:41:02 +0000 (23:11 +1030)
PR target/19137
* config/rs6000/rs6000.md (movti_power, movti_string): Relax
operand[1] predicate to input_operand, and add r<-n alternative.
Move TImode const_double_operand splitter to where it belongs.

From-SVN: r92603

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index d8fcc9085ff35598153878194c37250e67c12e25..c9139a392db37b8e3323034ed89accaf5ae31651 100644 (file)
@@ -1,3 +1,10 @@
+2004-12-25  Alan Modra  <amodra@bigpond.net.au>
+
+       PR target/19137
+       * config/rs6000/rs6000.md (movti_power, movti_string): Relax
+       operand[1] predicate to input_operand, and add r<-n alternative.
+       Move TImode const_double_operand splitter to where it belongs.
+
 2004-12-25  Alan Modra  <amodra@bigpond.net.au>
 
        PR target/19147
index 6a6486066bc7a66a2b934ab5c2d2122cca724e1b..c5b1dcdf21f54b8ee85c9a91f461d7bbe3bf4c18 100644 (file)
   [(pc)]
 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
 
-(define_split
-  [(set (match_operand:TI 0 "gpc_reg_operand" "")
-       (match_operand:TI 1 "const_double_operand" ""))]
-  "TARGET_POWERPC64"
-  [(set (match_dup 2) (match_dup 4))
-   (set (match_dup 3) (match_dup 5))]
-  "
-{
-  operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
-                                      TImode);
-  operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
-                                      TImode);
-  if (GET_CODE (operands[1]) == CONST_DOUBLE)
-    {
-      operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
-      operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
-    }
-  else if (GET_CODE (operands[1]) == CONST_INT)
-    {
-      operands[4] = GEN_INT (- (INTVAL (operands[1]) < 0));
-      operands[5] = operands[1];
-    }
-  else
-    FAIL;
-}")
-
 (define_insn "*movdi_internal64"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,*f,*f,m,r,*h,*h")
        (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,f,m,f,*h,r,0"))]
 ;; giving the SCRATCH mq.
 
 (define_insn "*movti_power"
-  [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
-       (match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))
-   (clobber (match_scratch:SI 2 "=q,q#X,X,X,X"))]
+  [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r,r")
+       (match_operand:TI 1 "input_operand" "r,r,r,Q,m,n"))
+   (clobber (match_scratch:SI 2 "=q,q#X,X,X,X,X"))]
   "TARGET_POWER && ! TARGET_POWERPC64
    && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
   "*
        return \"{lsi|lswi} %0,%P1,16\";
       /* ... fall through ...  */
     case 4:
+    case 5:
       return \"#\";
     }
 }"
-  [(set_attr "type" "store,store,*,load,load")])
+  [(set_attr "type" "store,store,*,load,load,*")])
 
 (define_insn "*movti_string"
-  [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,o<>,????r,????r,????r")
-       (match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))]
+  [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,o<>,????r,????r,????r,r")
+       (match_operand:TI 1 "input_operand" "r,r,r,Q,m,n"))]
   "! TARGET_POWER && ! TARGET_POWERPC64
    && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
   "*
        return \"{lsi|lswi} %0,%P1,16\";
       /* ... fall through ...  */
     case 4:
+    case 5:
       return \"#\";
     }
 }"
-  [(set_attr "type" "store,store,*,load,load")])
+  [(set_attr "type" "store,store,*,load,load,*")])
 
 (define_insn "*movti_ppc64"
   [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o<>,r")
   "#"
   [(set_attr "type" "*,load,store")])
 
+(define_split
+  [(set (match_operand:TI 0 "gpc_reg_operand" "")
+       (match_operand:TI 1 "const_double_operand" ""))]
+  "TARGET_POWERPC64"
+  [(set (match_dup 2) (match_dup 4))
+   (set (match_dup 3) (match_dup 5))]
+  "
+{
+  operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
+                                      TImode);
+  operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
+                                      TImode);
+  if (GET_CODE (operands[1]) == CONST_DOUBLE)
+    {
+      operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+      operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+    }
+  else if (GET_CODE (operands[1]) == CONST_INT)
+    {
+      operands[4] = GEN_INT (- (INTVAL (operands[1]) < 0));
+      operands[5] = operands[1];
+    }
+  else
+    FAIL;
+}")
+
 (define_split
   [(set (match_operand:TI 0 "nonimmediate_operand" "")
         (match_operand:TI 1 "input_operand" ""))]