diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-12-02 06:53:21 -0800 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-01-09 01:42:48 -0800 |
commit | 4ac95a8c99d19c4db3be648e88f853ddf4f66d53 (patch) | |
tree | b30659e4bf84b8d1b09b1a4bed6bda2bdc2dbd35 /riscv/insns/vfmv_s_f.h | |
parent | 4436424174070e0e84aa2fe1b1d1450771253f36 (diff) | |
download | spike-4ac95a8c99d19c4db3be648e88f853ddf4f66d53.zip spike-4ac95a8c99d19c4db3be648e88f853ddf4f66d53.tar.gz spike-4ac95a8c99d19c4db3be648e88f853ddf4f66d53.tar.bz2 |
rvv: refinve vfmv to support float64
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/insns/vfmv_s_f.h')
-rw-r--r-- | riscv/insns/vfmv_s_f.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/riscv/insns/vfmv_s_f.h b/riscv/insns/vfmv_s_f.h index 8ff6094..44e9e2e 100644 --- a/riscv/insns/vfmv_s_f.h +++ b/riscv/insns/vfmv_s_f.h @@ -1,19 +1,26 @@ // vfmv_s_f: vd[0] = rs1 (vs2=0) require_vector; -require(insn.v_vm() == 1); require_fp; require_extension('F'); -require(P.VU.vsew == e32); +require(P.VU.vsew >= e32 && P.VU.vsew <= 64); reg_t vl = P.VU.vl; if (vl > 0) { reg_t rd_num = insn.rd(); - reg_t sew = P.VU.vsew; - if (FLEN == 64) - P.VU.elt<uint32_t>(rd_num, 0) = f64(FRS1).v; - else - P.VU.elt<uint32_t>(rd_num, 0) = f32(FRS1).v; - - vl = 0; + switch(P.VU.vsew) { + case 32: + if (FLEN == 64) + P.VU.elt<uint32_t>(rd_num, 0) = f64(FRS1).v; + else + P.VU.elt<uint32_t>(rd_num, 0) = f32(FRS1).v; + break; + case 64: + if (FLEN == 64) + P.VU.elt<uint64_t>(rd_num, 0) = f64(FRS1).v; + else + P.VU.elt<uint64_t>(rd_num, 0) = f32(FRS1).v; + break; + } } +P.VU.vstart = 0; |