diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-09-25 02:06:08 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-11-11 19:02:34 -0800 |
commit | df85f7fbe4b82eccf594a0d0fb7b8f5e6150dea1 (patch) | |
tree | 37ba21d66bc7b0b5bb8bdf257171b263322e4afe /riscv/insns | |
parent | 3fc52f5989e498aeaad147b5b5591d63e27ca9a9 (diff) | |
download | spike-df85f7fbe4b82eccf594a0d0fb7b8f5e6150dea1.zip spike-df85f7fbe4b82eccf594a0d0fb7b8f5e6150dea1.tar.gz spike-df85f7fbe4b82eccf594a0d0fb7b8f5e6150dea1.tar.bz2 |
rvv: fix redsum/vmv for non-tail-zero case
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/insns')
-rw-r--r-- | riscv/insns/vfmv_s_f.h | 11 | ||||
-rw-r--r-- | riscv/insns/vmv_s_x.h | 32 |
2 files changed, 20 insertions, 23 deletions
diff --git a/riscv/insns/vfmv_s_f.h b/riscv/insns/vfmv_s_f.h index cb81008..a08282f 100644 --- a/riscv/insns/vfmv_s_f.h +++ b/riscv/insns/vfmv_s_f.h @@ -15,15 +15,10 @@ if (vl > 0) { else P.VU.elt<uint32_t>(rd_num, 0) = f32(FRS1).v; - const reg_t max_len = P.VU.VLEN / sew; - for (reg_t i = 1; i < max_len; ++i) { - switch(sew) { - case e32: + if (TAIL_ZEROING) { + const reg_t max_len = P.VU.VLEN / sew; + for (reg_t i = 1; i < max_len; ++i) { P.VU.elt<uint32_t>(rd_num, i) = 0; - break; - default: - require(false); - break; } } diff --git a/riscv/insns/vmv_s_x.h b/riscv/insns/vmv_s_x.h index 38b2697..f19fa61 100644 --- a/riscv/insns/vmv_s_x.h +++ b/riscv/insns/vmv_s_x.h @@ -24,21 +24,23 @@ if (vl > 0) { break; } - const reg_t max_len = P.VU.VLEN / sew; - for (reg_t i = 1; i < max_len; ++i) { - switch(sew) { - case e8: - P.VU.elt<uint8_t>(rd_num, i) = 0; - break; - case e16: - P.VU.elt<uint16_t>(rd_num, i) = 0; - break; - case e32: - P.VU.elt<uint32_t>(rd_num, i) = 0; - break; - default: - P.VU.elt<uint64_t>(rd_num, i) = 0; - break; + if (TAIL_ZEROING) { + const reg_t max_len = P.VU.VLEN / sew; + for (reg_t i = 1; i < max_len; ++i) { + switch(sew) { + case e8: + P.VU.elt<uint8_t>(rd_num, i) = 0; + break; + case e16: + P.VU.elt<uint16_t>(rd_num, i) = 0; + break; + case e32: + P.VU.elt<uint32_t>(rd_num, i) = 0; + break; + default: + P.VU.elt<uint64_t>(rd_num, i) = 0; + break; + } } } |