Skip to content

Enable unadjusted_on_win64 for UEFI in some cases #486

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

Merged

Conversation

nicholasbishop
Copy link
Contributor

The conversion functions from i128/u128 to f32/f64 have the unadjusted_on_win64 attribute, but it is disabled starting with LLVM14. This seems to be the correct thing to do for Win64, but for some reason x86_64-unknown-uefi is different, despite generally using the same ABI as Win64.

The conversion functions from i128/u128 to f32/f64 have the
`unadjusted_on_win64` attribute, but it is disabled starting with
LLVM14. This seems to be the correct thing to do for Win64, but for some
reason x86_64-unknown-uefi is different, despite generally using the
same ABI as Win64.
@nicholasbishop
Copy link
Contributor Author

I'm really not at all sure why the ABI of these particular intrinsics would need to be different between Win64 and x86_64-unknown-uefi, but I have verified with a test UEFI program that this change fixes the conversions.

@Amanieu
Copy link
Member

Amanieu commented Aug 4, 2022

@nikic Any idea what's going on with the ABI here? I thought UEFI was supposed to act just like Windows with regards to i128 intrinsics.

@nikic
Copy link
Contributor

nikic commented Aug 6, 2022

I think this happens because we declare uefi as a soft-float target: https://llvm.godbolt.org/z/3846ExoPz

@Amanieu
Copy link
Member

Amanieu commented Aug 6, 2022

So is this a bug in LLVM? Or should this PR be merged?

@nikic
Copy link
Contributor

nikic commented Aug 7, 2022

This is probably an LLVM bug, but at the same time we don't particularly care what the actual ABI here is, so I think it's fine to merge this.

@Amanieu Amanieu merged commit 0c738b5 into rust-lang:master Aug 7, 2022
@nicholasbishop nicholasbishop deleted the bishop-uefi-unadjusted-win64-4 branch August 7, 2022 14:40
@nicholasbishop
Copy link
Contributor Author

Thanks for checking on that and connecting it to soft-float :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants