4 ms·
I just fixed an inline assembly bug in LLVM for PPC Linux kernel support: https://reviews.llvm.org/D81767 https://reviews.llvm.org/D81767 I tried to see if thi
by ndesaulniers 6y ago
I just fixed an inline assembly bug in LLVM for PPC Linux kernel support: https://reviews.llvm.org/D81767 https://reviews.llvm.org/D81767
I tried to see if this doc had anything about calling conventions for 64b parameters on 32b ILP32, but alas...(at least a cursory skim of `A.1 Procedure Interfaces` came up empty).
Another fun fact I learned about PPC assembly for that bug is that without `-mregnames`, it can be hard to distinguish between registers and constants in compiler generated PPC assembly. Official docs from IBM (https://developer.ibm.com/technologies/linux/articles/l-ppc/ https://developer.ibm.com/technologies/linux/articles/l-ppc/) say "Get used to it. :)" LOL
- classichasclass 6y agoWhat was your question on the parameters? Is this SysV or PowerOpen ABI?
- ndesaulniers 6y agoI've heard of OpenPower, but PowerOpen? I guess SysV since we're referring to Linux (though I'm not sure that the kernel strictly adheres to SysV).
- classichasclass 6y agoFor 32-bit PowerPC, PowerOpen is the ABI used in PPC Mac OS and OS X (largely, with a couple minor differences) and AIX. The System V ABI is pretty much everything else, but it's really a misnomer since the *BSDs on 32-bit PowerPC use SysV too. PowerOpen is still a thing for 64-bit, see https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-... As memory serves me, on 32-bit you would pass a 64-bit value in adjacent 32-bit registers in big-endian fashion.