arch-riscv: This commit fixes bug in vfmv.f.s impl. in riscv (#863)

The existing implementation of vfmv instruction did not type cast the
first element of the source vector, which caused the "freg" to interpret
the result as a NaN.

With the type cast to f32, the value is correctly recognized as float
and sign extended to be stored in the fd register.

Git issue: https://github.com/gem5/gem5/issues/827

Change-Id: Ibe9873910827594c0ec11cb51ac0438428c3b54e

---------

Co-authored-by: Debjyoti B <bhatta53@imec.be>
Co-authored-by: Tommaso Marinelli <tommarin@ucm.es>
This commit is contained in:
Debjyoti Bhattacharjee
2024-03-29 16:23:14 +01:00
committed by GitHub
parent 9207458fd7
commit ec690de0da

View File

@@ -3086,7 +3086,7 @@ decode QUADRANT default Unknown::unknown() {
// The encodings corresponding to the masked versions
// (vm=0) of vfmv.f.s are reserved
0x1: VectorNonSplitFormat::vfmv_f_s({{
freg_t fd = freg(Vs2_vu[0]);
freg_t fd = freg(ftype<et>(Vs2_vu[0]));
Fd_bits = fd.v;
}}, OPFVV, VectorMiscOp);
}