[PATCH] D55896: [MC] [AArch64] Support resolving fixups for :abs_g0: etc.

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 12:35:00 PST 2018


mgrang added a comment.

This doesn't seem to work if the label is defined before the use:

  .Lfoo = 0x12345678
  movz x0, #:abs_g1:.Lfoo
  movk x0, #:abs_g0_nc:.Lfoo
  
  error: immediate must be an integer in range [0, 65535].

In this case it considers the movz/movk operand as an immediate and it cannot apply the relocation specifier to an immediate.
It seems to match these rules in AArch64InstrInfo.td:

  def : InstAlias<"movz $dst, $imm", (MOVZXi GPR64:$dst, imm0_65535:$imm, 0)>;
  def : InstAlias<"movk $dst, $imm", (MOVKXi GPR64:$dst, imm0_65535:$imm, 0), 0>;

As opposed to these ones:

  def : InstAlias<"movz $Rd, $sym", (MOVZXi GPR64:$Rd, movz_symbol_g1:$sym, 16)>;
  def : InstAlias<"movk $Rd, $sym", (MOVKXi GPR64:$Rd, movk_symbol_g0:$sym, 0), 0>;


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55896





More information about the llvm-commits mailing list