Skip to content

Commit a593b23

Browse files
authored
Merge pull request #338 from visitorckw/fix-csrrc
Fix csrrc instruction behavior when rs1 is 0
2 parents bc54c7f + de3b92b commit a593b23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rv32_template.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ RVOP(
992992
csrrc,
993993
{
994994
uint32_t tmp = csr_csrrc(
995-
rv, ir->imm, (ir->rs1 == rv_reg_zero) ? ~0U : rv->X[ir->rs1]);
995+
rv, ir->imm, (ir->rs1 == rv_reg_zero) ? 0U : rv->X[ir->rs1]);
996996
rv->X[ir->rd] = ir->rd ? tmp : rv->X[ir->rd];
997997
},
998998
GEN({

0 commit comments

Comments
 (0)