re PR target/63187 (Unrecognizable insn ICE due to revision 214080)
authorSegher Boessenkool <segher@kernel.crashing.org>
Fri, 5 Sep 2014 19:17:08 +0000 (21:17 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Fri, 5 Sep 2014 19:17:08 +0000 (21:17 +0200)
2014-09-05  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/63187
* config/rs6000/rs6000.md (*and<mode>3_imm_dot, *and<mode>3_imm_dot2):
Do not allow any_mask_operand for operands[2].
(*and<mode>3_imm_mask_dot, *and<mode>3_imm_mask_dot2): New.

From-SVN: r214976

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

index dd767585ef6ea08a62dd771e8bfbcefe2c7cd253..18951b3b47e589165c6b64020271d402a9808d33 100644 (file)
@@ -1,3 +1,10 @@
+2014-09-05  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/63187
+       * config/rs6000/rs6000.md (*and<mode>3_imm_dot, *and<mode>3_imm_dot2):
+       Do not allow any_mask_operand for operands[2].
+       (*and<mode>3_imm_mask_dot, *and<mode>3_imm_mask_dot2): New.
+
 2014-09-05  David Malcolm  <dmalcolm@redhat.com>
 
        * config/arc/arc.c (arc_print_operand): Use insn method of
index 8f3549ebdd8cf653a6f0fa54e0a9e99d6e44aaeb..2df8e4193fd8f33f1253b950a693a155cb8c753b 100644 (file)
    (clobber (match_scratch:GPR 0 "=r,r"))
    (clobber (match_scratch:CC 4 "=X,x"))]
   "(<MODE>mode == Pmode || UINTVAL (operands[2]) <= 0x7fffffff)
-   && rs6000_gen_cell_microcode"
+   && rs6000_gen_cell_microcode
+   && !any_mask_operand (operands[2], <MODE>mode)"
   "@
    andi%e2. %0,%1,%u2
    #"
                 (match_dup 2)))
    (clobber (match_scratch:CC 4 "=X,x"))]
   "(<MODE>mode == Pmode || UINTVAL (operands[2]) <= 0x7fffffff)
-   && rs6000_gen_cell_microcode"
+   && rs6000_gen_cell_microcode
+   && !any_mask_operand (operands[2], <MODE>mode)"
   "@
    andi%e2. %0,%1,%u2
    #"
    (set_attr "dot" "yes")
    (set_attr "length" "4,8")])
 
+(define_insn_and_split "*and<mode>3_imm_mask_dot"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,??y")
+       (compare:CC (and:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,r")
+                            (match_operand:GPR 2 "logical_const_operand" "n,n"))
+                   (const_int 0)))
+   (clobber (match_scratch:GPR 0 "=r,r"))]
+  "(<MODE>mode == Pmode || UINTVAL (operands[2]) <= 0x7fffffff)
+   && rs6000_gen_cell_microcode
+   && any_mask_operand (operands[2], <MODE>mode)"
+  "@
+   andi%e2. %0,%1,%u2
+   #"
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)"
+  [(set (match_dup 0)
+       (and:GPR (match_dup 1)
+                (match_dup 2)))
+   (set (match_dup 3)
+       (compare:CC (match_dup 0)
+                   (const_int 0)))]
+  ""
+  [(set_attr "type" "logical")
+   (set_attr "dot" "yes")
+   (set_attr "length" "4,8")])
+
+(define_insn_and_split "*and<mode>3_imm_mask_dot2"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,??y")
+       (compare:CC (and:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,r")
+                            (match_operand:GPR 2 "logical_const_operand" "n,n"))
+                   (const_int 0)))
+   (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
+       (and:GPR (match_dup 1)
+                (match_dup 2)))]
+  "(<MODE>mode == Pmode || UINTVAL (operands[2]) <= 0x7fffffff)
+   && rs6000_gen_cell_microcode
+   && any_mask_operand (operands[2], <MODE>mode)"
+  "@
+   andi%e2. %0,%1,%u2
+   #"
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)"
+  [(set (match_dup 0)
+       (and:GPR (match_dup 1)
+                (match_dup 2)))
+   (set (match_dup 3)
+       (compare:CC (match_dup 0)
+                   (const_int 0)))]
+  ""
+  [(set_attr "type" "logical")
+   (set_attr "dot" "yes")
+   (set_attr "length" "4,8")])
+
 
 (define_insn "*and<mode>3_mask"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")