[sve] PR93183 - Add support for conditional neg.
commit20dcda98ed376cb61c74b2c71656f99c671ec9ce
authorprathamesh.kulkarni <prathamesh.kulkarni@linaro.org>
Mon, 18 Oct 2021 10:14:06 +0000 (18 15:44 +0530)
committerprathamesh.kulkarni <prathamesh.kulkarni@linaro.org>
Mon, 18 Oct 2021 10:14:06 +0000 (18 15:44 +0530)
tree7efcc5eb630088ec552f3e562ce4ee8ab625dca7
parent85ce673378e7091ce603b033fac213a9d0d1f83a
[sve] PR93183 - Add support for conditional neg.

gcc/ChangeLog:
PR target/93183
* gimple-match-head.c (try_conditional_simplification): Add case for single operand.
* internal-fn.def: Add entry for COND_NEG internal function.
* internal-fn.c (FOR_EACH_CODE_MAPPING): Add entry for
NEGATE_EXPR, COND_NEG mapping.
* optabs.def: Add entry for cond_neg_optab.
* match.pd (UNCOND_UNARY, COND_UNARY): New operator lists.
(vec_cond COND (foo A) B) -> (IFN_COND_FOO COND A B): New pattern.
(vec_cond COND B (foo A)) -> (IFN_COND_FOO ~COND A B): Likewise.

gcc/testsuite/ChangeLog:
PR target/93183
* gcc.target/aarch64/sve/cond_unary_4.c: Adjust.
* gcc.target/aarch64/sve/pr93183.c: New test.
gcc/gimple-match-head.c
gcc/internal-fn.c
gcc/internal-fn.def
gcc/match.pd
gcc/optabs.def
gcc/testsuite/gcc.target/aarch64/sve/cond_unary_4.c
gcc/testsuite/gcc.target/aarch64/sve/pr93183.c [new file with mode: 0644]