]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Emit csinv again for `a ? ~b : b` [PR110986]
authorAndrew Pinski <pinskia@gmail.com>
Wed, 18 Oct 2023 23:39:12 +0000 (16:39 -0700)
committerAndrew Pinski <pinskia@gmail.com>
Sun, 22 Oct 2023 22:32:44 +0000 (15:32 -0700)
commitbcc5054b36626459ddb04c779f0b201fba6001d1
treedbe68a49c41f5f74bb4240359c3ff8b852f5a7fc
parentc9ae68f97e0c6a8fda3ff2063c907c12553dac84
aarch64: Emit csinv again for `a ? ~b : b` [PR110986]

After r14-3110-g7fb65f10285, the canonical form for
`a ? ~b : b` changed to be `-(a) ^ b` that means
for aarch64 we need to add a few new insn patterns
to be able to catch this and change it to be
what is the canonical form for the aarch64 backend.
A secondary pattern was needed to support a zero_extended
form too; this adds a testcase for all 3 cases.

Bootstrapped and tested on aarch64-linux-gnu with no regressions.

PR target/110986

gcc/ChangeLog:

* config/aarch64/aarch64.md (*cmov<mode>_insn_insv): New pattern.
(*cmov_uxtw_insn_insv): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/cond_op-1.c: New test.
gcc/config/aarch64/aarch64.md
gcc/testsuite/gcc.target/aarch64/cond_op-1.c [new file with mode: 0644]