]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Add testcases for form 2 of scalar signed SAT_TRUNC
authorPan Li <pan2.li@intel.com>
Wed, 9 Oct 2024 02:33:31 +0000 (10:33 +0800)
committerPan Li <pan2.li@intel.com>
Fri, 11 Oct 2024 10:16:46 +0000 (18:16 +0800)
commit00d04a7b237fad4928bcaac19b3d0f18ddf8810e
tree17ccbb036eb5ecea319677cc8b1987a64e45a3ad
parent1f84115e6569bc647a93e142ae53098efe2b8101
RISC-V: Add testcases for form 2 of scalar signed SAT_TRUNC

Form 2:
  #define DEF_SAT_S_TRUNC_FMT_2(NT, WT, NT_MIN, NT_MAX) \
  NT __attribute__((noinline))                          \
  sat_s_trunc_##WT##_to_##NT##_fmt_2 (WT x)             \
  {                                                     \
    NT trunc = (NT)x;                                   \
    return (WT)NT_MIN < x && x < (WT)NT_MAX             \
      ? trunc                                           \
      : x < 0 ? NT_MIN : NT_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/sat_arith.h: Add test helper macros.
* gcc.target/riscv/sat_s_trunc-2-i16-to-i8.c: New test.
* gcc.target/riscv/sat_s_trunc-2-i32-to-i16.c: New test.
* gcc.target/riscv/sat_s_trunc-2-i32-to-i8.c: New test.
* gcc.target/riscv/sat_s_trunc-2-i64-to-i16.c: New test.
* gcc.target/riscv/sat_s_trunc-2-i64-to-i32.c: New test.
* gcc.target/riscv/sat_s_trunc-2-i64-to-i8.c: New test.
* gcc.target/riscv/sat_s_trunc-run-2-i16-to-i8.c: New test.
* gcc.target/riscv/sat_s_trunc-run-2-i32-to-i16.c: New test.
* gcc.target/riscv/sat_s_trunc-run-2-i32-to-i8.c: New test.
* gcc.target/riscv/sat_s_trunc-run-2-i64-to-i16.c: New test.
* gcc.target/riscv/sat_s_trunc-run-2-i64-to-i32.c: New test.
* gcc.target/riscv/sat_s_trunc-run-2-i64-to-i8.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
13 files changed:
gcc/testsuite/gcc.target/riscv/sat_arith.h
gcc/testsuite/gcc.target/riscv/sat_s_trunc-2-i16-to-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-2-i32-to-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-2-i32-to-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-2-i64-to-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-2-i64-to-i32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-2-i64-to-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-2-i16-to-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-2-i32-to-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-2-i32-to-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-2-i64-to-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-2-i64-to-i32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_s_trunc-run-2-i64-to-i8.c [new file with mode: 0644]