re PR target/65871 (bzhi builtin/intrinsic wrongly assumes bzhi instruction doesn...
authorUros Bizjak <ubizjak@gmail.com>
Wed, 29 Apr 2015 20:58:25 +0000 (22:58 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 29 Apr 2015 20:58:25 +0000 (22:58 +0200)
PR target/65871
        * config/i386/i386.md (*bmi_bextr_<mode>_cczonly): New pattern.
        (*bmi2_bzhi_<mode>3_1_cczonly): Ditto.
        (setcc+movzbl peephole2): Check also clobbered reg.
        (setcc+andl peephole2): Ditto.

From-SVN: r222592

gcc/ChangeLog
gcc/config/i386/i386.md

index 3b363b04f72dd432f351f517f7cbe9ef8d4a41ac..3b1d2e7a6d801607965cc665ac6edd55675934e8 100644 (file)
@@ -8,6 +8,8 @@
        PR target/65871
        * config/i386/i386.md (*bmi_bextr_<mode>_cczonly): New pattern.
        (*bmi2_bzhi_<mode>3_1_cczonly): Ditto.
+       (setcc+movzbl peephole2): Check also clobbered reg.
+       (setcc+andl peephole2): Ditto.
 
 2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
 
index 060ffa8ab8483ea85d4014e8ebed43260409f3bc..5cac713e5a31ee85cbe7e9d1a07aead5e937f7af 100644 (file)
        (zero_extend (match_dup 1)))]
   "(peep2_reg_dead_p (3, operands[1])
     || operands_match_p (operands[1], operands[3]))
-   && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+   && ! reg_overlap_mentioned_p (operands[3], operands[0])
+   && ! (GET_CODE (operands[4]) == CLOBBER
+        && reg_mentioned_p (operands[3], operands[4]))"
   [(parallel [(set (match_dup 5) (match_dup 0))
              (match_dup 4)])
    (set (strict_low_part (match_dup 6))
              (clobber (reg:CC FLAGS_REG))])]
   "(peep2_reg_dead_p (3, operands[1])
     || operands_match_p (operands[1], operands[3]))
-   && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+   && ! reg_overlap_mentioned_p (operands[3], operands[0])
+   && ! (GET_CODE (operands[4]) == CLOBBER
+        && reg_mentioned_p (operands[3], operands[4]))"
   [(parallel [(set (match_dup 5) (match_dup 0))
              (match_dup 4)])
    (set (strict_low_part (match_dup 6))