[PATCH] D23834: [AArch64] Allow label arithmetic with add/sub/cmp

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 05:47:36 PDT 2016


rovka created this revision.
rovka added reviewers: t.p.northover, compnerd, aadg, olista01.
rovka added subscribers: llvm-commits, rengolin, psmith.
Herald added a subscriber: aemerson.

Allow instructions such as 'cmp w0, #(end - start)'. For ELF, we just fold the
expression into a constant. For MachO, we fold if the expression contains only
symbols that are not linker visible, and we generate ARM64_RELOC_SUBTRACTOR and
ARM64_RELOC_UNSIGNED relocations otherwise (as we do for .byte directives).

Fixes https://llvm.org/bugs/show_bug.cgi?id=18920


https://reviews.llvm.org/D23834

Files:
  lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp
  test/MC/AArch64/basic-a64-diagnostics.s
  test/MC/AArch64/label-arithmetic-darwin.s
  test/MC/AArch64/label-arithmetic-diags-elf.s
  test/MC/AArch64/label-arithmetic-elf.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23834.69099.patch
Type: text/x-patch
Size: 11413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160824/6ace77f8/attachment.bin>


More information about the llvm-commits mailing list