OSDN Git Service

* config/alpha/alpha.c (alpha_comparison_operator): Don't be
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 May 2000 07:04:21 +0000 (07:04 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 May 2000 07:04:21 +0000 (07:04 +0000)
        so strict about DImode.
        (alpha_swapped_comparison_operator): Likewise.
        * config/alpha/alpha.md (*setne_internal): Name it.  Allow
        any integer output mode.
        (*setcc_internal): Likewise.
        (*setcc_swapped_internal): Likewise.
        (*movdicc_internal, *movdicc_lbc, *movdicc_lbs): Name them.
        (*mov[qhs]icc_internal): New.
        (*mov[qhs]icc_lbc, *mov[qhs]icc_lbs): New.

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

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.md

index ac55179..86f6662 100644 (file)
@@ -1,3 +1,16 @@
+2000-05-25  Richard Henderson  <rth@cygnus.com>
+
+       * config/alpha/alpha.c (alpha_comparison_operator): Don't be
+       so strict about DImode.
+       (alpha_swapped_comparison_operator): Likewise.
+       * config/alpha/alpha.md (*setne_internal): Name it.  Allow
+       any integer output mode.
+       (*setcc_internal): Likewise.
+       (*setcc_swapped_internal): Likewise.
+       (*movdicc_internal, *movdicc_lbc, *movdicc_lbs): Name them.
+       (*mov[qhs]icc_internal): New.
+       (*mov[qhs]icc_lbc, *mov[qhs]icc_lbs): New.
+
 2000-05-25  J. David Anglin  <dave@hiauly1.hia.nrc.ca>
 
        * vax.h (CPP_SPEC): Define __GFLOAT and GFLOAT when -mg is specified.
index d19f0b0..41f7f6c 100644 (file)
@@ -714,7 +714,7 @@ alpha_comparison_operator (op, mode)
     return 0;
 
   return (code == EQ || code == LE || code == LT
-         || (mode == DImode && (code == LEU || code == LTU)));
+         || code == LEU || code == LTU);
 }
 
 /* Return 1 if OP is a valid Alpha swapped comparison operator.  */
@@ -732,7 +732,7 @@ alpha_swapped_comparison_operator (op, mode)
 
   code = swap_condition (code);
   return (code == EQ || code == LE || code == LT
-         || (mode == DImode && (code == LEU || code == LTU)));
+         || code == LEU || code == LTU);
 }
 
 /* Return 1 if OP is a signed comparison operation.  */
index 10b5aa1..f1c1340 100644 (file)
 ;; Next are all the integer comparisons, and conditional moves and branches
 ;; and some of the related define_expand's and define_split's.
 
-(define_insn ""
-  [(set (match_operand:DI 0 "register_operand" "=r")
-       (ne:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")
-              (const_int 0)))]
-  ""
+(define_insn "*setne_internal"
+  [(set (match_operand 0 "register_operand" "=r")
+       (ne (match_operand:DI 1 "reg_or_8bit_operand" "rI")
+           (const_int 0)))]
+  "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT
+   && GET_MODE_SIZE (GET_MODE (operands[0])) <= 8
+   && GET_MODE (operands[0]) == GET_MODE (SET_SRC (PATTERN (insn)))"
   "cmpult $31,%1,%0"
   [(set_attr "type" "icmp")])
 
-(define_insn ""
-  [(set (match_operand:DI 0 "register_operand" "=r")
-       (match_operator:DI 1 "alpha_comparison_operator"
+(define_insn "*setcc_internal"
+  [(set (match_operand 0 "register_operand" "=r")
+       (match_operator 1 "alpha_comparison_operator"
                           [(match_operand:DI 2 "reg_or_0_operand" "rJ")
                            (match_operand:DI 3 "reg_or_8bit_operand" "rI")]))]
-  ""
+  "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT
+   && GET_MODE_SIZE (GET_MODE (operands[0])) <= 8
+   && GET_MODE (operands[0]) == GET_MODE (operands[1])"
   "cmp%C1 %r2,%3,%0"
   [(set_attr "type" "icmp")])
 
-(define_insn ""
-  [(set (match_operand:DI 0 "register_operand" "=r")
-        (match_operator:DI 1 "alpha_swapped_comparison_operator"
+(define_insn "*setcc_swapped_internal"
+  [(set (match_operand 0 "register_operand" "=r")
+        (match_operator 1 "alpha_swapped_comparison_operator"
                           [(match_operand:DI 2 "reg_or_8bit_operand" "rI")
                            (match_operand:DI 3 "reg_or_0_operand" "rJ")]))]
-  ""
+  "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT
+   && GET_MODE_SIZE (GET_MODE (operands[0])) <= 8
+   && GET_MODE (operands[0]) == GET_MODE (operands[1])"
   "cmp%c1 %r3,%2,%0"
   [(set_attr "type" "icmp")])
 
-;; This pattern exists so conditional moves of SImode values are handled.
-;; Comparisons are still done in DImode though.
+;; The mode folding trick can't be used with const_int operands, since
+;; reload needs to know the proper mode.
 
-(define_insn ""
+(define_insn "*movqicc_internal"
+  [(set (match_operand:QI 0 "register_operand" "=r,r,r,r")
+       (if_then_else:QI
+        (match_operator 2 "signed_comparison_operator"
+                        [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
+                         (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
+        (match_operand:QI 1 "reg_or_8bit_operand" "rI,0,rI,0")
+        (match_operand:QI 5 "reg_or_8bit_operand" "0,rI,0,rI")))]
+  "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
+  "@
+   cmov%C2 %r3,%1,%0
+   cmov%D2 %r3,%5,%0
+   cmov%c2 %r4,%1,%0
+   cmov%d2 %r4,%5,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movhicc_internal"
+  [(set (match_operand:HI 0 "register_operand" "=r,r,r,r")
+       (if_then_else:HI
+        (match_operator 2 "signed_comparison_operator"
+                        [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
+                         (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
+        (match_operand:HI 1 "reg_or_8bit_operand" "rI,0,rI,0")
+        (match_operand:HI 5 "reg_or_8bit_operand" "0,rI,0,rI")))]
+  "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
+  "@
+   cmov%C2 %r3,%1,%0
+   cmov%D2 %r3,%5,%0
+   cmov%c2 %r4,%1,%0
+   cmov%d2 %r4,%5,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movsicc_internal"
   [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
        (if_then_else:SI
         (match_operator 2 "signed_comparison_operator"
                          (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
         (match_operand:SI 1 "reg_or_8bit_operand" "rI,0,rI,0")
         (match_operand:SI 5 "reg_or_8bit_operand" "0,rI,0,rI")))]
-  "operands[3] == const0_rtx || operands[4] == const0_rtx"
+  "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
   "@
    cmov%C2 %r3,%1,%0
    cmov%D2 %r3,%5,%0
    cmov%d2 %r4,%5,%0"
   [(set_attr "type" "icmov")])
 
-(define_insn ""
+(define_insn "*movdicc_internal"
   [(set (match_operand:DI 0 "register_operand" "=r,r,r,r")
        (if_then_else:DI
         (match_operator 2 "signed_comparison_operator"
                          (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
         (match_operand:DI 1 "reg_or_8bit_operand" "rI,0,rI,0")
         (match_operand:DI 5 "reg_or_8bit_operand" "0,rI,0,rI")))]
-  "operands[3] == const0_rtx || operands[4] == const0_rtx"
+  "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
   "@
    cmov%C2 %r3,%1,%0
    cmov%D2 %r3,%5,%0
    cmov%d2 %r4,%5,%0"
   [(set_attr "type" "icmov")])
 
-(define_insn ""
+(define_insn "*movqicc_lbc"
+  [(set (match_operand:QI 0 "register_operand" "=r,r")
+       (if_then_else:QI
+        (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
+                             (const_int 1)
+                             (const_int 0))
+            (const_int 0))
+        (match_operand:QI 1 "reg_or_8bit_operand" "rI,0")
+        (match_operand:QI 3 "reg_or_8bit_operand" "0,rI")))]
+  ""
+  "@
+   cmovlbc %r2,%1,%0
+   cmovlbs %r2,%3,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movhicc_lbc"
+  [(set (match_operand:HI 0 "register_operand" "=r,r")
+       (if_then_else:HI
+        (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
+                             (const_int 1)
+                             (const_int 0))
+            (const_int 0))
+        (match_operand:HI 1 "reg_or_8bit_operand" "rI,0")
+        (match_operand:HI 3 "reg_or_8bit_operand" "0,rI")))]
+  ""
+  "@
+   cmovlbc %r2,%1,%0
+   cmovlbs %r2,%3,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movsicc_lbc"
+  [(set (match_operand:SI 0 "register_operand" "=r,r")
+       (if_then_else:SI
+        (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
+                             (const_int 1)
+                             (const_int 0))
+            (const_int 0))
+        (match_operand:SI 1 "reg_or_8bit_operand" "rI,0")
+        (match_operand:SI 3 "reg_or_8bit_operand" "0,rI")))]
+  ""
+  "@
+   cmovlbc %r2,%1,%0
+   cmovlbs %r2,%3,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movdicc_lbc"
   [(set (match_operand:DI 0 "register_operand" "=r,r")
        (if_then_else:DI
         (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
    cmovlbs %r2,%3,%0"
   [(set_attr "type" "icmov")])
 
-(define_insn ""
+(define_insn "*movqicc_lbs"
+  [(set (match_operand:QI 0 "register_operand" "=r,r")
+       (if_then_else:QI
+        (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
+                             (const_int 1)
+                             (const_int 0))
+            (const_int 0))
+        (match_operand:QI 1 "reg_or_8bit_operand" "rI,0")
+        (match_operand:QI 3 "reg_or_8bit_operand" "0,rI")))]
+  ""
+  "@
+   cmovlbs %r2,%1,%0
+   cmovlbc %r2,%3,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movhicc_lbs"
+  [(set (match_operand:HI 0 "register_operand" "=r,r")
+       (if_then_else:HI
+        (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
+                             (const_int 1)
+                             (const_int 0))
+            (const_int 0))
+        (match_operand:HI 1 "reg_or_8bit_operand" "rI,0")
+        (match_operand:HI 3 "reg_or_8bit_operand" "0,rI")))]
+  ""
+  "@
+   cmovlbs %r2,%1,%0
+   cmovlbc %r2,%3,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movsicc_lbs"
+  [(set (match_operand:SI 0 "register_operand" "=r,r")
+       (if_then_else:SI
+        (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
+                             (const_int 1)
+                             (const_int 0))
+            (const_int 0))
+        (match_operand:SI 1 "reg_or_8bit_operand" "rI,0")
+        (match_operand:SI 3 "reg_or_8bit_operand" "0,rI")))]
+  ""
+  "@
+   cmovlbs %r2,%1,%0
+   cmovlbc %r2,%3,%0"
+  [(set_attr "type" "icmov")])
+
+(define_insn "*movdicc_lbs"
   [(set (match_operand:DI 0 "register_operand" "=r,r")
        (if_then_else:DI
         (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")