OSDN Git Service

* rs6000.md (insv, extzv): Remove SImode dependence in named
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Jul 1999 12:39:30 +0000 (12:39 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Jul 1999 12:39:30 +0000 (12:39 +0000)
patterns.  Explicitly generate DImode RTL if PowerPC64 and
operand is DImode.
(insvdi): Reverse start and size in instruction template.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28114 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 4f72cdb..71e7ff1 100644 (file)
@@ -1,3 +1,10 @@
+Thu Jul 15 15:15:43 1999  David Edelsohn  <edelsohn@gnu.org>
+
+       * rs6000.md (insv, extzv): Remove SImode dependence in named
+       patterns.  Explicitly generate DImode RTL if PowerPC64 and
+       operand is DImode.
+       (insvdi): Reverse start and size in instruction template.
+
 1999-07-12  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * invoke.texi: Typo fixes.
index 7a97dd1..085db80 100644 (file)
 ;; Rotate and shift insns, in all their variants.  These support shifts,
 ;; field inserts and extracts, and various combinations thereof.
 (define_expand "insv"
-  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
-                        (match_operand:SI 1 "const_int_operand" "i")
-                        (match_operand:SI 2 "const_int_operand" "i"))
-       (match_operand:SI 3 "gpc_reg_operand" "r"))]
+  [(set (zero_extract (match_operand 0 "gpc_reg_operand" "+r")
+                      (match_operand:SI 1 "const_int_operand" "i")
+                      (match_operand:SI 2 "const_int_operand" "i"))
+       (match_operand 3 "gpc_reg_operand" "r"))]
   ""
   "
 {
   if (GET_CODE (operands[0]) == SUBREG
       && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
     FAIL;
+
+  if (TARGET_POWERPC64 && GET_MODE (operands[0]) == DImode)
+    emit_insn (gen_insvdi (operands[0], operands[1], operands[2], operands[3]));
+  else
+    emit_insn (gen_insvsi (operands[0], operands[1], operands[2], operands[3]));
+  DONE;
 }")
 
-(define_insn ""
+(define_insn "insvsi"
   [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
                         (match_operand:SI 1 "const_int_operand" "i")
                         (match_operand:SI 2 "const_int_operand" "i"))
   return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
 }")
 
-(define_insn ""
+(define_insn "*insvsi_internal1"
   [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
                         (match_operand:SI 1 "const_int_operand" "i")
                         (match_operand:SI 2 "const_int_operand" "i"))
   return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
 }")
 
-(define_insn ""
+(define_insn "*insvsi_internal2"
   [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
                         (match_operand:SI 1 "const_int_operand" "i")
                         (match_operand:SI 2 "const_int_operand" "i"))
   return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
 }")
 
-(define_insn ""
+(define_insn "*insvsi_internal3"
   [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
                         (match_operand:SI 1 "const_int_operand" "i")
                         (match_operand:SI 2 "const_int_operand" "i"))
   return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
 }")
 
-(define_insn ""
+(define_insn "*insvsi_internal4"
   [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
                         (match_operand:SI 1 "const_int_operand" "i")
                         (match_operand:SI 2 "const_int_operand" "i"))
   return \"{rlimi|rlwimi} %0,%3,%h5,%h2,%h1\";
 }")
 
-(define_insn ""
+(define_insn "insvdi"
   [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
-                        (match_operand:DI 1 "const_int_operand" "i")
-                        (match_operand:DI 2 "const_int_operand" "i"))
+                        (match_operand:SI 1 "const_int_operand" "i")
+                        (match_operand:SI 2 "const_int_operand" "i"))
        (match_operand:DI 3 "gpc_reg_operand" "r"))]
   "TARGET_POWERPC64"
   "*
   int start = INTVAL (operands[2]) & 63;
   int size = INTVAL (operands[1]) & 63;
 
-  operands[2] = GEN_INT (64 - start - size);
-  return \"rldimi %0,%3,%H2,%H1\";
+  operands[1] = GEN_INT (64 - start - size);
+  return \"rldimi %0,%3,%H1,%H2\";
 }")
 
 (define_expand "extzv"
-  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
-       (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
-                        (match_operand:SI 2 "const_int_operand" "i")
-                        (match_operand:SI 3 "const_int_operand" "i")))]
+  [(set (match_operand 0 "gpc_reg_operand" "=r")
+       (zero_extract (match_operand 1 "gpc_reg_operand" "r")
+                      (match_operand:SI 2 "const_int_operand" "i")
+                      (match_operand:SI 3 "const_int_operand" "i")))]
   ""
   "
 {
   if (GET_CODE (operands[0]) == SUBREG
       && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
     FAIL;
+
+  if (TARGET_POWERPC64 && GET_MODE (operands[1]) == DImode)
+    emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], operands[3]));
+  else
+    emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], operands[3]));
+  DONE;
 }")
 
-(define_insn ""
+(define_insn "extzvsi"
   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
        (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
                         (match_operand:SI 2 "const_int_operand" "i")
   return \"{rlinm|rlwinm} %0,%1,%3,%s2,31\";
 }")
 
-(define_insn ""
+(define_insn "*extzvsi_internal1"
   [(set (match_operand:CC 0 "cc_reg_operand" "=x")
        (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
                         (match_operand:SI 2 "const_int_operand" "i")
 }"
   [(set_attr "type" "compare")])
 
-(define_insn ""
+(define_insn "*extzvsi_internal2"
   [(set (match_operand:CC 4 "cc_reg_operand" "=x")
        (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
                         (match_operand:SI 2 "const_int_operand" "i")
 }"
   [(set_attr "type" "delayed_compare")])
 
-(define_insn ""
+(define_insn "extzvdi"
   [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
        (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
-                        (match_operand:DI 2 "const_int_operand" "i")
-                        (match_operand:DI 3 "const_int_operand" "i")))]
+                        (match_operand:SI 2 "const_int_operand" "i")
+                        (match_operand:SI 3 "const_int_operand" "i")))]
   "TARGET_POWERPC64"
   "*
 {
   return \"rldicl %0,%1,%3,%2\";
 }")
 
-(define_insn ""
+(define_insn "*extzvdi_internal1"
   [(set (match_operand:CC 0 "gpc_reg_operand" "=x")
        (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
-                        (match_operand:DI 2 "const_int_operand" "i")
-                        (match_operand:DI 3 "const_int_operand" "i"))
+                        (match_operand:SI 2 "const_int_operand" "i")
+                        (match_operand:SI 3 "const_int_operand" "i"))
                    (const_int 0)))
    (clobber (match_scratch:DI 4 "=r"))]
   "TARGET_POWERPC64"
   return \"rldicl. %4,%1,%3,%2\";
 }")
 
-(define_insn ""
+(define_insn "*extzvdi_internal2"
   [(set (match_operand:CC 4 "gpc_reg_operand" "=x")
        (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
-                        (match_operand:DI 2 "const_int_operand" "i")
-                        (match_operand:DI 3 "const_int_operand" "i"))
+                        (match_operand:SI 2 "const_int_operand" "i")
+                        (match_operand:SI 3 "const_int_operand" "i"))
                    (const_int 0)))
    (set (match_operand:DI 0 "gpc_reg_operand" "=r")
        (zero_extract:DI (match_dup 1) (match_dup 2) (match_dup 3)))]