Skip to content
Snippets Groups Projects
Commit 5ab1e238 authored by Pan Li's avatar Pan Li
Browse files

RISC-V: Add testcases for unsigned scalar .SAT_TRUNC form 4


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

Form 4:
  #define DEF_SAT_U_TRUNC_FMT_4(NT, WT)          \
  NT __attribute__((noinline))                   \
  sat_u_trunc_##WT##_to_##NT##_fmt_4 (WT x)      \
  {                                              \
    bool not_overflow = x <= (WT)(NT)(-1);       \
    return ((NT)x) | (NT)((NT)not_overflow - 1); \
  }

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

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/sat_arith.h: Add test helper macros.
	* gcc.target/riscv/sat_u_trunc-19.c: New test.
	* gcc.target/riscv/sat_u_trunc-20.c: New test.
	* gcc.target/riscv/sat_u_trunc-21.c: New test.
	* gcc.target/riscv/sat_u_trunc-22.c: New test.
	* gcc.target/riscv/sat_u_trunc-23.c: New test.
	* gcc.target/riscv/sat_u_trunc-24.c: New test.
	* gcc.target/riscv/sat_u_trunc-run-19.c: New test.
	* gcc.target/riscv/sat_u_trunc-run-20.c: New test.
	* gcc.target/riscv/sat_u_trunc-run-21.c: New test.
	* gcc.target/riscv/sat_u_trunc-run-22.c: New test.
	* gcc.target/riscv/sat_u_trunc-run-23.c: New test.
	* gcc.target/riscv/sat_u_trunc-run-24.c: New test.

Signed-off-by: default avatarPan Li <pan2.li@intel.com>
parent 07b7098b
No related branches found
No related tags found
No related merge requests found
Showing
with 218 additions and 0 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment