diff options
Diffstat (limited to 'riscv/insns/amomin_w.h')
-rw-r--r-- | riscv/insns/amomin_w.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/riscv/insns/amomin_w.h b/riscv/insns/amomin_w.h index 31a8df8..ee53faa 100644 --- 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)); }))); |