diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-05-20 22:20:07 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-05-21 00:25:32 -0700 |
commit | 7babb447e1c2b2bdd0506fd40c3b9498374cb866 (patch) | |
tree | bf0a4e2eb67c6470c5999cafef44ae47894c7b17 | |
parent | 4c97d0803ed02b793d07ab853f34ee0e0c29e8a2 (diff) | |
download | spike-7babb447e1c2b2bdd0506fd40c3b9498374cb866.zip spike-7babb447e1c2b2bdd0506fd40c3b9498374cb866.tar.gz spike-7babb447e1c2b2bdd0506fd40c3b9498374cb866.tar.bz2 |
rvv: fix atomic
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
-rw-r--r-- | riscv/decode.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/riscv/decode.h b/riscv/decode.h index d6cfa35..d679072 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -1709,13 +1709,19 @@ for (reg_t i = 0; i < P.VU.vlmax && P.VU.vl != 0; ++i) { \ #define VI_AMO(op, type, idx_type) \ require_vector; \ require_extension(EXT_ZVAMO); \ - VI_CHECK_SSS(false); \ + if (insn.v_wd()) \ + require_vm; \ + require_align(insn.rd(), P.VU.vflmul); \ + require(P.VU.vsew <= P.get_xlen() && P.VU.vsew >= 32); \ + require_align(insn.rd(), P.VU.vflmul); \ + P.VU.veew = idx_type; \ + P.VU.vemul = ((float)P.VU.veew / P.VU.vsew * P.VU.vflmul); \ + require(P.VU.vemul >= 0.125 && P.VU.vemul <= 8); \ + require_align(insn.rs2(), P.VU.vemul); \ VI_DUPLICATE_VREG(insn.rs2(), idx_type); \ const reg_t vl = P.VU.vl; \ const reg_t baseAddr = RS1; \ const reg_t vd = insn.rd(); \ - const reg_t rs2_num = insn.rs2(); \ - require(P.VU.vsew >= P.get_xlen() && P.VU.vsew <= P.get_xlen()); \ for (reg_t i = P.VU.vstart; i < vl; ++i) { \ VI_ELEMENT_SKIP(i); \ VI_STRIP(i); \ |