From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44006 invoked by alias); 21 Jun 2015 09:57:58 -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 43955 invoked by uid 48); 21 Jun 2015 09:57:54 -0000 From: "ubizjak 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: Sun, 21 Jun 2015 09:57: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: ubizjak 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg01845.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65871 --- Comment #10 from Uro=C5=A1 Bizjak --- (In reply to James Almer from comment #9) > Created attachment 35804 [details] > Preprocessed code where a test instruction is still generated >=20 > Please look at the attachment. >=20 > [jamrial@archVM ~]$ gcc -std=3Dc99 -march=3Dhaswell -O3 -c hevc_ps.i >=20 > [jamrial@archVM ~]$ objdump --disassemble hevc_ps.o | grep -B2 -A2 bzhi > 5854: c4 62 22 f7 d6 sarx %r11d,%esi,%r10d > 5859: c4 62 22 f7 da sarx %r11d,%edx,%r11d > 585e: c4 e2 70 f5 f6 bzhi %ecx,%esi,%esi > 5863: 45 89 9e 68 33 00 00 mov %r11d,0x3368(%r14) > 586a: 41 89 c3 mov %eax,%r11d > -- > 589d: 85 f6 test %esi,%esi > 589f: 75 0d jne 58ae > > 58a1: c4 e2 70 f5 d2 bzhi %ecx,%edx,%edx > 58a6: 85 d2 test %edx,%edx > 58a8: 0f 84 5a 03 00 00 je 5c08 > [...] > Not sure why the new model is not working here. Because of the cost model. Combine pass says: Trying 2631 -> 2633: Successfully matched this instruction: (set (reg:CCZ 17 flags) (compare:CCZ (zero_extract:SI (reg:SI 2360 [ D.14992 ]) (umin:SI (zero_extend:SI (subreg:QI (reg:SI 301 [ D.14999 ]) 0)) (const_int 32 [0x20])) (const_int 0 [0])) (const_int 0 [0]))) rejecting combination of insns 2631 and 2633 original costs 12 + 4 =3D 16 replacement cost 18 >>From gcc-bugs-return-489514-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jun 21 11:09:32 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 5819 invoked by alias); 21 Jun 2015 11:09:32 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 5784 invoked by uid 48); 21 Jun 2015 11:09:26 -0000 From: "ubizjak 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: Sun, 21 Jun 2015 11:09: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: ubizjak 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg01846.txt.bz2 Content-length: 980 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65871 --- Comment #11 from Uro=C5=A1 Bizjak --- (In reply to Uro=C5=A1 Bizjak from comment #10) > Because of the cost model. Combine pass says: Testing the patch: --cut here-- Index: i386.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- i386.c (revision 224630) +++ i386.c (working copy) @@ -42533,6 +42533,12 @@ ix86_rtx_costs (rtx x, int code_i, int outer_code_ + rtx_cost (const1_rtx, outer_code, opno, speed)); return true; } + + /* The embedded comparison operand is completely free. */ + if (!general_operand (XEXP (x, 0), GET_MODE (XEXP (x, 0))) + && XEXP (x, 1) =3D=3D const0_rtx) + *total =3D 0; + return false; case FLOAT_EXTEND: --cut here-- >>From gcc-bugs-return-489515-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jun 21 11:37:50 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 94835 invoked by alias); 21 Jun 2015 11:37:49 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 94813 invoked by uid 48); 21 Jun 2015 11:37:44 -0000 From: "michael.lehn@uni-ulm.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/66613] error in evaluationg cexp Date: Sun, 21 Jun 2015 11:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: michael.lehn@uni-ulm.de 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: cc 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-06/txt/msg01847.txt.bz2 Content-length: 429 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66613 Michael Lehn changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.lehn@uni-ulm.de --- Comment #1 from Michael Lehn --- > //> Terminated with exit code 0. So were is the error?