Open arichardson opened 3 years ago
How common are pointers-to-members? If it's just a bit of Qt stuff then I personally would be fine with not doing a proper transition for that ABI break as nobody other than you will notice...
Oh, is this just a specific case of struct { void *; long; }
gets passed indirectly rather than treated like other register pair structs, as currently it only recognises {GPR,FPR}x{GPR,FPR} pairs?
I feel like there might be some libc++ internals that are affected by this, but I haven't verified it.
And yes, we can probably fix this by classifying struct { void *; long; }
as using two GPRs, but then it would be a bigger ABI break: https://cheri-compiler-explorer.cl.cam.ac.uk/z/hdEWje
And we should probably also return pairs in registers nstead of sret: https://cheri-compiler-explorer.cl.cam.ac.uk/z/s96WTY
I think that might have a perf impact that is worth an ABI break.
Yeah, returns are defined to be "how it would be passed as the first argument" so the two are the same.
And yes, it's what I always meant to do, it's just a real pain to get that code right when you have FPRs to deal with too so punted...
Looks like RISC-V also passes FP values in x registers like AArch64? https://cheri-compiler-explorer.cl.cam.ac.uk/z/Prccqn
This probably won't have a huge impact on performance, so we should probably wait until we are breaking the ABI anyway and include this change.
Right now we pass pointers-to-members as an indirect
{ i8 addrspace(200)*, i64 } addrspace(200)*
argument so we have to add a stack allocation and setbounds instruction.See https://cheri-compiler-explorer.cl.cam.ac.uk/z/3eETGd:
->
whereas plain RISC-V and MIPS pass it directly:
MIPS: