Add support for vector conitional not
commita32de58c9e6394e4e6aef0ac95b52d1c774ac8bc
authorAndrew Pinski <apinski@marvell.com>
Sat, 12 Aug 2023 01:19:01 +0000 (11 18:19 -0700)
committerAndrew Pinski <apinski@marvell.com>
Thu, 17 Aug 2023 01:35:58 +0000 (16 18:35 -0700)
treec83cdfffa1faebb21d0cdfa669b0da4ecb61b923
parent8e71ad9e782195d1285b85b2eb8f127572d5be2d
Add support for vector conitional not

Like the support conditional neg (r12-4470-g20dcda98ed376cb61c74b2c71),
this just adds conditional not too.
Also we should be able to turn `(a ? -1 : 0) ^ b` into a conditional
not.

OK? Bootstrapped and tested on x86_64-linux-gnu and aarch64-linux-gnu.

gcc/ChangeLog:

* internal-fn.def (COND_NOT): New internal function.
* match.pd (UNCOND_UNARY, COND_UNARY): Add bit_not/not
to the lists.
(`vec (a ? -1 : 0) ^ b`): New pattern to convert
into conditional not.
* optabs.def (cond_one_cmpl): New optab.
(cond_len_one_cmpl): Likewise.

gcc/testsuite/ChangeLog:

PR target/110986
* gcc.target/aarch64/sve/cond_unary_9.c: New test.
gcc/internal-fn.def
gcc/match.pd
gcc/optabs.def
gcc/testsuite/gcc.target/aarch64/sve/cond_unary_9.c [new file with mode: 0644]