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

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 06:40:26 PDT 2021


peter.smith added a comment.

The fixup code looks reasonable to me as it is mostly reusing the same logic as the pc-relative fixup. The names are internal to LLVM so there isn't any particular standard. I think this fixup would correspond to the relocation R_ARM_ABS12 https://github.com/ARM-software/abi-aa/blob/master/aaelf32/aaelf32.rst#relocation-codes so it may be worth using fixup_arm_ldst_abs_12 but that is only a suggestion. I wouldn't expect the assembler to use the relocation as the range is so short that any attempt to use it would likely result in an out of range error.



================
Comment at: llvm/test/MC/ARM/arm-memory-instructions-immediate.s:11
+foo:
+    ldr r0, [r1, #(1b - 0b)]
+// CHECK-NEXT: ldr r0, [r1, #1024]
----------------
Could we add some test cases for negative and zero offsets. It looks like this is handled in the fixup code but it would be good to have some tests to make sure it isn't broken in the future.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98916



More information about the llvm-commits mailing list