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
/
amomin_w.h
diff --git
a/riscv/insns/amomin_w.h
b/riscv/insns/amomin_w.h
index 31a8df86dff8b11ce6c9f91c7a8873f1dcf93445..ee53faa0cd61cad91f5dfaa5d59faaf1cc368ea3 100644
(file)
--- a/
riscv/insns/amomin_w.h
+++ b/
riscv/insns/amomin_w.h
@@
-1,4
+1,2
@@
require_extension('A');
-int32_t v = MMU.load_int32(RS1);
-MMU.store_uint32(RS1, std::min(int32_t(RS2),v));
-WRITE_RD(v);
+WRITE_RD(sext32(MMU.amo_uint32(RS1, [&](int32_t lhs) { return std::min(lhs, int32_t(RS2)); })));