diff mbox

[i386] : Merge *testqi_ext_3_rex64 and *testqi_ext_3

Message ID CAFULd4Y_V0iBO-yizTfrf+k5gzbZNsj-4V+47gL8csos+m14wQ@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak April 2, 2013, 5:20 p.m. UTC
Hello!

2013-04-02  Uros Bizjak  <ubizjak@gmail.com>

    * config/i386/i386.md (*testqi_ext_3): Merge with *testqi_ext_3_rex64
    using SWI48 mode attribute.

Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN.

Uros.
diff mbox

Patch

Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md	(revision 197339)
+++ config/i386/i386.md	(working copy)
@@ -7134,43 +7134,26 @@ 
   [(set_attr "type" "test")
    (set_attr "mode" "QI")])
 
-(define_insn "*testqi_ext_3_rex64"
-  [(set (reg FLAGS_REG)
-        (compare (zero_extract:DI
-		   (match_operand 0 "nonimmediate_operand" "rm")
-		   (match_operand:DI 1 "const_int_operand")
-		   (match_operand:DI 2 "const_int_operand"))
-		 (const_int 0)))]
-  "TARGET_64BIT
-   && ix86_match_ccmode (insn, CCNOmode)
-   && INTVAL (operands[1]) > 0
-   && INTVAL (operands[2]) >= 0
-   /* Ensure that resulting mask is zero or sign extended operand.  */
-   && (INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
-       || (INTVAL (operands[1]) + INTVAL (operands[2]) == 64
-	   && INTVAL (operands[1]) > 32))
-   && (GET_MODE (operands[0]) == SImode
-       || GET_MODE (operands[0]) == DImode
-       || GET_MODE (operands[0]) == HImode
-       || GET_MODE (operands[0]) == QImode)"
-  "#")
-
 ;; Combine likes to form bit extractions for some tests.  Humor it.
 (define_insn "*testqi_ext_3"
   [(set (reg FLAGS_REG)
-        (compare (zero_extract:SI
+	(compare (zero_extract:SWI48
 		   (match_operand 0 "nonimmediate_operand" "rm")
-		   (match_operand:SI 1 "const_int_operand")
-		   (match_operand:SI 2 "const_int_operand"))
+		   (match_operand:SWI48 1 "const_int_operand")
+		   (match_operand:SWI48 2 "const_int_operand"))
 		 (const_int 0)))]
   "ix86_match_ccmode (insn, CCNOmode)
-   && INTVAL (operands[1]) > 0
-   && INTVAL (operands[2]) >= 0
-   && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
-   && (GET_MODE (operands[0]) == SImode
-       || (TARGET_64BIT && GET_MODE (operands[0]) == DImode)
+   && ((TARGET_64BIT && GET_MODE (operands[0]) == DImode)
+       || GET_MODE (operands[0]) == SImode
        || GET_MODE (operands[0]) == HImode
-       || GET_MODE (operands[0]) == QImode)"
+       || GET_MODE (operands[0]) == QImode)
+   /* Ensure that resulting mask is zero or sign extended operand.  */
+   && INTVAL (operands[2]) >= 0
+   && ((INTVAL (operands[1]) > 0
+	&& INTVAL (operands[1]) + INTVAL (operands[2]) <= 32)
+       || (<MODE>mode == DImode
+	   && INTVAL (operands[1]) > 32
+	   && INTVAL (operands[1]) + INTVAL (operands[2]) == 64))"
   "#")
 
 (define_split