]> git.ipfire.org Git - thirdparty/gcc.git/commit
[committed][RISC-V] Fix nearbyint failure on rv32 and formatting nits
authorJeff Law <jlaw@ventanamicro.com>
Thu, 2 May 2024 23:13:12 +0000 (17:13 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Thu, 2 May 2024 23:13:12 +0000 (17:13 -0600)
commit8367c996e55b2c54aeee25e446357a1015a1d11d
tree7ebdf552552551b20a62477c8d2fe43f22f380f0
parentaffd24bfc62203db9f9937c0d6cf8f1f75b80d72
[committed][RISC-V] Fix nearbyint failure on rv32 and formatting nits

The CI system tripped an execution failure for rv32 with the ceil/round patch.

The fundamental problem is the FP->INT step in these sequences requires the
input size to match the output size.  The output size was based on rv32/rv64.
Meaning that we'd try to do DF->SI->DF.

That doesn't preserve the semantics we want in at least two ways.

The net is we can't use this trick for DF values on rv32.  While inside the
code I realized we had a similar problem for HF modes.  HF modes we can support
only for Zfa.  So I fixed that proactively.

The CI system also pointed out various formatting nits.  I think this fixes all
but one overly long line.

Note I could have factored the TARGET_ZFA test.  But I think as-written it's
clearer what the desired cases to transform are.

gcc/
* config/riscv/riscv.md (<round_pattern><ANYF:mode>2): Adjust
condition to match what can be properly implemented.  Fix various
formatting issues.
(l<round_pattern><ANYF:mode>si2_sext): Fix formatting
gcc/config/riscv/riscv.md