-
Notifications
You must be signed in to change notification settings - Fork 287
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
Remove late specifiers in __cpuid_count #1329
Conversation
r? @Amanieu (rust-highfive has picked a reviewer for you, use r? to override) |
I think the current code is correct without considering the LLVM bug. |
Yes, the existing code is correct. I would prefer to see this fixed in LLVM directly. |
Is it really correct? The LLVM Language Reference says (emphasis theirs):
And the |
Well, I wouldn't consider that sentence as normative (especially since it says "normally" which means this isn't always the case), given that LLVM wouldn't peek into the assembly. Logically the code is correct if the register assigned isn't ebx (if it is, then whether it's out or lateout doesn't really matter). I think the provided constraint is sufficient to prevent eax, ecx and edx to be assigned register to "ebx", modulo LLVM bugs. |
@Amanieu |
Fair enough. |
The
late
specifiers are useless in the case of__cpuid_count
, there are no opportunities for correct register reuse.Together with llvm/llvm-project#57550 it causes rust-lang/rust#101346. I strongly suggest checking use of
late
specifiers in other asm blocks as well.This PR also changes the
__cpuid_count
asm to Intel syntax for consistency with asm inhas_cpuid
.