From: Pan Li Date: Mon, 18 May 2026 09:46:05 +0000 (+0800) Subject: RISC-V: Add testcase for unsigned scalar SAT_MUL form 11 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=42989c22cfdbcd4207482bc6476ddb8d00a3424d;p=thirdparty%2Fgcc.git RISC-V: Add testcase for unsigned scalar SAT_MUL form 11 The form 11 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-12-u16-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u16-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u16-from-u64.rv32.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u16-from-u64.rv64.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u32-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u32-from-u64.rv32.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u32-from-u64.rv64.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u64-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u8-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u8-from-u16.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u8-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u8-from-u64.rv32.c: New test. * gcc.target/riscv/sat/sat_u_mul-12-u8-from-u64.rv64.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u64.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u32-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u32-from-u64.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u64-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u128.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u16.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u32.c: New test. * gcc.target/riscv/sat/sat_u_mul-run-12-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 cc55228b0ad..ca842eb5a07 100644 --- a/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h @@ -823,4 +823,19 @@ sat_u_mul_##T##_fmt_10 (T a, T b) \ #define RUN_SAT_U_MUL_FMT_10(T, a, b) sat_u_mul_##T##_fmt_10(a, b) #define RUN_SAT_U_MUL_FMT_10_WRAP(T, a, b) RUN_SAT_U_MUL_FMT_10(T, a, b) +#define DEF_SAT_U_MUL_FMT_11(NT, WT) \ +NT __attribute__((noinline)) \ +sat_u_mul_##NT##_from_##WT##_fmt_11 (NT a, NT b) \ +{ \ + WT x = (WT)a * (WT)b; \ + NT max = -1; \ + bool overflow_p = x >= (WT)(max); \ + return -(NT)(overflow_p) | (NT)x; \ +} + +#define DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) DEF_SAT_U_MUL_FMT_11(NT, WT) +#define RUN_SAT_U_MUL_FMT_11(NT, WT, a, b) \ + sat_u_mul_##NT##_from_##WT##_fmt_11 (a, b) +#define RUN_SAT_U_MUL_FMT_11_WRAP(NT, WT, a, b) RUN_SAT_U_MUL_FMT_11(NT, WT, a, b) + #endif diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u16-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u16-from-u128.c new file mode 100644 index 00000000000..0c7911bf04c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u16-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u16-from-u32.c new file mode 100644 index 00000000000..0df037f7b7f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u16-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u16-from-u64.rv32.c new file mode 100644 index 00000000000..f6de3ce07e9 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u16-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u16-from-u64.rv64.c new file mode 100644 index 00000000000..97aad1abc7d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u32-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u32-from-u128.c new file mode 100644 index 00000000000..25bad8af090 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u32-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u32-from-u64.rv32.c new file mode 100644 index 00000000000..dc95a5cf328 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u32-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u32-from-u64.rv64.c new file mode 100644 index 00000000000..81fae11d5ed --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u64-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u64-from-u128.c new file mode 100644 index 00000000000..45000a97b52 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u8-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u8-from-u128.c new file mode 100644 index 00000000000..643ee93b516 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u8-from-u16.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u8-from-u16.c new file mode 100644 index 00000000000..8b82a44a4e4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u8-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u8-from-u32.c new file mode 100644 index 00000000000..1ca93f2d529 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u8-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u8-from-u64.rv32.c new file mode 100644 index 00000000000..17c53dfb4ef --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u8-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-u8-from-u64.rv64.c new file mode 100644 index 00000000000..d645080442a --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-12-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_11_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-12-u16-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u128.c new file mode 100644 index 00000000000..6a9359cdad4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u32.c new file mode 100644 index 00000000000..639a071b809 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u16-from-u64.c new file mode 100644 index 00000000000..6409ad90ba6 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u32-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u32-from-u128.c new file mode 100644 index 00000000000..ef16d7c7e99 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u32-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u32-from-u64.c new file mode 100644 index 00000000000..ddb0e53843d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u64-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u64-from-u128.c new file mode 100644 index 00000000000..8c2b7531223 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u128.c new file mode 100644 index 00000000000..6a9359cdad4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u16.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u16.c new file mode 100644 index 00000000000..c8e42b4c3fc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u32.c new file mode 100644 index 00000000000..3fd2a8559cc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-u8-from-u64.c new file mode 100644 index 00000000000..50bb32f1875 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-12-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_11_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_11_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h"