From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29252 invoked by alias); 18 Jun 2015 23:20:12 -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 29222 invoked by uid 48); 18 Jun 2015 23:20:08 -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: Thu, 18 Jun 2015 23:20: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: attachments.created 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/msg01685.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65871 --- Comment #9 from James Almer --- Created attachment 35804 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35804&action=edit Preprocessed code where a test instruction is still generated Please look at the attachment. [jamrial@archVM ~]$ gcc -std=c99 -march=haswell -O3 -c hevc_ps.i [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 [jamrial@archVM ~]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/jamrial/gcc-svn/configure --prefix=/usr/local --libdir=/usr/local/lib --libexecdir=/usr/local/lib --mandir=/usr/local/share/man --infodir=/usr/local/share/info --enable-languages=c,c++,lto --enable-shared --disable-bootstrap --enable-threads=posix --enable-libmpx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror Thread model: posix gcc version 6.0.0 20150618 (experimental) (GCC) Not sure why the new model is not working here.