diff options
author | Pan Li <pan2.li@intel.com> | 2024-10-12 09:13:54 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2024-10-14 15:23:09 +0800 |
commit | 72d24d2a130a54fbe1479cb85e5639a7eab6c971 (patch) | |
tree | 0e8724fa9339bec152ba848aca8418ee7af2d295 /gcc/tree-vectorizer.h | |
parent | 566740013b3445162b8c4bc2205e4e568d014968 (diff) | |
download | gcc-72d24d2a130a54fbe1479cb85e5639a7eab6c971.zip gcc-72d24d2a130a54fbe1479cb85e5639a7eab6c971.tar.gz gcc-72d24d2a130a54fbe1479cb85e5639a7eab6c971.tar.bz2 |
RISC-V: Add testcases for form 2 of vector signed SAT_SUB
Form 2:
#define DEF_VEC_SAT_S_SUB_FMT_2(T, UT, MIN, MAX) \
void __attribute__((noinline)) \
vec_sat_s_sub_##T##_fmt_2 (T *out, T *op_1, T *op_2, unsigned limit) \
{ \
unsigned i; \
for (i = 0; i < limit; i++) \
{ \
T x = op_1[i]; \
T y = op_2[i]; \
T minus = (UT)x - (UT)y; \
out[i] = (x ^ y) >= 0 || (minus ^ x) >= 0 \
? minus : x < 0 ? MIN : MAX; \
} \
}
DEF_VEC_SAT_S_SUB_FMT_2(int8_t, uint8_t, INT8_MIN, INT8_MAX)
The below test are passed for this patch.
* The rv64gcv fully regression test.
It is test only patch and obvious up to a point, will commit it
directly if no comments in next 48H.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/vec_sat_arith.h: Add test helper macros.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-2-i16.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-2-i32.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-2-i64.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-2-i8.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-run-2-i16.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-run-2-i32.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-run-2-i64.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_sub-run-2-i8.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions