add support for CSR_SVVL to CSRRWI as well
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 29 Sep 2018 03:55:00 +0000 (04:55 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 29 Sep 2018 03:55:00 +0000 (04:55 +0100)
riscv/insns/csrrwi.h

index decadf412141076aec92ec58c4a9101e26456c06..8793d31fd98eaa28015990bae09337d6196c64bb 100644 (file)
@@ -1,5 +1,18 @@
 int csr = validate_csr(insn.csr(), true);
+#ifdef SPIKE_SIMPLEV
+reg_t old = 0; // stop compiler bitchin
+if (csr != CSR_SVVL)
+{
+    old = p->get_csr(csr);
+}
+p->set_csr(csr, insn.rs1());
+if (csr == CSR_SVVL)
+{
+    old = p->get_csr(csr);
+}
+#else
 reg_t old = p->get_csr(csr);
 p->set_csr(csr, insn.rs1());
+#endif
 WRITE_RD(sext_xlen(old));
 serialize();