[Bug target/87690] [RISCV][ABI] GCC fails to sign-extend floats passed in the lp64 ABI

asb at lowrisc dot org gcc-bugzilla@gcc.gnu.org
Tue Oct 23 23:45:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87690

--- Comment #6 from Alex Bradbury <asb at lowrisc dot org> ---
(In reply to Jim Wilson from comment #4)
> I think the intent of the second rule is that float values are passed in the
> same regs as an integer value, and that it wasn't the intent that the
> promotion rule also applied to float values.

Maybe. Given the looseness of the phrasing I expect signext vs anyext just
wasn't thought about.

First of all, many thanks for such a detailed response. I'm completely happy
with seeing the psABI doc updated so that floats passed via the integer calling
convention are anyext. On the LLVM side, I think it's actually not too
difficult to enforce sign-extension of floats passed in -mabi=lp64. But there's
definitely effort in thoroughly testing it works in all cases. Plus changing
nothing is even simpler.

I also don't see value in enforcing that floats are sign-extended. Lets fix the
psABI docs. I've made a PR to do so
https://github.com/riscv/riscv-elf-psabi-doc/pull/82


More information about the Gcc-bugs mailing list