Skip to content

Commit

Permalink
[RV64_DYNAREC] Fixed lui/auipc immediate in the printer (#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
xctan authored Jan 28, 2025
1 parent 3ab5699 commit 4892c68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dynarec/rv64/rv64_printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ const char* rv64_print(uint32_t opcode, uintptr_t addr)
if ((opcode & 0x7f) == 0x17) {
a.rd = FX(opcode, 11, 7);
a.imm = FX(opcode, 31, 12);
snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "AUIPC", gpr[a.rd], SIGN_EXTEND(a.imm, 20), SIGN_EXTEND(a.imm, 20));
snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "AUIPC", gpr[a.rd], a.imm << 12, a.imm << 12);
return buff;
}

Expand Down Expand Up @@ -2233,7 +2233,7 @@ const char* rv64_print(uint32_t opcode, uintptr_t addr)
if ((opcode & 0x7f) == 0x37) {
a.rd = FX(opcode, 11, 7);
a.imm = FX(opcode, 31, 12);
snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "LUI", gpr[a.rd], SIGN_EXTEND(a.imm, 20), SIGN_EXTEND(a.imm, 20));
snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "LUI", gpr[a.rd], a.imm << 12, a.imm << 12);
return buff;
}

Expand Down

0 comments on commit 4892c68

Please sign in to comment.