-
Notifications
You must be signed in to change notification settings - Fork 13.4k
asm!
can't let you use lateout("rbx")
(LLVM needs it)
#90083
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
Comments
It's |
Isn't it still incorrect to call |
Here is a working example of code that does not clobber Additionally, I opted to use CPUID 0 because 4 is not supported on AMD processors whereas 0 should be universal to all x86 processors that implement CPUID. It's reasonable that users could copy this code, and it should report a more reasonable value for more users. |
I could make the pr to correct this if nobody has any issues with that change |
@asquared31415 Feel free to go ahead :) |
Using the updated code from rust-lang/rust#90083
The unstable book does not seem to contain this anymore, so perhaps this can be closed? |
Yes this has been solved in the docs. |
This is about an unstable feature, so maybe you don't consider that a regression, exactly. This seemed like the best bug template to me; I hope it's OK.
I'm reading the
asm!
document at https://doc.rust-lang.org/beta/unstable-book/library-features/asm.html. Thecpuid
example has this code:But when you press the Play button to try it out, you get:
I hacked it up locally (building with Rust Nightly), and this seems to work:
I.e. I comment out the
lateout("ebx")
line, and add a second macro invocation to get the value of ebx.But I assume there is a better way. :) The docs should be updated to show the better way. Thanks!
The text was updated successfully, but these errors were encountered: