aboutsummaryrefslogtreecommitdiff
path: root/riscv
diff options
context:
space:
mode:
authorChih-Min Chao <chihmin.chao@sifive.com>2020-02-26 23:06:41 -0800
committerChih-Min Chao <chihmin.chao@sifive.com>2020-03-11 21:51:32 -0700
commit9352ff175ccfeb4c749cc4aa20bd7a4f12b71920 (patch)
tree5c6d6df2db7d387583545914d9876300fb3c7544 /riscv
parent5f00d0784db3142064ecb35c50ecaefb0e8b2e41 (diff)
downloadspike-9352ff175ccfeb4c749cc4aa20bd7a4f12b71920.zip
spike-9352ff175ccfeb4c749cc4aa20bd7a4f12b71920.tar.gz
spike-9352ff175ccfeb4c749cc4aa20bd7a4f12b71920.tar.bz2
rvv: respect vstart and vl for vfmv.s.f
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv')
-rw-r--r--riscv/insns/vfmv_f_s.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/riscv/insns/vfmv_f_s.h b/riscv/insns/vfmv_f_s.h
index dbfe8f9..1e42ef0 100644
--- a/riscv/insns/vfmv_f_s.h
+++ b/riscv/insns/vfmv_f_s.h
@@ -4,25 +4,28 @@ require_fp;
require_extension('F');
require(P.VU.vsew == e32 || P.VU.vsew == e64);
-reg_t rs2_num = insn.rs2();
-uint64_t vs2_0 = 0;
-const reg_t sew = P.VU.vsew;
-switch(sew) {
-case e32:
- vs2_0 = P.VU.elt<uint32_t>(rs2_num, 0);
- break;
-default:
- vs2_0 = P.VU.elt<uint64_t>(rs2_num, 0);
- break;
-}
+if (P.VU.vstart < P.VU.vl && P.VU.vl > 0) {
+ reg_t rs2_num = insn.rs2();
+ uint64_t vs2_0 = 0;
+ const reg_t sew = P.VU.vsew;
+ switch(sew) {
+ case e32:
+ vs2_0 = P.VU.elt<uint32_t>(rs2_num, 0);
+ break;
+ default:
+ vs2_0 = P.VU.elt<uint64_t>(rs2_num, 0);
+ break;
+ }
-// nan_extened
-if (FLEN > sew) {
- vs2_0 = vs2_0 | ~((uint64_t(1) << sew) - 1);
-}
+ // nan_extened
+ if (FLEN > sew) {
+ vs2_0 = vs2_0 | ~((uint64_t(1) << sew) - 1);
+ }
-if (FLEN == 64) {
- WRITE_FRD(f64(vs2_0));
-} else {
- WRITE_FRD(f32(vs2_0));
+ if (FLEN == 64) {
+ WRITE_FRD(f64(vs2_0));
+ } else {
+ WRITE_FRD(f32(vs2_0));
+ }
}
+P.VU.vstart = 0;