"--emit asm" uses different syntax than `asm!` on x86
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Rust inline assembly expects to be written like this:
crate::arch::asm!(
"movntps [{mem_addr}], {a}",
mem_addr = in(reg) mem_addr,
a = in(xmm_reg) a,
);
However, when dumping the output assembly via --emit asm, it looks like this:
movntps %xmm0, (%rdi)
Operand order is swapped, and it's using (%name) instead of [name]. I guess one is AT&T syntax and one is Intel syntax.
Would be good if Rust could be consistent with its own inline asm syntax. :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown x86 inline assembly and --emit asm output, then inspect the compiler path that emits assembly syntax. Compare the operand order and memory-operand notation with the inline asm syntax; done means the emitted assembly is consistent with the syntax accepted by asm!.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100