https://gcc.gnu.org/g:f16d3f5e6926600008903b7e2e66a3046e043fb7
commit f16d3f5e6926600008903b7e2e66a3046e043fb7 Author: Pan Li <pan2...@intel.com> Date: Wed Oct 9 22:37:00 2024 +0800 RISC-V: Add testcases for form 3 of scalar signed SAT_TRUNC Form 3: #define DEF_SAT_S_TRUNC_FMT_3(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_3 (WT x) \ { \ NT trunc = (NT)x; \ return (WT)NT_MIN < x && x <= (WT)NT_MAX \ ? trunc \ : x < 0 ? NT_MIN : NT_MAX; \ } gcc/testsuite/ChangeLog: * gcc.target/riscv/sat_arith.h: Add test helper macros. * gcc.target/riscv/sat_s_trunc-3-i16-to-i8.c: New test. * gcc.target/riscv/sat_s_trunc-3-i32-to-i16.c: New test. * gcc.target/riscv/sat_s_trunc-3-i32-to-i8.c: New test. * gcc.target/riscv/sat_s_trunc-3-i64-to-i16.c: New test. * gcc.target/riscv/sat_s_trunc-3-i64-to-i32.c: New test. * gcc.target/riscv/sat_s_trunc-3-i64-to-i8.c: New test. * gcc.target/riscv/sat_s_trunc-run-3-i16-to-i8.c: New test. * gcc.target/riscv/sat_s_trunc-run-3-i32-to-i16.c: New test. * gcc.target/riscv/sat_s_trunc-run-3-i32-to-i8.c: New test. * gcc.target/riscv/sat_s_trunc-run-3-i64-to-i16.c: New test. * gcc.target/riscv/sat_s_trunc-run-3-i64-to-i32.c: New test. * gcc.target/riscv/sat_s_trunc-run-3-i64-to-i8.c: New test. Signed-off-by: Pan Li <pan2...@intel.com> (cherry picked from commit 77fceccf8bd05ebf0cf95fea3b34126431827a5d) Diff: --- gcc/testsuite/gcc.target/riscv/sat_arith.h | 15 ++++++++++++ .../gcc.target/riscv/sat_s_trunc-3-i16-to-i8.c | 26 ++++++++++++++++++++ .../gcc.target/riscv/sat_s_trunc-3-i32-to-i16.c | 28 ++++++++++++++++++++++ .../gcc.target/riscv/sat_s_trunc-3-i32-to-i8.c | 26 ++++++++++++++++++++ .../gcc.target/riscv/sat_s_trunc-3-i64-to-i16.c | 28 ++++++++++++++++++++++ .../gcc.target/riscv/sat_s_trunc-3-i64-to-i32.c | 26 ++++++++++++++++++++ .../gcc.target/riscv/sat_s_trunc-3-i64-to-i8.c | 26 ++++++++++++++++++++ .../gcc.target/riscv/sat_s_trunc-run-3-i16-to-i8.c | 16 +++++++++++++ .../riscv/sat_s_trunc-run-3-i32-to-i16.c | 16 +++++++++++++ .../gcc.target/riscv/sat_s_trunc-run-3-i32-to-i8.c | 16 +++++++++++++ .../riscv/sat_s_trunc-run-3-i64-to-i16.c | 16 +++++++++++++ .../riscv/sat_s_trunc-run-3-i64-to-i32.c | 16 +++++++++++++ .../gcc.target/riscv/sat_s_trunc-run-3-i64-to-i8.c | 16 +++++++++++++ 13 files changed, 271 insertions(+) diff --git a/gcc/testsuite/gcc.target/riscv/sat_arith.h b/gcc/testsuite/gcc.target/riscv/sat_arith.h index f88432a38173..607bc4fc82e6 100644 --- a/gcc/testsuite/gcc.target/riscv/sat_arith.h +++ b/gcc/testsuite/gcc.target/riscv/sat_arith.h @@ -489,10 +489,25 @@ sat_s_trunc_##WT##_to_##NT##_fmt_2 (WT x) \ #define DEF_SAT_S_TRUNC_FMT_2_WRAP(NT, WT, NT_MIN, NT_MAX) \ DEF_SAT_S_TRUNC_FMT_2(NT, WT, NT_MIN, NT_MAX) +#define DEF_SAT_S_TRUNC_FMT_3(NT, WT, NT_MIN, NT_MAX) \ +NT __attribute__((noinline)) \ +sat_s_trunc_##WT##_to_##NT##_fmt_3 (WT x) \ +{ \ + NT trunc = (NT)x; \ + return (WT)NT_MIN < x && x <= (WT)NT_MAX \ + ? trunc \ + : x < 0 ? NT_MIN : NT_MAX; \ +} +#define DEF_SAT_S_TRUNC_FMT_3_WRAP(NT, WT, NT_MIN, NT_MAX) \ + DEF_SAT_S_TRUNC_FMT_3(NT, WT, NT_MIN, NT_MAX) + #define RUN_SAT_S_TRUNC_FMT_1(NT, WT, x) sat_s_trunc_##WT##_to_##NT##_fmt_1 (x) #define RUN_SAT_S_TRUNC_FMT_1_WRAP(NT, WT, x) RUN_SAT_S_TRUNC_FMT_1(NT, WT, x) #define RUN_SAT_S_TRUNC_FMT_2(NT, WT, x) sat_s_trunc_##WT##_to_##NT##_fmt_2 (x) #define RUN_SAT_S_TRUNC_FMT_2_WRAP(NT, WT, x) RUN_SAT_S_TRUNC_FMT_2(NT, WT, x) +#define RUN_SAT_S_TRUNC_FMT_3(NT, WT, x) sat_s_trunc_##WT##_to_##NT##_fmt_3 (x) +#define RUN_SAT_S_TRUNC_FMT_3_WRAP(NT, WT, x) RUN_SAT_S_TRUNC_FMT_3(NT, WT, x) + #endif diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i16-to-i8.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i16-to-i8.c new file mode 100644 index 000000000000..7b8a663d53bc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i16-to-i8.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -O3 -fdump-rtl-expand-details -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "sat_arith.h" + +/* +** sat_s_trunc_int16_t_to_int8_t_fmt_3: +** slti\s+[atx][0-9]+,\s*[atx][0-9]+,\s*127 +** li\s+[atx][0-9]+,\s*-128 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** neg\s+[atx][0-9]+,\s*[atx][0-9]+ +** srai\s+[atx][0-9]+,\s*[atx][0-9]+,\s*63 +** xori\s+[atx][0-9]+,\s*[atx][0-9]+,\s*127 +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** or\s+a0,\s*[atx][0-9]+,\s*[atx][0-9]+ +** slliw\s+a0,\s*a0,\s*24 +** sraiw\s+a0,\s*a0,\s*24 +** ret +*/ +DEF_SAT_S_TRUNC_FMT_3(int8_t, int16_t, INT8_MIN, INT8_MAX) + +/* { dg-final { scan-rtl-dump-times ".SAT_TRUNC " 2 "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i32-to-i16.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i32-to-i16.c new file mode 100644 index 000000000000..04a6442168fc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i32-to-i16.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -O3 -fdump-rtl-expand-details -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "sat_arith.h" + +/* +** sat_s_trunc_int32_t_to_int16_t_fmt_3: +** li\s+[atx][0-9]+,\s*32768 +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** li\s+[atx][0-9]+,\s*-32768 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** neg\s+[atx][0-9]+,\s*[atx][0-9]+ +** srai\s+[atx][0-9]+,\s*[atx][0-9]+,\s*63 +** xor\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** or\s+a0,\s*[atx][0-9]+,\s*[atx][0-9]+ +** slliw\s+a0,\s*a0,\s*16 +** sraiw\s+a0,\s*a0,\s*16 +** ret +*/ +DEF_SAT_S_TRUNC_FMT_3(int16_t, int32_t, INT16_MIN, INT16_MAX) + +/* { dg-final { scan-rtl-dump-times ".SAT_TRUNC " 2 "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i32-to-i8.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i32-to-i8.c new file mode 100644 index 000000000000..0d259129e37b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i32-to-i8.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -O3 -fdump-rtl-expand-details -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "sat_arith.h" + +/* +** sat_s_trunc_int32_t_to_int8_t_fmt_3: +** slti\s+[atx][0-9]+,\s*[atx][0-9]+,\s*127 +** li\s+[atx][0-9]+,\s*-128 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** neg\s+[atx][0-9]+,\s*[atx][0-9]+ +** srai\s+[atx][0-9]+,\s*[atx][0-9]+,\s*63 +** xori\s+[atx][0-9]+,\s*[atx][0-9]+,\s*127 +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** or\s+a0,\s*[atx][0-9]+,\s*[atx][0-9]+ +** slliw\s+a0,\s*a0,\s*24 +** sraiw\s+a0,\s*a0,\s*24 +** ret +*/ +DEF_SAT_S_TRUNC_FMT_3(int8_t, int32_t, INT8_MIN, INT8_MAX) + +/* { dg-final { scan-rtl-dump-times ".SAT_TRUNC " 2 "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i16.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i16.c new file mode 100644 index 000000000000..faad9e8c94ab --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i16.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -O3 -fdump-rtl-expand-details -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "sat_arith.h" + +/* +** sat_s_trunc_int64_t_to_int16_t_fmt_3: +** li\s+[atx][0-9]+,\s*32768 +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** li\s+[atx][0-9]+,\s*-32768 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** neg\s+[atx][0-9]+,\s*[atx][0-9]+ +** srai\s+[atx][0-9]+,\s*[atx][0-9]+,\s*63 +** xor\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** or\s+a0,\s*[atx][0-9]+,\s*[atx][0-9]+ +** slliw\s+a0,\s*a0,\s*16 +** sraiw\s+a0,\s*a0,\s*16 +** ret +*/ +DEF_SAT_S_TRUNC_FMT_3(int16_t, int64_t, INT16_MIN, INT16_MAX) + +/* { dg-final { scan-rtl-dump-times ".SAT_TRUNC " 2 "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i32.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i32.c new file mode 100644 index 000000000000..3478f52e8fe3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i32.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -O3 -fdump-rtl-expand-details -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "sat_arith.h" + +/* +** sat_s_trunc_int64_t_to_int32_t_fmt_3: +** li\s+[atx][0-9]+,\s*-2147483648 +** xori\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** neg\s+[atx][0-9]+,\s*[atx][0-9]+ +** srai\s+[atx][0-9]+,\s*[atx][0-9]+,\s*63 +** xor\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** or\s+a0,\s*[atx][0-9]+,\s*[atx][0-9]+ +** sext\.w\s+a0,\s*a0 +** ret +*/ +DEF_SAT_S_TRUNC_FMT_3(int32_t, int64_t, INT32_MIN, INT32_MAX) + +/* { dg-final { scan-rtl-dump-times ".SAT_TRUNC " 2 "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i8.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i8.c new file mode 100644 index 000000000000..bd4ee24afc80 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-3-i64-to-i8.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -O3 -fdump-rtl-expand-details -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "sat_arith.h" + +/* +** sat_s_trunc_int64_t_to_int8_t_fmt_3: +** slti\s+[atx][0-9]+,\s*[atx][0-9]+,\s*127 +** li\s+[atx][0-9]+,\s*-128 +** slt\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** addi\s+[atx][0-9]+,\s*[atx][0-9]+,\s*-1 +** neg\s+[atx][0-9]+,\s*[atx][0-9]+ +** srai\s+[atx][0-9]+,\s*[atx][0-9]+,\s*63 +** xori\s+[atx][0-9]+,\s*[atx][0-9]+,\s*127 +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** and\s+[atx][0-9]+,\s*[atx][0-9]+,\s*[atx][0-9]+ +** or\s+a0,\s*[atx][0-9]+,\s*[atx][0-9]+ +** slliw\s+a0,\s*a0,\s*24 +** sraiw\s+a0,\s*a0,\s*24 +** ret +*/ +DEF_SAT_S_TRUNC_FMT_3(int8_t, int64_t, INT8_MIN, INT8_MAX) + +/* { dg-final { scan-rtl-dump-times ".SAT_TRUNC " 2 "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i16-to-i8.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i16-to-i8.c new file mode 100644 index 000000000000..032c83b7afb5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i16-to-i8.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define T1 int8_t +#define T2 int16_t + +DEF_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, INT8_MIN, INT8_MAX) + +#define DATA TEST_UNARY_DATA_WRAP(T1, T2) +#define T TEST_UNARY_STRUCT_DECL(T1, T2) +#define RUN_UNARY(x) RUN_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, x) + +#include "scalar_sat_unary.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i32-to-i16.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i32-to-i16.c new file mode 100644 index 000000000000..51f4946a5362 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i32-to-i16.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define T1 int16_t +#define T2 int32_t + +DEF_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, INT16_MIN, INT16_MAX) + +#define DATA TEST_UNARY_DATA_WRAP(T1, T2) +#define T TEST_UNARY_STRUCT_DECL(T1, T2) +#define RUN_UNARY(x) RUN_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, x) + +#include "scalar_sat_unary.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i32-to-i8.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i32-to-i8.c new file mode 100644 index 000000000000..b959bce41014 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i32-to-i8.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define T1 int8_t +#define T2 int32_t + +DEF_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, INT8_MIN, INT8_MAX) + +#define DATA TEST_UNARY_DATA_WRAP(T1, T2) +#define T TEST_UNARY_STRUCT_DECL(T1, T2) +#define RUN_UNARY(x) RUN_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, x) + +#include "scalar_sat_unary.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i16.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i16.c new file mode 100644 index 000000000000..ddfb522b5005 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i16.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define T1 int16_t +#define T2 int64_t + +DEF_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, INT16_MIN, INT16_MAX) + +#define DATA TEST_UNARY_DATA_WRAP(T1, T2) +#define T TEST_UNARY_STRUCT_DECL(T1, T2) +#define RUN_UNARY(x) RUN_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, x) + +#include "scalar_sat_unary.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i32.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i32.c new file mode 100644 index 000000000000..22965e2077d8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i32.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define T1 int32_t +#define T2 int64_t + +DEF_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, INT32_MIN, INT32_MAX) + +#define DATA TEST_UNARY_DATA_WRAP(T1, T2) +#define T TEST_UNARY_STRUCT_DECL(T1, T2) +#define RUN_UNARY(x) RUN_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, x) + +#include "scalar_sat_unary.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i8.c b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i8.c new file mode 100644 index 000000000000..7cba40860543 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-3-i64-to-i8.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define T1 int8_t +#define T2 int64_t + +DEF_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, INT8_MIN, INT8_MAX) + +#define DATA TEST_UNARY_DATA_WRAP(T1, T2) +#define T TEST_UNARY_STRUCT_DECL(T1, T2) +#define RUN_UNARY(x) RUN_SAT_S_TRUNC_FMT_3_WRAP(T1, T2, x) + +#include "scalar_sat_unary.h"