]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Add testcases for unsigned scalar quad and oct .SAT_TRUNC form 3
authorPan Li <pan2.li@intel.com>
Sun, 18 Aug 2024 06:08:21 +0000 (14:08 +0800)
committerPan Li <pan2.li@intel.com>
Mon, 2 Sep 2024 01:26:42 +0000 (09:26 +0800)
commit5239902210a16b22d59d2cf8b535d615922a5c00
tree189d303c0e9c54315bcff8fe3681b6d65af04d94
parentea81e21d5398bdacf883533fd738fc45ea8d6dd9
RISC-V: Add testcases for unsigned scalar quad and oct .SAT_TRUNC form 3

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

Form 3:
  #define DEF_SAT_U_TRUC_FMT_3(NT, WT)     \
  NT __attribute__((noinline))             \
  sat_u_truc_##WT##_to_##NT##_fmt_3 (WT x) \
  {                                        \
    WT max = (WT)(NT)-1;                   \
    return x <= max ? (NT)x : (NT) max;    \
  }

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

OCT:
DEF_SAT_U_TRUC_FMT_3 (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-16.c: New test.
* gcc.target/riscv/sat_u_trunc-17.c: New test.
* gcc.target/riscv/sat_u_trunc-18.c: New test.
* gcc.target/riscv/sat_u_trunc-run-16.c: New test.
* gcc.target/riscv/sat_u_trunc-run-17.c: New test.
* gcc.target/riscv/sat_u_trunc-run-18.c: New test.

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