[AArch64] Add a couple of SVE ACLE comparison folds
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 2 Dec 2019 17:39:06 +0000 (17:39 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 2 Dec 2019 17:39:06 +0000 (17:39 +0000)
commit0435b10db008e3019be0898270070eec4f3e318a
tree96d50c1a58cb3a70e9d378758c766f97cb39ce6d
parentd6098f64819e729026df0ebf0e18ac5de713e36e
[AArch64] Add a couple of SVE ACLE comparison folds

When writing vector-length specific SVE code, it's useful to be able
to store an svbool_t predicate in a GNU vector of unsigned chars.
This patch makes sure that there is no overhead when converting
to that form and then immediately reading it back again.

2019-12-02  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/aarch64-sve-builtins.h
(gimple_folder::force_vector): Declare.
* config/aarch64/aarch64-sve-builtins.cc
(gimple_folder::force_vector): New function.
* config/aarch64/aarch64-sve-builtins-base.cc
(svcmp_impl::fold): Likewise.
(svdup_impl::fold): Handle svdup_z too.

gcc/testsuite/
* gcc.target/aarch64/sve/acle/general/eqne_dup_1.c: New test.
* gcc.target/aarch64/sve/acle/asm/dup_f16.c (dup_0_f16_z): Expect
the call to be folded to zero.
* gcc.target/aarch64/sve/acle/asm/dup_f32.c (dup_0_f32_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_f64.c (dup_0_f64_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_s8.c (dup_0_s8_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_s16.c (dup_0_s16_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_s32.c (dup_0_s32_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_s64.c (dup_0_s64_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_u8.c (dup_0_u8_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_u16.c (dup_0_u16_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_u32.c (dup_0_u32_z): Likewise.
* gcc.target/aarch64/sve/acle/asm/dup_u64.c (dup_0_u64_z): Likewise.

From-SVN: r278907
17 files changed:
gcc/ChangeLog
gcc/config/aarch64/aarch64-sve-builtins-base.cc
gcc/config/aarch64/aarch64-sve-builtins.cc
gcc/config/aarch64/aarch64-sve-builtins.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_f16.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_f32.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_f64.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_s16.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_s32.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_s64.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_s8.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_u16.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_u32.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_u64.c
gcc/testsuite/gcc.target/aarch64/sve/acle/asm/dup_u8.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general/eqne_dup_1.c [new file with mode: 0644]