[PATCH] D102575: [SPARC][MC] Support more relocation types

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 16 04:57:43 PDT 2021


jrtc27 added inline comments.


================
Comment at: llvm/test/MC/Sparc/sparc-relocations.s:74
+        ! CHECK-NEXT:                   ! fixup A - offset: 0, value: %lox(sym), kind: fixup_sparc_lox10
+        or %g1, %lox(sym), %g1
+
----------------
Although it technically doesn't matter for the test, we should use `xor` as that's what these relocations are to be used with.


================
Comment at: llvm/test/MC/Sparc/sparc-relocations.s:84
+
+        ! CHECK: ld [%l7+%l1], %l2, %gdop(sym) ! encoding: [0xe4,0x05,0xc0,0x11]
+        ! CHECK-NEXT:                          ! fixup A - offset: 0, value: %gdop(sym), kind: fixup_sparc_gotdata_op
----------------
jrtc27 wrote:
> Hm, if I understand correctly, this parses fine despite `ld` only taking one memory operand and one destination register because `TLS_LDrr` matches this case as we just have `def TLSSym : Operand<iPTR>;`. That should probably be cleaned up as part of this (possibly split out into a separate patch depending on the route you take).
Should probably also be `ldx` given this is 64-bit code, which leads me to conclude that we don't actually have the TableGen definitions for parsing 64-bit TLS `ldx` either, only 32-bit `ld` (ie `lduw`)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102575



More information about the llvm-commits mailing list