Skip to content

Commit

Permalink
Co Pro RISC-V: Fix CSR immediate disassembly bug
Browse files Browse the repository at this point in the history
Change-Id: I279eb103d8692f1af6cfc07d5351fbf5238c1ca8
  • Loading branch information
hoglet67 committed Sep 19, 2023
1 parent 78e06a6 commit 4094004
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/riscv/riscv_disas.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,6 @@ const char *op2(int fmt, const union encoding *e, uint32_t pc) {
return reg_name[e->rs2];
case I:
i = e->i.i11_0;
if (i & 0x800) {
i -= 0x1000;
}
if (e->opcode == 0x73 && (e->funct3 & 3)) {
// CSR
switch (i) {
Expand Down Expand Up @@ -323,6 +320,9 @@ const char *op2(int fmt, const union encoding *e, uint32_t pc) {
}
sprintf(imm, "0x%03x", i);
} else {
if (i & 0x800) {
i -= 0x1000;
}
sprintf(imm, "%d", i);
}
return imm;
Expand Down

0 comments on commit 4094004

Please sign in to comment.