projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88a882c
)
add support for CSR_SVVL to CSRRWI as well
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sat, 29 Sep 2018 03:55:00 +0000
(
04:55
+0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sat, 29 Sep 2018 03:55:00 +0000
(
04:55
+0100)
riscv/insns/csrrwi.h
patch
|
blob
|
history
diff --git
a/riscv/insns/csrrwi.h
b/riscv/insns/csrrwi.h
index decadf412141076aec92ec58c4a9101e26456c06..8793d31fd98eaa28015990bae09337d6196c64bb 100644
(file)
--- a/
riscv/insns/csrrwi.h
+++ b/
riscv/insns/csrrwi.h
@@
-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();