Stream: project-inline-asm

Topic: Supporting AT&T syntax on x86


Josh Triplett (Mar 06 2020 at 20:53, on Zulip):

@Amanieu I remembered one other reason I'd really like optional support for AT&T syntax on x86: with such support available, it wouldn't be that hard to automatically translate llvm_asm! to the new asm!.

Josh Triplett (Mar 06 2020 at 20:54, on Zulip):

Having an asm_att! available or similar (or alternatively an asm_intel! for Intel syntax) would make it relatively easy to port. (And, for that matter, easier to port C code as well.)

Josh Triplett (Mar 06 2020 at 20:56, on Zulip):

(I'm also increasingly debating if the default syntax on x86 should be AT&T for consistency with other targets and then we can have an asm_intel!, or if the default syntax on x86 should be Intel and we can have an asm_att!.)

Josh Triplett (Mar 06 2020 at 20:57, on Zulip):

Would it be excessively painful to plumb through an option for intelsyntax?

Amanieu (Mar 06 2020 at 22:02, on Zulip):

@Josh Triplett I've actually addressed that in the RFC: you can implement AT&T syntax on top asm! by using .att_syntax and adding % before register template placeholders.

Josh Triplett (Mar 06 2020 at 22:13, on Zulip):

.intel_syntax noprefix still allows prefixes. Would you consider just unconditionally using the prefixes in substitution?

Amanieu (Mar 06 2020 at 22:23, on Zulip):

No, .intel_syntax noprefix does not actually allow prefixes. I tested this.

Josh Triplett (Mar 07 2020 at 04:08, on Zulip):

I've written code relying on that in assembly. Perhaps LLVM's assembler just doesn't support it?

Amanieu (Mar 07 2020 at 20:17, on Zulip):

https://godbolt.org/z/DML3HV

Amanieu (Mar 07 2020 at 20:17, on Zulip):

Maybe you only used .intel_syntax instead of .intel_syntax noprefix

Last update: Jul 02 2020 at 19:45UTC