powerpc: warn against incorrect values for ABI-relevant target features#157085
powerpc: warn against incorrect values for ABI-relevant target features#157085RalfJung wants to merge 1 commit into
Conversation
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
c2a0a73 to
5025c08
Compare
This is correct to my knowledge, the SPE instructions perform float-point math on the integer registers. However I'm wondering whether this change will break the SPE targets since to my understanding this enforces |
|
Oh, well, now that I'm looking at the SPE target definitions, they don't even seem to enable SPE in LLVM, so they're probably already broken as-is |
|
Oh I didn't realize we have SPE targets. But yeah, looking at those targets... they set |
That wouldn't matter for the ABI. But I guess they will then also use integer registers for passing float arguments / return values, and that makes them ABI-incompatible with non-SPE targets? |
5025c08 to
a72f0b0
Compare
Yes, sorry for not being clear on that in my previous reply. |
|
See also https://www.nxp.com/docs/en/reference-manual/E500ABIUG.pdf
64-bit floats are passed in 2 GPRs. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@rustbot reroll |
|
@rustbot reroll |
|
Waiting for the pinged people to respond (for 1-2 weeks max, I guess). |
This fills in #131799 for PowerPC. Based on this comment by @beetrees, the relevant target features are "hard-float" and "spe". I confirmed this by looking at the LLVM sources:
(this is in
llvm/lib/Target/PowerPC/PPCISelLowering.cpp)So, we make rustc emit a warning indicating the ABI compatibility issues if "spe" or hard-float" gets toggled. The plan is to eventually make this a hard error.
I also found this code there, in the handling for "altivec", that look like they are enabling more registers to be used for the ABI, but maybe I am missing a subtle difference in these
addRegisterClasscalls:Cc @nikic for help with interpreting this LLVM code.
Cc @Gelbpunkt @famfo @neuschaefer as maintainers of affected targets