-
Couldn't load subscription status.
- Fork 13.9k
Closed
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.F-asm`#![feature(asm)]` (not `llvm_asm`)`#![feature(asm)]` (not `llvm_asm`)T-langRelevant to the language teamRelevant to the language team
Description
To simplify the implementation of macros wrapping asm!, I think options should work if specified multiple times, with the semantic that no conflicting options may be provided. (We could also do "last option wins", but I think I'd slightly prefer "don't specify conflicting options" instead.)
This would, for instance, make it much easier to implement an asm_att! macro that passes all its arguments to asm! and adds options(att_syntax), without having to scan all the tokens it receives, look for an existing options, and append to it if found.
Sample code that I think should work (printing 9):
#![feature(asm)]
fn main() {
let mut i: u32 = 5;
unsafe {
asm!(
"add $4, %rax",
inout("rax") i,
options(att_syntax),
options(nostack),
);
}
println!("{}", i);
}Aaron1011
Metadata
Metadata
Assignees
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.F-asm`#![feature(asm)]` (not `llvm_asm`)`#![feature(asm)]` (not `llvm_asm`)T-langRelevant to the language teamRelevant to the language team