Support *testdi_not_doubleword during STV pass on x86.
authorRoger Sayle <roger@nextmovesoftware.com>
Sat, 9 Jul 2022 08:02:14 +0000 (09:02 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Sat, 9 Jul 2022 08:04:55 +0000 (09:04 +0100)
commit002d81affa8a4e625993d3c9c7840ca4aba9750c
treeb5a49fd2bfb45375a80cd4f4eede7f0522a74576
parent84ff566c63cde517c7d963a554e338531fb059f1
Support *testdi_not_doubleword during STV pass on x86.

This patch fixes the current two FAILs of pr65105-5.c on x86 when
compiled with -m32.  These (temporary) breakages were fallout from my
patches to improve/upgrade (scalar) double word comparisons.
On mainline, the i386 backend currently represents a critical comparison
using (compare (and (not reg1) reg2) (const_int 0)) which isn't/wasn't
recognized by the STV pass' convertible_comparison_p.  This simple STV
patch adds support for this pattern (*testdi_not_doubleword) and
generates the vector pandn and ptest instructions expected in the
existing (failing) test case.

2022-07-09  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* config/i386/i386-features.cc (convert_compare): Add support
for *testdi_not_doubleword pattern, "(compare (and (not ...)))"
by generating a pandn followed by ptest.
(convertible_comparison_p): Recognize both *cmpdi_doubleword and
recent *testdi_not_doubleword comparison patterns.
gcc/config/i386/i386-features.cc