Hello! 2013-04-02 Uros Bizjak <ubiz...@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.
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