This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][PowerPC] Support R_PPC64_PCREL34
ClosedPublic

Authored by lkail on Jul 19 2023, 7:28 PM.

Details

Summary

PC-relative instructions are added in ISA-3.1 implemented by pwr10. This patch adds basic pc-relative relocation.

Diff Detail

Event Timeline

lkail created this revision.Jul 19 2023, 7:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 7:28 PM
lkail requested review of this revision.Jul 19 2023, 7:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 7:28 PM
lhames added inline comments.Jul 25 2023, 1:01 PM
llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
233–245

Could you add a comment to these?

It looks like they read/write 64-bits, masking out the high 32-bits iff little-endian?

lkail updated this revision to Diff 544178.Jul 25 2023, 7:24 PM

Add comment to explain how prefixed instruction is formed.

llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
233–245

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.

lhames accepted this revision.Aug 1 2023, 2:33 PM

LGTM. Thanks @lkail!

llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
233–245

Yep -- I misread the expression. The comment explains things nicely, thanks!

This revision is now accepted and ready to land.Aug 1 2023, 2:33 PM
This revision was automatically updated to reflect the committed changes.