From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23590 invoked by alias); 4 May 2015 03:03:37 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 23525 invoked by uid 48); 4 May 2015 03:03:28 -0000 From: "jamrial at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65871] bzhi builtin/intrinsic wrongly assumes bzhi instruction doesn't set the ZF flag Date: Mon, 04 May 2015 03:03:00 -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: 5.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jamrial at gmail dot com X-Bugzilla-Status: NEW 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg00163.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65871 --- Comment #7 from James Almer --- Thanks for the above fix. I forgot to test BMI1's andn. That one should have an insn modeled this way as well. int foo (unsigned int x, unsigned int y) { if (~x & y) return 1; return 0; } gcc -O2 -mbmi -c andn.c 0000000000000000 : 0: c4 e2 40 f2 fe andn %esi,%edi,%edi 5: 31 c0 xor %eax,%eax 7: 85 ff test %edi,%edi 9: 0f 95 c0 setne %al c: c3 retq http://www.felixcloutier.com/x86/ANDN.html