-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix asm goto with outputs and move it to a separate feature gate #131523
Conversation
☔ The latest upstream changes (presumably #132027) made this pull request unmergeable. Please resolve the merge conflicts. |
r? compiler-errors I'll review this, please ping me if I don't get to it in a few days |
☔ The latest upstream changes (presumably #132470) made this pull request unmergeable. Please resolve the merge conflicts. |
ping @compiler-errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit then r=me
let mut _out: u64; | ||
unsafe { | ||
asm!("mov {}, 1", "jmp {}", out(reg) _out, label {}); | ||
//~^ ERROR using both label and outputs operands for inline assembly is unstable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a typo? I think it should be "label and output operands"
@bors delegate+ |
✌️ @nbdd0121, you can now approve this pull request! If @compiler-errors told you to " |
You also may want to rebase this PR just in case |
When outputs are used together with labels, they are considered to be written for all destinations, not only when falling through.
When labels are present, the `noreturn` option really means that asm block won't fallthrough -- if labels are present, then outputs can still be meaningfully used.
@bors r+ |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#131523 (Fix asm goto with outputs and move it to a separate feature gate) - rust-lang#131664 (Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature)) - rust-lang#132432 (Add a test to verify that libstd doesn't use protected symbols) - rust-lang#132502 (Document possibility to set core features in example config.toml) - rust-lang#132529 (ci(triagebot): add more top-level files to A-meta) - rust-lang#132533 (Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime) - rust-lang#132803 (Fix broken url) - rust-lang#132982 (alloc: fix `Allocator` method names in `alloc` free function docs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131523 - nbdd0121:asm, r=compiler-errors Fix asm goto with outputs and move it to a separate feature gate Tracking issue: rust-lang#119364 This PR addresses 3 aspects of asm goto with outputs: * Codegen is fixed. My initial implementation has an oversight which cause the output to be only stored in fallthrough path, but not in label blocks. * Outputs can now be used with `options(noreturn)` if a label block is given. * All of this is moved to a new feature gate, because we likely want to stabilise `asm_goto` before asm goto with outputs. `@rustbot` labels: +A-inline-assembly +F-asm
Tracking issue: #119364
This PR addresses 3 aspects of asm goto with outputs:
options(noreturn)
if a label block is given.asm_goto
before asm goto with outputs.@rustbot labels: +A-inline-assembly +F-asm