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