[llvm] e7d432f - [JITLink][RISCV] Improve R_RISCV_JAL
Jonas Hahnfeld via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 08:19:37 PST 2023
Author: Jonas Hahnfeld
Date: 2023-01-03T17:18:39+01:00
New Revision: e7d432fd67c88d3c70be82ff0d424dd8993afb58
URL: https://github.com/llvm/llvm-project/commit/e7d432fd67c88d3c70be82ff0d424dd8993afb58
DIFF: https://github.com/llvm/llvm-project/commit/e7d432fd67c88d3c70be82ff0d424dd8993afb58.diff
LOG: [JITLink][RISCV] Improve R_RISCV_JAL
Only take the lower 12 bits of RawInstr.
Differential Revision: https://reviews.llvm.org/D140820
Added:
Modified:
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
index f60953f5278b..3fcc45eab255 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
@@ -224,7 +224,8 @@ class ELFJITLinker_riscv : public JITLinker<ELFJITLinker_riscv> {
uint32_t Imm11 = extractBits(Value, 11, 1) << 20;
uint32_t Imm19_12 = extractBits(Value, 12, 8) << 12;
uint32_t RawInstr = *(little32_t *)FixupPtr;
- *(little32_t *)FixupPtr = RawInstr | Imm20 | Imm10_1 | Imm11 | Imm19_12;
+ *(little32_t *)FixupPtr =
+ (RawInstr & 0xFFF) | Imm20 | Imm10_1 | Imm11 | Imm19_12;
break;
}
case R_RISCV_CALL: {
More information about the llvm-commits
mailing list