We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c463d96 commit 8726cf4Copy full SHA for 8726cf4
include/insns/Zicsr.h
@@ -52,13 +52,10 @@ class Zicsr : public RevExt {
52
if( Inst.rd != 0 )
53
R->SetX( Inst.rd, old );
54
55
- // Advance PC
56
- R->AdvancePC( Inst );
57
-
58
// Handle CSRRS/CSRRC
59
if( OP != CSROp::Write ) {
60
if( Inst.rs1 == 0 ) {
61
- return true; // If CSRRS/CSRRC rs1 == 0, do not modify CSR
+ goto end; // If CSRRS/CSRRC rs1 == 0, do not modify CSR
62
} else if( OP == CSROp::Set ) {
63
val = old | val;
64
} else {
@@ -72,6 +69,11 @@ class Zicsr : public RevExt {
72
69
73
70
// Write the new CSR value
74
71
R->SetCSR( Inst.imm, val );
+
+ end:
+ // Advance PC
75
+ R->AdvancePC( Inst );
76
77
return true;
78
}
79
0 commit comments