#[no_mangle]
extern "efiapi" fn efi(x: u32, y: u32) -> u32 {
x * y
}
LLVM emits this:
efi:
mov eax, ecx
imul eax, edx
ret
GCC emits this (notice the incorrect registers used for parameters):
efi:
mov eax, edi
imul eax, esi
ret
As far as I can tell, we don't preserve the declared ABI since libgccjit doesn't have a way to annotate the ABI of functions with an annotated ABI. This needs to be implemented for ui/asm/x86_64/multiple-clobber-abi.rs to pass, which requires both the sysv64 and win64 extern abi to be supported.
Yeah, for that, we would need to support a few new function attributes. If you want to take a look, you would need to add the attributes in a few places:
The following function miscompiles:
LLVM emits this:
GCC emits this (notice the incorrect registers used for parameters):
As far as I can tell, we don't preserve the declared ABI since libgccjit doesn't have a way to annotate the ABI of functions with an annotated ABI. This needs to be implemented for
ui/asm/x86_64/multiple-clobber-abi.rs
to pass, which requires both thesysv64
andwin64
extern abi to be supported.