Skip to content

Commit

Permalink
Merge pull request sysprog21#10 from feathertw/fix_csrrwi_
Browse files Browse the repository at this point in the history
Fix csrrwi instruction behavior
  • Loading branch information
jserv authored Jan 6, 2022
2 parents fa38fc5 + 54061df commit 91232c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ static bool op_system(struct riscv_t *rv, uint32_t inst)
break;
}
case 5: { // CSRRWI
uint32_t tmp = csr_csrrc(rv, csr, rv->X[rs1]);
uint32_t tmp = csr_csrrw(rv, csr, rs1);
rv->X[rd] = rd ? tmp : rv->X[rd];
break;
}
Expand Down

0 comments on commit 91232c2

Please sign in to comment.