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

RISC-V: Add testcases for form 3 of scalar signed SAT_SUB


Form 3:
  #define DEF_SAT_S_SUB_FMT_3(T, UT, MIN, MAX)             \
  T __attribute__((noinline))                              \
  sat_s_sub_##T##_fmt_3 (T x, T y)                         \
  {                                                        \
    T minus;                                               \
    bool overflow = __builtin_sub_overflow (x, y, &minus); \
    return overflow ? x < 0 ? MIN : MAX : minus;           \
  }

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_sub-3-i16.c: New test.
	* gcc.target/riscv/sat_s_sub-3-i32.c: New test.
	* gcc.target/riscv/sat_s_sub-3-i64.c: New test.
	* gcc.target/riscv/sat_s_sub-3-i8.c: New test.
	* gcc.target/riscv/sat_s_sub-run-3-i16.c: New test.
	* gcc.target/riscv/sat_s_sub-run-3-i32.c: New test.
	* gcc.target/riscv/sat_s_sub-run-3-i64.c: New test.
	* gcc.target/riscv/sat_s_sub-run-3-i8.c: New test.

Signed-off-by: default avatarPan Li <pan2.li@intel.com>
parent e21a8d9e
No related branches found
No related tags found
No related merge requests found
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