On Mon, May 29, 2023 at 07:17:42PM +0100, Roger Sayle wrote: > The only change that was unanticipated was the tweak to ix86_match_ccmode. > Oddly, CCZmode is allowable for CCmode, but CCCmode isn't. Given that
So another option would be to use CCZmode for the ptestz cases and keep CCmode for ptestc, I think we don't have any modes which cover C and Z flags but nothing else, and for the optimization we only need to find out if it is CCZmode. Though, I'm certainly not familiar with the CC mode details in the backend, so certainly need to defer this to Uros. > CCZmode means just the Z flag, CCCmode means just the C flag, and > CCmode means all the flags, I'm guessing this asymmetry is unintentional. > Perhaps a super-safe fix is to explicitly test for CCZmode, CCCmode or > CCmode > in the *<sse4_1>_ptest<mode> pattern's predicate, and not attempt to > re-use ix86_match_ccmode? > > This patch 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 mainline? Jakub