From: Pan Li <pan2...@intel.com> This patch would like to fix one incorrect test macro usage for form 2 of signed scalar SAT_ADD run test. It should leverage the _FMT_2 instead of _FMT_1 for form 2.
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/sat_arith.h: Add test helper macro. * gcc.target/riscv/sat_s_add-run-5.c: Take form 2 for run test. * gcc.target/riscv/sat_s_add-run-6.c: Ditto. * gcc.target/riscv/sat_s_add-run-7.c: Ditto. * gcc.target/riscv/sat_s_add-run-8.c: Ditto. Signed-off-by: Pan Li <pan2...@intel.com> --- gcc/testsuite/gcc.target/riscv/sat_arith.h | 2 ++ gcc/testsuite/gcc.target/riscv/sat_s_add-run-5.c | 4 ++-- gcc/testsuite/gcc.target/riscv/sat_s_add-run-6.c | 4 ++-- gcc/testsuite/gcc.target/riscv/sat_s_add-run-7.c | 4 ++-- gcc/testsuite/gcc.target/riscv/sat_s_add-run-8.c | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/sat_arith.h b/gcc/testsuite/gcc.target/riscv/sat_arith.h index a2617b6db70..77b5ef1807b 100644 --- a/gcc/testsuite/gcc.target/riscv/sat_arith.h +++ b/gcc/testsuite/gcc.target/riscv/sat_arith.h @@ -141,6 +141,8 @@ sat_s_add_##T##_fmt_2 (T x, T y) \ return sum; \ return x < 0 ? MIN : MAX; \ } +#define DEF_SAT_S_ADD_FMT_2_WRAP(T, UT, MIN, MAX) \ + DEF_SAT_S_ADD_FMT_2(T, UT, MIN, MAX) #define DEF_SAT_S_ADD_FMT_3(T, UT, MIN, MAX) \ T __attribute__((noinline)) \ diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-5.c b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-5.c index 9a4ce338d0c..d57e0a0d195 100644 --- a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-5.c +++ b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-5.c @@ -7,10 +7,10 @@ #define T1 int8_t #define T2 uint8_t -DEF_SAT_S_ADD_FMT_1_WRAP(T1, T2, INT8_MIN, INT8_MAX) +DEF_SAT_S_ADD_FMT_2_WRAP(T1, T2, INT8_MIN, INT8_MAX) #define DATA TEST_BINARY_DATA_WRAP(T1, ssadd) #define T TEST_BINARY_STRUCT_DECL(T1, ssadd) -#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_1_WRAP(T1, x, y) +#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_2_WRAP(T1, x, y) #include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-6.c b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-6.c index 34459b85e2b..cdac5bdb883 100644 --- a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-6.c +++ b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-6.c @@ -7,10 +7,10 @@ #define T1 int16_t #define T2 uint16_t -DEF_SAT_S_ADD_FMT_1_WRAP(T1, T2, INT16_MIN, INT16_MAX) +DEF_SAT_S_ADD_FMT_2_WRAP(T1, T2, INT16_MIN, INT16_MAX) #define DATA TEST_BINARY_DATA_WRAP(T1, ssadd) #define T TEST_BINARY_STRUCT_DECL(T1, ssadd) -#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_1_WRAP(T1, x, y) +#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_2_WRAP(T1, x, y) #include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-7.c b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-7.c index 4d4841f4066..4ac952e27fa 100644 --- a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-7.c +++ b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-7.c @@ -7,10 +7,10 @@ #define T1 int32_t #define T2 uint32_t -DEF_SAT_S_ADD_FMT_1_WRAP(T1, T2, INT32_MIN, INT32_MAX) +DEF_SAT_S_ADD_FMT_2_WRAP(T1, T2, INT32_MIN, INT32_MAX) #define DATA TEST_BINARY_DATA_WRAP(T1, ssadd) #define T TEST_BINARY_STRUCT_DECL(T1, ssadd) -#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_1_WRAP(T1, x, y) +#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_2_WRAP(T1, x, y) #include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-8.c b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-8.c index df818879628..4d25e7f171d 100644 --- a/gcc/testsuite/gcc.target/riscv/sat_s_add-run-8.c +++ b/gcc/testsuite/gcc.target/riscv/sat_s_add-run-8.c @@ -7,10 +7,10 @@ #define T1 int64_t #define T2 uint64_t -DEF_SAT_S_ADD_FMT_1_WRAP(T1, T2, INT64_MIN, INT64_MAX) +DEF_SAT_S_ADD_FMT_2_WRAP(T1, T2, INT64_MIN, INT64_MAX) #define DATA TEST_BINARY_DATA_WRAP(T1, ssadd) #define T TEST_BINARY_STRUCT_DECL(T1, ssadd) -#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_1_WRAP(T1, x, y) +#define RUN_BINARY(x, y) RUN_SAT_S_ADD_FMT_2_WRAP(T1, x, y) #include "scalar_sat_binary_run_xxx.h" -- 2.43.0