-
- Downloads
SVE intrinsics: Fold svsra with op1 all zeros to svlsr/svasr.
A common idiom in intrinsics loops is to have accumulator intrinsics
in an unrolled loop with an accumulator initialized to zero at the beginning.
Propagating the initial zero accumulator into the first iteration
of the loop and simplifying the first accumulate instruction is a
desirable transformation that we should teach GCC.
Therefore, this patch folds svsra to svlsr/svasr if op1 is all zeros,
producing the lower latency instructions LSR/ASR instead of USRA/SSRA.
We implemented this optimization in svsra_impl::fold.
Tests were added to check the produced assembly for use of LSR/ASR.
The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression.
OK for mainline?
Signed-off-by:
Jennifer Schmitz <jschmitz@nvidia.com>
gcc/
* config/aarch64/aarch64-sve-builtins-sve2.cc
(svsra_impl::fold): Fold svsra to svlsr/svasr if op1 is all zeros.
gcc/testsuite/
* gcc.target/aarch64/sve2/acle/asm/sra_s32.c: New test.
* gcc.target/aarch64/sve2/acle/asm/sra_s64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/sra_u32.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/sra_u64.c: Likewise.
Showing
- gcc/config/aarch64/aarch64-sve-builtins-sve2.cc 28 additions, 0 deletionsgcc/config/aarch64/aarch64-sve-builtins-sve2.cc
- gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_s32.c 9 additions, 0 deletionsgcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_s32.c
- gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_s64.c 9 additions, 0 deletionsgcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_s64.c
- gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_u32.c 9 additions, 0 deletionsgcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_u32.c
- gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_u64.c 9 additions, 0 deletionsgcc/testsuite/gcc.target/aarch64/sve2/acle/asm/sra_u64.c
Loading
Please register or sign in to comment