[PATCH v1] RISC-V: Refine the scalar SAT_* test cases

Jeff Law jeffreyalaw@gmail.com
Mon Jul 14 12:37:08 GMT 2025



On 7/12/25 8:26 AM, pan2.li@intel.com wrote:
> From: Pan Li <pan2.li@intel.com>
> 
> Per previous discuss with Jeff, we don't do complicated
> asm check like scalar saturation alu.  It is somehow
> not easy to maintain, as well as fragile.  Thus, we
> remove these function-body check, and introduce the
> jmp label asm check instead.The code-gen of SAT_*
> will never have a jmp, and the other run test will
> make sure the correctness of SAT_* code-gen.
> 
> The below test suites are passed for this patch series.
> * The rv64gcv fully regression test.
> 
> The below failed test cases are resolved:
> FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -Oz
>    check-function-bodies sat_s_add_imm_int8_t_fmt_2_1
> FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -Os
>    check-function-bodies sat_s_add_imm_int8_t_fmt_2_1
> FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -O3
>    check-function-bodies sat_s_add_imm_int8_t_fmt_2_1
> FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -Ofast
>    check-function-bodies sat_s_add_imm_int8_t_fmt_2_1
> FAIL: gcc.target/riscv/sat/sat_s_add_imm-2-i8.c -O2
>    check-function-bodies sat_s_add_imm_int8_t_fmt_2_1
Just to make sure I understand.  We're switching to a check that we've 
got a branchless sequence, right?  That seems like a good idea, 
particularly when mated with the pre-existing test that we've got the 
appropriate SAT IFN in the .optimized dump.

Thanks for taking care of this.  While the changes aren't terribly 
complex, there's a *lot* of them.

Jeff




More information about the Gcc-patches mailing list