On Wed, Jul 19, 2023 at 2:21 PM Richard Biener <richard.guent...@gmail.com> wrote: > > On Sun, Jun 11, 2023 at 12:55 AM Roger Sayle <ro...@nextmovesoftware.com> > wrote: > > > > > > This is a backport of the fixes for PR target/109973 and PR target/110083. > > > > This backport to the releases/gcc-13 branch has been tested on > > x86_64-pc-linux-gnu with make bootstrap and make -k check, both with and > > without --target_board=unix{-m32} with no new failures. Ok for gcc-13, > > or should we just close PR 109973 in Bugzilla? > > As alternative solution for the GCC 13 branch I have tested reverting > r13-2006-ga56c1641e9d25e successfully. Can we choose between the > options please? Sorry I'm only bringing this up now but 13.2 RC is due > tomorrow. > > Thank you, > Richard. > > > > > > > 2023-06-10 Roger Sayle <ro...@nextmovesoftware.com> > > Uros Bizjak <ubiz...@gmail.com> > > > > gcc/ChangeLog > > PR target/109973 > > PR target/110083 > > * config/i386/i386-builtin.def (__builtin_ia32_ptestz128): Use new > > CODE_for_sse4_1_ptestzv2di. > > (__builtin_ia32_ptestc128): Use new CODE_for_sse4_1_ptestcv2di. > > (__builtin_ia32_ptestz256): Use new CODE_for_avx_ptestzv4di. > > (__builtin_ia32_ptestc256): Use new CODE_for_avx_ptestcv4di. > > * config/i386/i386-expand.cc (ix86_expand_branch): Use CCZmode > > when expanding UNSPEC_PTEST to compare against zero. > > * config/i386/i386-features.cc (scalar_chain::convert_compare): > > Likewise generate CCZmode UNSPEC_PTESTs when converting comparisons. > > Update or delete REG_EQUAL notes, converting CONST_INT and > > CONST_WIDE_INT immediate operands to a suitable CONST_VECTOR. > > (general_scalar_chain::convert_insn): Use CCZmode for COMPARE > > result. > > (timode_scalar_chain::convert_insn): Use CCZmode for COMPARE result. > > * config/i386/i386-protos.h (ix86_match_ptest_ccmode): Prototype. > > * config/i386/i386.cc (ix86_match_ptest_ccmode): New predicate to > > check for suitable matching modes for the UNSPEC_PTEST pattern. > > * config/i386/sse.md (define_split): When splitting UNSPEC_MOVMSK > > to UNSPEC_PTEST, preserve the FLAG_REG mode as CCZ. > > (*<sse4_1>_ptest<mode>): Add asterisk to hide define_insn. Remove > > ":CC" mode of FLAGS_REG, instead use ix86_match_ptest_ccmode. > > (<sse4_1>_ptestz<mode>): New define_expand to specify CCZ. > > (<sse4_1>_ptestc<mode>): New define_expand to specify CCC. > > (<sse4_1>_ptest<mode>): A define_expand using CC to preserve the > > current behavior. > > (*ptest<mode>_and): Specify CCZ to only perform this optimization > > when only the Z flag is required. > > > > gcc/testsuite/ChangeLog > > PR target/109973 > > PR target/110083 > > * gcc.target/i386/pr109973-1.c: New test case. > > * gcc.target/i386/pr109973-2.c: Likewise. > > * gcc.target/i386/pr110083.c: Likewise.
Yes, I would rather have the offending patch reverted on gcc-13. Uros.