-
- Downloads
"libcpp/lex.cc" did not exist on "55dfce4d5cb4a366ced7e1194a1c7f04389e3087"
RISC-V: Support FP ceil to i/l/ll diff size autovec
This patch would like to support the FP below API auto vectorization
with different type size
+---------+-----------+----------+
| API | RV64 | RV32 |
+---------+-----------+----------+
| iceil | DF => SI | DF => SI |
| iceilf | - | - |
| lceil | - | DF => SI |
| lceilf | SF => DI | - |
| llceil | - | - |
| llceilf | SF => DI | SF => DI |
+---------+-----------+----------+
Given below code:
void
test_lceilf (long *out, float *in, unsigned count)
{
for (unsigned i = 0; i < count; i++)
out[i] = __builtin_lceilf (in[i]);
}
Before this patch:
.L3:
flw fa0,0(s0)
addi s0,s0,4
addi s1,s1,8
call ceilf
fcvt.l.s a5,fa0,rtz
sd a5,-8(s1)
bne s2,s0,.L3
ld ra,24(sp)
ld s0,16(sp)
ld s1,8(sp)
ld s2,0(sp)
addi sp,sp,32
jr ra
After this patch:
fsrmi 3 // RUP mode
.L3:
vsetvli a5,a2,e32,mf2,ta,ma
vle32.v v2,0(a1)
slli a3,a5,2
slli a4,a5,3
vfwcvt.x.f.v v1,v2
sub a2,a2,a5
vse64.v v1,0(a0)
add a1,a1,a3
add a0,a0,a4
bne a2,zero,.L3
Unfortunately, the HF mode is not include due to it requires
additional middle-end support from internal-fun.def.
gcc/ChangeLog:
* config/riscv/autovec.md: Remove the size check of lceil.l
* config/riscv/riscv-v.cc (expand_vec_lceil): Leverage
emit_vec_rounding_to_integer for ceil.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/unop/math-iceil-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-iceil-run-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lceil-rv32-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lceil-rv32-run-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lceilf-rv64-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lceilf-rv64-run-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-llceilf-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-llceilf-run-0.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-iceil-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-lceil-rv32-0.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-lceilf-rv64-0.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-llceilf-0.c: New test.
Signed-off-by:
Pan Li <pan2.li@intel.com>
Showing
- gcc/config/riscv/autovec.md 2 additions, 4 deletionsgcc/config/riscv/autovec.md
- gcc/config/riscv/riscv-v.cc 3 additions, 5 deletionsgcc/config/riscv/riscv-v.cc
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-iceil-1.c 18 additions, 0 deletions...estsuite/gcc.target/riscv/rvv/autovec/unop/math-iceil-1.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-iceil-run-1.c 83 additions, 0 deletions...uite/gcc.target/riscv/rvv/autovec/unop/math-iceil-run-1.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-lceil-rv32-0.c 18 additions, 0 deletions...ite/gcc.target/riscv/rvv/autovec/unop/math-lceil-rv32-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-lceil-rv32-run-0.c 83 additions, 0 deletions...gcc.target/riscv/rvv/autovec/unop/math-lceil-rv32-run-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-lceilf-rv64-0.c 18 additions, 0 deletions...te/gcc.target/riscv/rvv/autovec/unop/math-lceilf-rv64-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-lceilf-rv64-run-0.c 84 additions, 0 deletions...cc.target/riscv/rvv/autovec/unop/math-lceilf-rv64-run-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-llceilf-0.c 19 additions, 0 deletions...tsuite/gcc.target/riscv/rvv/autovec/unop/math-llceilf-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-llceilf-run-0.c 84 additions, 0 deletions...te/gcc.target/riscv/rvv/autovec/unop/math-llceilf-run-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/math-iceil-1.c 27 additions, 0 deletions...testsuite/gcc.target/riscv/rvv/autovec/vls/math-iceil-1.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/math-lceil-rv32-0.c 27 additions, 0 deletions...uite/gcc.target/riscv/rvv/autovec/vls/math-lceil-rv32-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/math-lceilf-rv64-0.c 27 additions, 0 deletions...ite/gcc.target/riscv/rvv/autovec/vls/math-lceilf-rv64-0.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/math-llceilf-0.c 27 additions, 0 deletions...stsuite/gcc.target/riscv/rvv/autovec/vls/math-llceilf-0.c
Loading
Please register or sign in to comment