aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorPan Li <pan2.li@intel.com>2023-11-07 11:19:56 +0800
committerPan Li <pan2.li@intel.com>2023-11-07 14:45:54 +0800
commitfd56a9cc5e37bb51c725a83aa44de34b9c238e78 (patch)
tree82641f0ed19c28debd851121c0f15c8ac8028a47 /libcpp
parentb7d05f13e86bf49bfb78c9876deba388efc6082e (diff)
downloadgcc-fd56a9cc5e37bb51c725a83aa44de34b9c238e78.zip
gcc-fd56a9cc5e37bb51c725a83aa44de34b9c238e78.tar.gz
gcc-fd56a9cc5e37bb51c725a83aa44de34b9c238e78.tar.bz2
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>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions