diff options
author | Pan Li <pan2.li@intel.com> | 2023-11-07 22:24:41 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-11-08 07:50:27 +0800 |
commit | 63dc25eda71c72586b81cb1cb22e1971ba09a3d1 (patch) | |
tree | bf69391e294e2c6cc2d4b68e11080fe0d259a1aa /gcc/file-find.h | |
parent | f5ddc3677389cbb2071d86c31edc87a3dc482f68 (diff) | |
download | gcc-63dc25eda71c72586b81cb1cb22e1971ba09a3d1.zip gcc-63dc25eda71c72586b81cb1cb22e1971ba09a3d1.tar.gz gcc-63dc25eda71c72586b81cb1cb22e1971ba09a3d1.tar.bz2 |
RISC-V: Support FP floor 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 |
+----------+-----------+----------+
| ifloor | DF => SI | DF => SI |
| ifloorf | - | - |
| lfloor | - | DF => SI |
| lfloorf | SF => DI | - |
| llfloor | - | - |
| llfloorf | SF => DI | SF => DI |
+----------+-----------+----------+
Given below code:
void
test_lfloorf (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 floorf
fcvt.l.s a5,fa0,rtz
sd a5,-8(s1)
bne s2,s0,.L3
After this patch:
fsrmi 2 // RDN 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 lfloor.
* config/riscv/riscv-v.cc (expand_vec_lfloor): Leverage
emit_vec_rounding_to_integer for floor.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/unop/math-ifloor-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-ifloor-run-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lfloor-rv32-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lfloor-rv32-run-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lfloorf-rv64-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lfloorf-rv64-run-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-llfloorf-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-llfloorf-run-0.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-ifloor-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-lfloor-rv32-0.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-lfloorf-rv64-0.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-llfloorf-0.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'gcc/file-find.h')
0 files changed, 0 insertions, 0 deletions