[PATCH] D149443: [ARM] add Thumb-1 8-bit movs/adds relocations to LLVM

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 10:03:55 PDT 2023


john.brawn added a comment.

This is still missing a test that the correct relocations are emitted, and checking in ARMAsmParser::validateInstruction that expression is valid.



================
Comment at: llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp:498-505
+  case ARM::fixup_arm_thumb_upper_8_15:
+    return (Value & 0xff000000) >> 24;
+  case ARM::fixup_arm_thumb_upper_0_7:
+    return (Value & 0x00ff0000) >> 16;
+  case ARM::fixup_arm_thumb_lower_8_15:
+    return (Value & 0x0000ff00) >> 8;
+  case ARM::fixup_arm_thumb_lower_0_7:
----------------
The calculation here isn't correct when IsResolved is false. In that case we're calculating the addend for a relocation, and the value of that will be `Value&0xff` for all four of these fixups (movw/movt has similar behaviour). 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149443



More information about the llvm-commits mailing list