[PATCH] D65550: [AArch64] Do not emit '#' before immediates in inline asm

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 02:15:14 PDT 2019


peter.smith added reviewers: nickdesaulniers, t.p.northover, efriedma, ostannard.
peter.smith added a comment.

I think that this will need a wider review to make check if anyone is dependent on the '#'. My personal opinion is that this is a good change to make as it will make the 'I' constraint more generally useful, without it we may need a new constraint that doesn't add a '#':

- The # is optional for immediates.
- GNU assembler and Clang both fault # in an element index, correctly according to my reading of the Arm ARM.
- GCC does not output the # when expanding the 'I' constraint
  - A colleague mentioned that there may be other cases where a # might be problematic, such as ".byte %0" in a switched section.

Some references:
https://static.docs.arm.com/ddi0487/ea/DDI0487E_a_armv8_arm.pdf

  C1.2.1 General requirements
  ...
  The A64 assembly language does not require the # character to introduce constant immediate operands, but an assembler must allow immediate values introduced with or without the # character. Arm recommends that an A64 disassembler outputs a # before an immediate operand.

In the Arm ARM immediates are described as #<imm> with the # character in the assembly language description, the element index is described differently without the #, for example: <Vm>.<Ts>[<index>].


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65550/new/

https://reviews.llvm.org/D65550





More information about the llvm-commits mailing list