This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][RISCV] Add R_RISCV_RVC_BRANCH and R_RISCV_RVC_JUMP
ClosedPublic

Authored by Hahnfeld on Jan 1 2023, 2:09 PM.

Details

Summary

These are the compressed equivalents of the relocations R_RISCV_BRANCH
and R_RISCV_JAL with slightly more complex immediate handling.

Diff Detail

Event Timeline

Hahnfeld created this revision.Jan 1 2023, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 1 2023, 2:09 PM
Hahnfeld requested review of this revision.Jan 1 2023, 2:09 PM
Hahnfeld added inline comments.Jan 1 2023, 2:14 PM
llvm/test/ExecutionEngine/JITLink/RISCV/ELF_rvc.s
20

I tried to use decode_operand as the other tests do, but it doesn't work - probably because we'd have to tell the disassembler to enable the compressed instructions. Not sure how to do this via llvm-jitlink... On the other hand, it was a nice exercise to compute the encoded instructions by hand :-)

StephenFan accepted this revision.Jan 3 2023, 5:28 AM

LGTM! Thanks!

This revision is now accepted and ready to land.Jan 3 2023, 5:28 AM