-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
aarch64 softfloat target: always pass floats in int registers #133102
base: master
Are you sure you want to change the base?
Conversation
r? @Nadrieril rustbot has assigned @Nadrieril. Use |
This comment has been minimized.
This comment has been minimized.
d2a6139
to
7d57c37
Compare
Ah, we also have to do something for ScalarPair types. The easiest thing to do is pass them indirectly, so that's what I did for now. |
7d57c37
to
10a2a67
Compare
r? compiler |
Isn't this the second target we are manufacturing a by-integer ABI for? |
Is it? I am not aware of another.
|
x87 Rust ABI? |
There we are returning floats by-ptr, I think? Ah maybe we only do that for floats larger than a ptr. |
I am mostly musing that I should probably cross-check those cases to see if there's something that can be factored out before accepting this. |
For x86-32 we only do something with the return value, since arguments anyway never use the x87 stack. But yeah we could probably use the same logic for both. I am just not sure what is the best way to share that logic. |
OTOH we might want to change the x87 thing to use SSE registers if we can, so sharing the code might not be such a good idea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me, just a few comments.
10a2a67
to
f484507
Compare
f484507
to
666bcbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense
@bors r=davidtwco,wesleywiser |
This is a part of #131058: on softfloat aarch64 targets, the float registers may be unavailable. And yet, LLVM will happily use them to pass float types if the corresponding target features are enabled. That's a problem as it means enabling/disabling
neon
instructions can change the ABI.Other targets have a
soft-float
target feature that forces the use of the soft-float ABI no matter whether float registers are enabled or not; aarch64 has nothing like that.So we follow the aarch64 softfloat ABI and treat floats like integers for
extern "C"
functions. For the "Rust" ABI, we do the same for scalars, and then just do something reasonable for ScalarPair that avoids the pointer indirection.Cc @workingjubilee