diff options
Diffstat (limited to 'riscv/insns/vfmv_s_f.h')
-rw-r--r-- | riscv/insns/vfmv_s_f.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/riscv/insns/vfmv_s_f.h b/riscv/insns/vfmv_s_f.h index 84c5a3f..d29e245 100644 --- a/riscv/insns/vfmv_s_f.h +++ b/riscv/insns/vfmv_s_f.h @@ -1,21 +1,29 @@ // vfmv_s_f: vd[0] = rs1 (vs2=0) require_vector; require_fp; -require_extension('F'); -require(P.VU.vsew >= e32 && P.VU.vsew <= 64); +require((P.VU.vsew == e16 && p->supports_extension(EXT_ZFH)) || + (P.VU.vsew == e32 && p->supports_extension('F')) || + (P.VU.vsew == e64 && p->supports_extension('D'))); + reg_t vl = P.VU.vl; if (vl > 0 && P.VU.vstart < vl) { reg_t rd_num = insn.rd(); switch(P.VU.vsew) { - case 32: + case e16: + if (FLEN == 64) + P.VU.elt<uint16_t>(rd_num, 0, true) = f64(FRS1).v; + else + P.VU.elt<uint16_t>(rd_num, 0, true) = f32(FRS1).v; + break; + case e32: if (FLEN == 64) P.VU.elt<uint32_t>(rd_num, 0, true) = f64(FRS1).v; else P.VU.elt<uint32_t>(rd_num, 0, true) = f32(FRS1).v; break; - case 64: + case e64: if (FLEN == 64) P.VU.elt<uint64_t>(rd_num, 0, true) = f64(FRS1).v; else |