On 1/21/24 23:12, Monk Chiang wrote:
Since the match.pd transforms (zero_one == 0) ? y : z <op> y,
into ((typeof(y))zero_one * z) <op> y. Add splitters to recongize
this expression to generate SFB instructions.
gcc/ChangeLog:
PR target/113095
* config/riscv/sfb.md: New splitters to rewrite single bit
sign extension as the condition to SFB instructions.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/sfb.c: New test.
* gcc.target/riscv/pr113095.c: New test.
So the 113095 test is going to fail to link on rv64 causing a testsuite
failure. I would suggest it have these dg-options lines instead of the
one you provided:
/* { dg-options "-O2 -march=rv32gc -mabi=ilp32d -mtune=sifive-7-series"
{ target { rv32 } } } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -mtune=sifive-7-series" {
target { rv64 } } } */
A similar change is not strictly needed for the new sfb.c test since it
only does a compile (but not a link) test.
You still didn't indicating what testing was done for this patch.
Standard practice is to build the compiler and run the testsuite with
and without your change and verify there are no regressions. Ideally
new tests should pass as well.
I made the change above locally to pr113095.c to fix those failures on
rv64. So this is OK with the adjustment to the dg-options line in the
new pr113095 test.
Jeff