On Fri, 10 Jan 2025 12:21:15 PST (-0800), jeffreya...@gmail.com wrote:
On 1/10/25 12:11 PM, Robin Dapp wrote:
Integer values and floating-point values need to be converted
by fmv series instructions. So if mode1 is MODE_INT and mode2
is MODE_FLOAT, we should return false in riscv_modes_tieable_p,
and vice versa.
I think that's on purpose because we can read and write float values
from/to integer registers. Maybe it's a cost problem that we spill
at some point rather than access directly?
But even if you spill, as long as loads/stores don't modify the value
then I think we're OK from a correctness standpoint.
If I compile your test case I do see converting moves in the final
assembly - is there something you're concerned about in particular?
Which appears to be the glibc code (or very similar to it), and I don't
think we've had users reporting incorrect results there.
Which was my general question as well. Under precisely what
circumstances is this causing a problem? The secondary question would
be how does this change interact with the finx and related extensions?
FWIW I'm also a bit lost here: I'd expect riscv_hard_regno_mode_ok() to
be sufficient to handle these X/F register mixing cases, and thus us not
to need any more special handling in riscv_modes_tieable_p().
(I think we're safe for finx with the current code, as we can access the
registers safely there.)
So maybe there's something else also needed to trigger this?
Jeff