[PATCH] D98916: [ARM] support symbolic expression as immediate in memory instructions

Jian Cai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 20:24:24 PDT 2021


jcai19 created this revision.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
jcai19 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently the ARM backend only accpets constant expressions as the
immediate operand in load and store instructions. This allows the
result of symbolic expressions to be used in memory instructions. For
example,

0:
.space 2048
strb r2, [r0, #(.-0b)]

would be assembled into the following instructions.

strb	r2, [r0, #2048]

This only adds support to ldr, ldrb, str, and strb to address the build
failure of Linux kernel for now, but should facility adding support to
similar instructions in the future if the need arises.

Link:
https://github.com/ClangBuiltLinux/linux/issues/1329


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98916

Files:
  llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h
  llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
  llvm/test/MC/ARM/arm-memory-instructions-immediate.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98916.331750.patch
Type: text/x-patch
Size: 34073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210319/4538eb46/attachment.bin>


More information about the llvm-commits mailing list