Fix asm goto with outputs and move it to a separate feature gate by nbdd0121 · Pull Request #131523 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation12 Commits3 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Tracking issue: #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
r? @TaKO8Ki
rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r?
to explicitly pick a reviewer
r? compiler-errors
I'll review this, please ping me if I don't get to it in a few days
ojeda mentioned this pull request
95 tasks
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 |
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"
✌️ @nbdd0121, you can now approve this pull request!
If @compiler-errors told you to "r=me
" after making some further change, please make that change, then do @bors r=@compiler-errors
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.
📌 Commit 0178ba2 has been approved by compiler-errors
It is now in the queue for this repository.
bors removed the S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
label
bors added the S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
bors added a commit to rust-lang-ci/rust that referenced this pull request
…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 inalloc
free function docs)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
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
Labels
Area: Inline assembly (`asm!(…)`)
`#![feature(asm)]` (not `llvm_asm`)
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.