csrrwi cut out extraneous get_csr
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 13 Nov 2018 15:53:27 +0000 (15:53 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 13 Nov 2018 15:53:27 +0000 (15:53 +0000)
riscv/insns/csrrwi.h

index 7e1c4f7bac937387fd7581d7b8d4e41fd1c49bcc..1fe1945eea87ec88c4d6640d7772f07aa56c0cb6 100644 (file)
@@ -15,8 +15,7 @@ if (csr == CSR_USVVL || csr == CSR_USVMVL)
     old = p->get_csr(csr);
 }
 #else
-reg_t old = p->get_csr(csr);
-p->set_csr(csr, insn.insn_t::rs1());
+reg_t old = p->set_csr(csr, insn.insn_t::rs1());
 #endif
 WRITE_RD(sext_xlen(sv_reg_t(old)));
 serialize();