From: Pan Li Date: Tue, 16 Jun 2026 05:42:42 +0000 (+0800) Subject: RISC-V: Add testcase for unsigned scalar SAT_MUL form 13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a05799c29c50d7b5fdae6fcaf0bb807e4081992f;p=thirdparty%2Fgcc.git RISC-V: Add testcase for unsigned scalar SAT_MUL form 13 The form 12 of unsigned scalar SAT_MUL has supported from the previous change. Thus, add the test cases to make sure it works well. gcc/testsuite/ChangeLog: * gcc.target/riscv/sat/sat_arith.h: Add test helper macros * gcc.target/riscv/sat/sat_u_mul-14-u16-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u16-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv32.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv64.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u32-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv32.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv64.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u64-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u8-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u8-from-u16.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u8-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv32.c: New test. * gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv64.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u64.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u64.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u64-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u16.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u64.c: New test. Signed-off-by: Pan Li --- diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h b/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h index bc382db28c7..9a57df400d4 100644 --- a/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h @@ -853,4 +853,20 @@ sat_u_mul_##T##_fmt_12 (T a, T b) \ #define RUN_SAT_U_MUL_FMT_12(T, a, b) sat_u_mul_##T##_fmt_12(a, b) #define RUN_SAT_U_MUL_FMT_12_WRAP(T, a, b) RUN_SAT_U_MUL_FMT_12(T, a, b) +#define DEF_SAT_U_MUL_FMT_13(NT, WT) \ +NT __attribute__((noinline)) \ +sat_u_mul_##NT##_from_##WT##_fmt_13 (NT a, NT b) \ +{ \ + WT x = (WT)a * (WT)b; \ + if ((x >> sizeof(a) * 8) != 0) \ + return (NT)-1; \ + else \ + return (NT)x; \ +} + +#define DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) DEF_SAT_U_MUL_FMT_13(NT, WT) +#define RUN_SAT_U_MUL_FMT_13(NT, WT, a, b) \ + sat_u_mul_##NT##_from_##WT##_fmt_13 (a, b) +#define RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, a, b) RUN_SAT_U_MUL_FMT_13(NT, WT, a, b) + #endif diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u128.c new file mode 100644 index 00000000000..d396320da37 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u32.c new file mode 100644 index 00000000000..40214f47bd7 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint32_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv32.c new file mode 100644 index 00000000000..174b7268f0f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gc -mabi=ilp32 -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv64.c new file mode 100644 index 00000000000..e7515689d70 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u16-from-u64.rv64.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u128.c new file mode 100644 index 00000000000..37c271916cd --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint32_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv32.c new file mode 100644 index 00000000000..ce24b306a12 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gc -mabi=ilp32 -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint32_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv64.c new file mode 100644 index 00000000000..7da74d98d69 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u32-from-u64.rv64.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint32_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u64-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u64-from-u128.c new file mode 100644 index 00000000000..2ebe9e4877d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u64-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint64_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u128.c new file mode 100644 index 00000000000..b9c203b1873 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u16.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u16.c new file mode 100644 index 00000000000..13b43239310 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u16.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint16_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u32.c new file mode 100644 index 00000000000..b508744e933 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint32_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv32.c new file mode 100644 index 00000000000..b89e8f2bd9a --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gc -mabi=ilp32 -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv64.c new file mode 100644 index 00000000000..327b769745f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-14-u8-from-u64.rv64.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u128.c new file mode 100644 index 00000000000..26678597af8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u32.c new file mode 100644 index 00000000000..4768c72fd6f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u32.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint16_t +#define WT uint32_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u64.c new file mode 100644 index 00000000000..057c5cc3afe --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u16-from-u64.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint16_t +#define WT uint64_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u128.c new file mode 100644 index 00000000000..a7d49c55114 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint32_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u64.c new file mode 100644 index 00000000000..a0e65fc3fcf --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u32-from-u64.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint32_t +#define WT uint64_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u64-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u64-from-u128.c new file mode 100644 index 00000000000..a2472ae0269 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u64-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint64_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u128.c new file mode 100644 index 00000000000..26678597af8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u16.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u16.c new file mode 100644 index 00000000000..81479187912 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u16.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint16_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u32.c new file mode 100644 index 00000000000..a69ae6282ef --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u32.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint32_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u64.c new file mode 100644 index 00000000000..2db2d7326ba --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-14-u8-from-u64.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint64_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_13_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_13_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h"