From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4D7653858C53; Wed, 18 May 2022 02:58:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D7653858C53 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104375] [x86] Failure to recognize bzhi pattern when shr is present Date: Wed, 18 May 2022 02:58:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 02:58:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104375 --- Comment #2 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:102237c9f2f2667eb73cb5473bd3a9a97296a414 commit r13-581-g102237c9f2f2667eb73cb5473bd3a9a97296a414 Author: liuhongt Date: Thu Apr 28 15:30:06 2022 +0800 recognize bzhi pattern when there's zero_extendsidi. backend has 16550(define_insn "*bmi2_bzhi_3_2" 16551 [(set (match_operand:SWI48 0 "register_operand" "=3Dr") 16552 (and:SWI48 16553 (plus:SWI48 16554 (ashift:SWI48 (const_int 1) 16555 (match_operand:QI 2 "register_operand" "= r")) 16556 (const_int -1)) 16557 (match_operand:SWI48 1 "nonimmediate_operand" "rm"))) 16558 (clobber (reg:CC FLAGS_REG))] 16559 "TARGET_BMI2" 16560 "bzhi\t{%2, %1, %0|%0, %1, %2}" 16561 [(set_attr "type" "bitmanip") 16562 (set_attr "prefix" "vex") 16563 (set_attr "mode" "")]) But there's extra zero_extend in pattern match. 424Failed to match this instruction: 425(parallel [ 426 (set (reg:DI 90) 427 (zero_extend:DI (and:SI (plus:SI (ashift:SI (const_int 1 [0x1]) 428 (subreg:QI (reg:SI 98) 0)) 429 (const_int -1 [0xffffffffffffffff])) 430 (subreg:SI (reg:DI 95) 0)))) 431 (clobber (reg:CC 17 flags)) 432 ]) Add new define_insn for it. gcc/ChangeLog: PR target/104375 * config/i386/i386.md (*bmi2_bzhi_zero_extendsidi_4): New define_insn. gcc/testsuite/ChangeLog: * gcc.target/i386/pr104375.c: New test.=