diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2020-11-10 22:05:11 -0800 |
---|---|---|
committer | Scott Johnson <scott.johnson@arilinc.com> | 2020-11-11 09:55:17 -0800 |
commit | e91092f21948ba2e77bfbc4629b82b6aa14d5ed6 (patch) | |
tree | 9e937722837a41c10d80ad612770350f4e0fd444 /riscv/mmu.h | |
parent | f019910e120874422220d3c5c6a9711cbf574bad (diff) | |
download | spike-e91092f21948ba2e77bfbc4629b82b6aa14d5ed6.zip spike-e91092f21948ba2e77bfbc4629b82b6aa14d5ed6.tar.gz spike-e91092f21948ba2e77bfbc4629b82b6aa14d5ed6.tar.bz2 |
Use new require_alignment flag to simplify AMO check
Diffstat (limited to 'riscv/mmu.h')
-rw-r--r-- | riscv/mmu.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h index f16aed4..9943aea 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -191,10 +191,8 @@ public: #define amo_func(type) \ template<typename op> \ type##_t amo_##type(reg_t addr, op f) { \ - if (addr & (sizeof(type##_t)-1)) \ - throw trap_store_address_misaligned(addr, 0, 0); \ try { \ - auto lhs = load_##type(addr, false); \ + auto lhs = load_##type(addr, true); \ store_##type(addr, f(lhs)); \ return lhs; \ } catch (trap_load_page_fault& t) { \ |