diff options
author | Dave.Wen <dave.wen@sifive.com> | 2020-05-13 20:12:22 -0700 |
---|---|---|
committer | Dave.Wen <dave.wen@sifive.com> | 2020-05-13 20:12:22 -0700 |
commit | 6fe796c4443749169a224358c62a2068d679126d (patch) | |
tree | bc355a62e9de981cca7dfa06e71ee17573772829 /riscv/decode.h | |
parent | 170ff9c86f928479d75a08e4f72c2e7d7e5b34a0 (diff) | |
download | spike-6fe796c4443749169a224358c62a2068d679126d.zip spike-6fe796c4443749169a224358c62a2068d679126d.tar.gz spike-6fe796c4443749169a224358c62a2068d679126d.tar.bz2 |
rvv: fractional_lmul when lmul < 1
Diffstat (limited to 'riscv/decode.h')
-rw-r--r-- | riscv/decode.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/riscv/decode.h b/riscv/decode.h index 1bbc017..bf7d2ae 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -1532,11 +1532,11 @@ for (reg_t i = 0; i < P.VU.vlmax && P.VU.vl != 0; ++i) { \ #define VI_EEW(mew, width) \ int32_t base = mew? 128 : 8; \ - int32_t shf = width? width - 5 : 0; \ - P.VU.veew = base << (shf + 1); \ + int32_t shf = width? width - 4 : 0; \ + P.VU.veew = base << shf; \ P.VU.vemul = ((float)P.VU.veew/P.VU.vsew) * P.VU.vlmul; \ - assert((P.VU.veew/P.VU.vemul) == (P.VU.vsew/P.VU.vlmul)); \ - if (P.VU.vemul > 8 && P.VU.vemul < (1/8)) { \ + if ((P.VU.vemul > 8 && P.VU.vemul < (1/8)) || \ + ((P.VU.veew/P.VU.vemul) != (P.VU.vsew/P.VU.vlmul))) { \ throw trap_illegal_instruction(0); \ } |