]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Add testcases for unsigned scalar quad and oct .SAT_TRUNC form 2
authorPan Li <pan2.li@intel.com>
Sun, 18 Aug 2024 04:49:47 +0000 (12:49 +0800)
committerPan Li <pan2.li@intel.com>
Mon, 2 Sep 2024 01:26:37 +0000 (09:26 +0800)
commitea81e21d5398bdacf883533fd738fc45ea8d6dd9
tree37c11b66448893b542736d182db7464a826f273d
parent56ed1dfa79c436b769f3266258d34d160b4330d9
RISC-V: Add testcases for unsigned scalar quad and oct .SAT_TRUNC form 2

This patch would like to add test cases for the unsigned scalar quad and
oct .SAT_TRUNC form 2.  Aka:

Form 2:
  #define DEF_SAT_U_TRUC_FMT_2(NT, WT)     \
  NT __attribute__((noinline))             \
  sat_u_truc_##WT##_to_##NT##_fmt_2 (WT x) \
  {                                        \
    WT max = (WT)(NT)-1;                   \
    return x > max ? (NT) max : (NT)x;     \
  }

QUAD:
DEF_SAT_U_TRUC_FMT_2 (uint16_t, uint64_t)
DEF_SAT_U_TRUC_FMT_2 (uint8_t, uint32_t)

OCT:
DEF_SAT_U_TRUC_FMT_2 (uint8_t, uint64_t)

The below test is passed for this patch.
* The rv64gcv regression test.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/sat_u_trunc-10.c: New test.
* gcc.target/riscv/sat_u_trunc-11.c: New test.
* gcc.target/riscv/sat_u_trunc-12.c: New test.
* gcc.target/riscv/sat_u_trunc-run-10.c: New test.
* gcc.target/riscv/sat_u_trunc-run-11.c: New test.
* gcc.target/riscv/sat_u_trunc-run-12.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/testsuite/gcc.target/riscv/sat_u_trunc-10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_u_trunc-11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_u_trunc-12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_u_trunc-run-10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_u_trunc-run-11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/sat_u_trunc-run-12.c [new file with mode: 0644]