Fix the inline assembly examples#24842
Fix the inline assembly examples#24842bors merged 3 commits intorust-lang:masterfrom strega-nil:patch-3
Conversation
They now use the currently working syntax.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
|
@bors: r+ rollup |
|
📌 Commit a70b2ed has been approved by |
|
Thank you! |
|
⌛ Testing commit a70b2ed with merge c13dd9d... |
There was a problem hiding this comment.
I don't believe this is true, e.g. #24799 (comment) .
There was a problem hiding this comment.
It is, I have tried it both ways.
There was a problem hiding this comment.
Hm, well it's definitely not always required. E.g. to add to the example above, this also works (the not indicates that the correct register size is being used and it's not just, say, defaulting to eax in some way: the output is fffffffffffffffd):
#![feature(asm)]
fn main() {
let mut test: u64;
unsafe {
asm!("mov $$2, %rax
not %rax"
: "={ax}"(test));
}
println!("{:x}", test);
}What's the other way in your example? (al -> ax?)
There was a problem hiding this comment.
Oh, or maybe just {a}? It seems that {ax} always works (I see no difference in the asm between al and ax), but just a presumably means something different to LLVM.
There was a problem hiding this comment.
That must be it. Just {a} doesn't work right now.
|
💔 Test failed - auto-linux-64-nopt-t |
They now use the currently working syntax. Also, I added two examples.
They now use the currently working syntax.
Also, I added two examples.