[all-commits] [llvm/llvm-project] cfce5b: [ARM] support symbolic expression as immediate in ...

Jian Cai via All-commits all-commits at lists.llvm.org
Mon Apr 12 12:14:13 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cfce5b26a888cb979d65252275df1f977dc1e6c8
      https://github.com/llvm/llvm-project/commit/cfce5b26a888cb979d65252275df1f977dc1e6c8
  Author: Jian Cai <jiancai at google.com>
  Date:   2021-04-12 (Mon, 12 Apr 2021)

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

  Log Message:
  -----------
  [ARM] support symbolic expression as immediate in memory instructions

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 in arm mode to
address the build failure of Linux kernel for now, but should facilitate
adding support to similar instructions in the future if the need arises.

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

Reviewed By: peter.smith, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D98916




More information about the All-commits mailing list