diff options
author | Pan Li <pan2.li@intel.com> | 2023-10-12 22:07:56 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-10-13 08:06:44 +0800 |
commit | 51f7bfaac74e1311e35555c95ac056637373f112 (patch) | |
tree | 118899c01cd74671b89806ebccf10295b00568cf /libgomp/libgomp_g.h | |
parent | 611eef7609f732db65c119a7eab6d50a5fdd5985 (diff) | |
download | gcc-51f7bfaac74e1311e35555c95ac056637373f112.zip gcc-51f7bfaac74e1311e35555c95ac056637373f112.tar.gz gcc-51f7bfaac74e1311e35555c95ac056637373f112.tar.bz2 |
RISC-V: Support FP lceil/lceilf auto vectorization
This patch would like to support the FP lceil/lceilf auto vectorization.
* long lceil (double) for rv64
* long lceilf (float) for rv32
Due to the limitation that only the same size of data type are allowed
in the vectorier, the standard name lceilmn2 only act on DF => DI for
rv64, and SF => SI for rv32.
Given we have code like:
void
test_lceil (long *out, double *in, unsigned count)
{
for (unsigned i = 0; i < count; i++)
out[i] = __builtin_lceil (in[i]);
}
Before this patch:
.L3:
...
fld fa5,0(a1)
fcvt.l.d a5,fa5,rup
sd a5,-8(a0)
...
bne a1,a4,.L3
After this patch:
frrm a6
...
fsrmi 3 // RUP
.L3:
...
vsetvli a3,zero,e64,m1,ta,ma
vfcvt.x.f.v v1,v1
vsetvli zero,a2,e64,m1,ta,ma
vse32.v v1,0(a0)
...
bne a2,zero,.L3
...
fsrm a6
The rest part like SF => DI/HF => DI/DF => SI/HF => SI will be covered
by TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION.
gcc/ChangeLog:
* config/riscv/autovec.md (lceil<mode><v_i_l_ll_convert>2): New
pattern] for lceil/lceilf.
* config/riscv/riscv-protos.h (enum insn_type): New enum value.
(expand_vec_lceil): New func decl for expanding lceil.
* config/riscv/riscv-v.cc (expand_vec_lceil): New func impl
for expanding lceil.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/unop/math-lceil-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lceil-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lceil-run-0.c: New test.
* gcc.target/riscv/rvv/autovec/unop/math-lceil-run-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-lceil-0.c: New test.
* gcc.target/riscv/rvv/autovec/vls/math-lceil-1.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'libgomp/libgomp_g.h')
0 files changed, 0 insertions, 0 deletions