[PATCH] D155771: [JITLink][PowerPC] Support R_PPC64_PCREL34

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 14:33:52 PDT 2023


lhames accepted this revision.
lhames added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks @lkail!



================
Comment at: llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h:221-233
+template <support::endianness Endianness>
+inline static uint64_t readPrefixedInstruction(const char *Loc) {
+  constexpr bool isLE = Endianness == support::endianness::little;
+  uint64_t Inst = support::endian::read64<Endianness>(Loc);
+  return isLE ? (Inst << 32) | (Inst >> 32) : Inst;
+}
+
----------------
lkail wrote:
> lhames wrote:
> > Could you add a comment to these?
> > 
> > It looks like they read/write 64-bits, masking out the high 32-bits iff little-endian?
> When it's little-endian, swap the high 32 bits and the low 32 bits. I've added the comment, please let me know if it's still a puzzle.
Yep -- I misread the expression. The comment explains things nicely, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155771



More information about the llvm-commits mailing list