-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add note about x86 instruction prefixes in asm! to unstable book #90533
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.
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @Amanieu |
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]>
@bors r=joshtriplett |
📌 Commit 773cc4f has been approved by |
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.
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.
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.
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
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.