diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-04-09 01:27:03 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-04-10 00:30:07 -0700 |
commit | 5086e5cb075ccbbf1eb931761c412e02e61567ff (patch) | |
tree | 34e46585a3986c73ecb87eb566d61c8f610694d7 /riscv | |
parent | e219277150687c391a1af3d6b6117b5c1813eaec (diff) | |
download | spike-5086e5cb075ccbbf1eb931761c412e02e61567ff.zip spike-5086e5cb075ccbbf1eb931761c412e02e61567ff.tar.gz spike-5086e5cb075ccbbf1eb931761c412e02e61567ff.tar.bz2 |
rvv: fix index segment load overlapping check
dst group can't overlap src group for segment case
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/decode.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/riscv/decode.h b/riscv/decode.h index 2c07973..91845c8 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -1480,11 +1480,11 @@ for (reg_t i = 0; i < vlmax && P.VU.vl != 0; ++i) { \ #define VI_ST_COMMON(stride, offset, st_width, elt_byte) \ const reg_t nf = insn.v_nf() + 1; \ - require((nf * P.VU.vlmul) <= (NVPR / 4)); \ const reg_t vl = P.VU.vl; \ const reg_t baseAddr = RS1; \ const reg_t vs3 = insn.rd(); \ - require(vs3 + nf * P.VU.vlmul <= NVPR); \ + require((nf * P.VU.vlmul) <= (NVPR / 4) && \ + vs3 + nf * P.VU.vlmul <= NVPR); \ const reg_t vlmul = P.VU.vlmul; \ for (reg_t i = 0; i < vl; ++i) { \ VI_STRIP(i) \ @@ -1512,11 +1512,11 @@ for (reg_t i = 0; i < vlmax && P.VU.vl != 0; ++i) { \ #define VI_LD_COMMON(stride, offset, ld_width, elt_byte) \ const reg_t nf = insn.v_nf() + 1; \ - require((nf * P.VU.vlmul) <= (NVPR / 4)); \ const reg_t vl = P.VU.vl; \ const reg_t baseAddr = RS1; \ const reg_t vd = insn.rd(); \ - require(vd + nf * P.VU.vlmul <= NVPR); \ + require((nf * P.VU.vlmul) <= (NVPR / 4) && \ + (vd + nf * P.VU.vlmul) <= NVPR); \ const reg_t vlmul = P.VU.vlmul; \ for (reg_t i = 0; i < vl; ++i) { \ VI_ELEMENT_SKIP(i); \ @@ -1547,7 +1547,9 @@ for (reg_t i = 0; i < vlmax && P.VU.vl != 0; ++i) { \ #define VI_LD_INDEX(stride, offset, ld_width, elt_byte) \ VI_CHECK_LD_INDEX; \ - VI_LD_COMMON(stride, offset, ld_width, elt_byte) + VI_LD_COMMON(stride, offset, ld_width, elt_byte) \ + if (nf >= 2) \ + require(!is_overlapped(vd, nf, insn.rs2(), 1)); #define VI_ST(stride, offset, st_width, elt_byte) \ VI_CHECK_STORE_SXX; \ |