Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect description of the calling convention for floats passed in GPRs #998

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

asb
Copy link
Contributor

@asb asb commented Mar 24, 2023

As I noted previously in riscvarchive/riscv-zfinx#14, it's incorrect to say that floating point values passed in GPRs are sign-extended in the standard calling convention. The current, ratified psABI states "Floating-point reals are passed the same way as aggregates of the same size" and the relevant part from the description of aggregates is "Bits unused due to padding, and bits past the end of an aggregate whose size in bits is not divisible by XLEN, are undefined."

@asb asb force-pushed the fix-zfinx-abi-reference branch from ca5de51 to fa25f8b Compare March 24, 2023 11:53
@asb asb changed the title Fix incorrect description of the calling convetion for floats passed in GPRs Fix incorrect description of the calling convention for floats passed in GPRs Mar 24, 2023
@asb asb force-pushed the fix-zfinx-abi-reference branch from fa25f8b to 42cfbd1 Compare March 24, 2023 14:22
src/zfinx.tex Outdated Show resolved Hide resolved
@asb asb force-pushed the fix-zfinx-abi-reference branch from 42cfbd1 to 4b893a8 Compare March 24, 2023 15:45
@asb
Copy link
Contributor Author

asb commented Mar 24, 2023

Thanks for the quick review - I've pushed a tweaked version of the commit.

src/zfinx.tex Outdated Show resolved Hide resolved
… in GPRs

As I noted previously in
<riscvarchive/riscv-zfinx#14>, it's incorrect to say
that floating point values passed in GPRs are sign-extended in the
standard calling convention. The [current, ratified
psABI](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/6cda8927232dc59424426f4dd0de2e0723d865fb/riscv-cc.adoc)
states "Floating-point reals are passed the same way as aggregates of
the same size" and the relevant part from the description of
aggregates is "Bits unused due to padding, and bits past the end of an
aggregate whose size in bits is not divisible by XLEN, are undefined."
@asb asb force-pushed the fix-zfinx-abi-reference branch from 4b893a8 to a8c8921 Compare March 24, 2023 15:51
@aswaterman aswaterman merged commit 1fbdcfd into riscv:master Mar 24, 2023
wmat added a commit that referenced this pull request Apr 3, 2023
Manually applying commit #998.  As I noted previously in
<riscvarchive/riscv-zfinx#14>, it's incorrect to say
that floating point values passed in GPRs are sign-extended in the
standard calling convention. The [current, ratified
psABI](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/6cda8927232dc59424426f4dd0de2e0723d865fb/riscv-cc.adoc)
states "Floating-point reals are passed the same way as aggregates of
the same size" and the relevant part from the description of
aggregates is "Bits unused due to padding, and bits past the end of an
aggregate whose size in bits is not divisible by XLEN, are undefined."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants