Add note about x86 instruction prefixes in asm! to unstable book#90533
Merged
bors merged 2 commits intorust-lang:masterfrom Nov 5, 2021
Merged
Add note about x86 instruction prefixes in asm! to unstable book#90533bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly.
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
Member
|
r? @Amanieu |
joshtriplett
reviewed
Nov 4, 2021
Member
|
Made one suggestion to further clarify this. r=me with that applied. Also, thank you for qualifying this as "that would apply to instructions generated by the compiler". There are valid reasons to have a prefix separated from an instruction for other purposes, such as for patching instructions. Separately from this PR, would you please submit a report to upstream LLVM, requesting that its assembler catch trailing instruction prefixes like this? |
Co-authored-by: Josh Triplett <[email protected]>
Member
|
@bors r=joshtriplett |
Collaborator
|
📌 Commit 773cc4f has been approved by |
Contributor
Author
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 4, 2021
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 4, 2021
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 4, 2021
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 5, 2021
Rollup of 9 pull requests Successful merges: - rust-lang#90507 (Suggest `extern crate alloc` when using undeclared module `alloc`) - rust-lang#90530 (Simplify js tester a bit) - rust-lang#90533 (Add note about x86 instruction prefixes in asm! to unstable book) - rust-lang#90537 (Update aarch64 `target_feature` list for LLVM 12.) - rust-lang#90544 (Demote metadata load warning to "info".) - rust-lang#90554 (Clean up some `-Z unstable-options` in tests.) - rust-lang#90556 (Add more text and examples to `carrying_{add|mul}`) - rust-lang#90563 (rustbot allow labels) - rust-lang#90571 (Fix missing bottom border for headings in sidebar) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes #82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.