-
- Downloads
SVE intrinsics: Add strength reduction for division by constant.
This patch folds SVE division where all divisor elements are the same
power of 2 to svasrd (signed) or svlsr (unsigned).
Tests were added to check
1) whether the transform is applied (existing test harness was amended), and
2) correctness using runtime tests for all input types of svdiv; for signed
and unsigned integers, several corner cases were covered.
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-base.cc (svdiv_impl::fold):
Implement strength reduction.
gcc/testsuite/
* gcc.target/aarch64/sve/div_const_run.c: New test.
* gcc.target/aarch64/sve/acle/asm/div_s32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/div_s64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/div_u32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/div_u64.c: Likewise.
Showing
- gcc/config/aarch64/aarch64-sve-builtins-base.cc 48 additions, 1 deletiongcc/config/aarch64/aarch64-sve-builtins-base.cc
- gcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_s32.c 259 additions, 14 deletionsgcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_s32.c
- gcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_s64.c 259 additions, 14 deletionsgcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_s64.c
- gcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_u32.c 187 additions, 14 deletionsgcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_u32.c
- gcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_u64.c 187 additions, 14 deletionsgcc/testsuite/gcc.target/aarch64/sve/acle/asm/div_u64.c
- gcc/testsuite/gcc.target/aarch64/sve/div_const_run.c 91 additions, 0 deletionsgcc/testsuite/gcc.target/aarch64/sve/div_const_run.c
Loading
Please register or sign in to comment