diff options
| author | xctan <xctan@cirno.icu> | 2025-01-28 15:07:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-28 08:07:42 +0100 |
| commit | 4892c68f17dc23800e7afc03e9a44e2374232857 (patch) | |
| tree | a803493ba3e7c17a53d7581309605b23fb898a9a /src | |
| parent | 3ab56994daab4d193e3f7bdc70c514a0c876f07b (diff) | |
| download | box64-4892c68f17dc23800e7afc03e9a44e2374232857.tar.gz box64-4892c68f17dc23800e7afc03e9a44e2374232857.zip | |
[RV64_DYNAREC] Fixed lui/auipc immediate in the printer (#2299)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dynarec/rv64/rv64_printer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dynarec/rv64/rv64_printer.c b/src/dynarec/rv64/rv64_printer.c index a98a0cbb..f20d1026 100644 --- a/src/dynarec/rv64/rv64_printer.c +++ b/src/dynarec/rv64/rv64_printer.c @@ -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; } @@ -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; } |