csrs
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Oct 2018 22:24:25 +0000 (23:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Oct 2018 22:24:25 +0000 (23:24 +0100)
riscv/insns/csrrci.h
riscv/insns/csrrs.h
riscv/insns/csrrsi.h
riscv/insns/csrrw.h

index 4d83cc0617edd871ebb9ad823d86a4663c310ce9..35ac85fad1f5007c65437838722dcd40fd3795f8 100644 (file)
@@ -4,5 +4,5 @@ reg_t old = p->get_csr(csr);
 if (write) {
   p->set_csr(csr, old & ~(reg_t)insn.rs1());
 }
-WRITE_RD(sext_xlen(old));
+WRITE_RD(sext_xlen(sv_reg_t(old)));
 serialize();
index 4e8bde96379935755ef87b32903e5aadd81a5227..f3f1166049d4a5c2f11833817414b3e3c586dca3 100644 (file)
@@ -1,8 +1,8 @@
 bool write = insn.rs1() != 0;
 int csr = validate_csr(insn.csr(), write);
-reg_t old = p->get_csr(csr);
+sv_reg_t old = sv_reg_t(p->get_csr(csr));
 if (write) {
-  p->set_csr(csr, old | RS1);
+  p->set_csr(csr, rv_or(old, RS1));
 }
 WRITE_RD(sext_xlen(old));
 serialize();
index b673725b54d1cbc8eb0a4e27e4af7d6563eb45b6..a06526141abedb162fed6de96f2f8f06f8fbf181 100644 (file)
@@ -4,5 +4,5 @@ reg_t old = p->get_csr(csr);
 if (write) {
   p->set_csr(csr, old | insn.rs1());
 }
-WRITE_RD(sext_xlen(old));
+WRITE_RD(sext_xlen(sv_reg_t(old)));
 serialize();
index 7fb87e950ce2ad5cc3774db88b0502f85eaf5710..f7876bc8532b19e82cb4d5e389700a37ef5d8104 100644 (file)
@@ -14,5 +14,5 @@ if (csr == CSR_USVVL || csr == CSR_USVMVL)
 reg_t old = p->get_csr(csr);
 p->set_csr(csr, RS1);
 #endif
-WRITE_RD(sext_xlen(old));
+WRITE_RD(sext_xlen(sv_reg_t(old)));
 serialize();