projects
/
riscv-isa-sim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
AMOs should always return store faults, not load faults
[riscv-isa-sim.git]
/
riscv
/
insns
/
amoswap_w.h
diff --git
a/riscv/insns/amoswap_w.h
b/riscv/insns/amoswap_w.h
index 0764d59e598c423391a1c188056eeb0cef4477eb..0f78369c76eeccec56f4c7e3d48d3687245b2839 100644
(file)
--- a/
riscv/insns/amoswap_w.h
+++ b/
riscv/insns/amoswap_w.h
@@
-1,4
+1,2
@@
require_extension('A');
-reg_t v = MMU.load_int32(RS1);
-MMU.store_uint32(RS1, RS2);
-WRITE_RD(v);
+WRITE_RD(sext32(MMU.amo_uint32(RS1, [&](uint32_t lhs) { return RS2; })));