[AArch64] Add a couple of SVE ACLE comparison folds

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 2 December 2019 17:39 EST

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

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.

4d5abafb741 [AArch64] Add a couple of SVE ACLE comparison folds
gcc/ChangeLog | 10 ++++++
gcc/config/aarch64/aarch64-sve-builtins-base.cc | 33 ++++++++++++++++++
gcc/config/aarch64/aarch64-sve-builtins.cc | 11 ++++++
gcc/config/aarch64/aarch64-sve-builtins.h | 1 +
gcc/testsuite/ChangeLog | 16 +++++++++
.../gcc.target/aarch64/sve/acle/asm/dup_f16.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_f32.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_f64.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_s16.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_s32.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_s64.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_s8.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_u16.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_u32.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_u64.c | 2 +-
.../gcc.target/aarch64/sve/acle/asm/dup_u8.c | 2 +-
.../aarch64/sve/acle/general/eqne_dup_1.c | 40 ++++++++++++++++++++++
17 files changed, 122 insertions(+), 11 deletions(-)

Upstream: gcc.gnu.org


  • Share