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

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 19:24:55 PDT 2023


lkail added inline comments.


================
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;
+}
+
----------------
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.


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