aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/vfncvt_f_x_w.h
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2021-12-17 11:27:19 -0800
committerGitHub <noreply@github.com>2021-12-17 11:27:19 -0800
commit6751b49ac173676c927143d6822910ac2d06a548 (patch)
tree83ce944a0166b1a823efcdfcefc345e62125c8b9 /riscv/insns/vfncvt_f_x_w.h
parentf1a6fb9695cffcdea9d8219c14b288c33e046716 (diff)
parentf25933a48392d2141bf557fe16b3e3c56957b2d2 (diff)
downloadspike-6751b49ac173676c927143d6822910ac2d06a548.zip
spike-6751b49ac173676c927143d6822910ac2d06a548.tar.gz
spike-6751b49ac173676c927143d6822910ac2d06a548.tar.bz2
Merge pull request #881 from eopXD/simplify-float-convert
Simplify float convert instructions
Diffstat (limited to 'riscv/insns/vfncvt_f_x_w.h')
-rw-r--r--riscv/insns/vfncvt_f_x_w.h31
1 files changed, 9 insertions, 22 deletions
diff --git a/riscv/insns/vfncvt_f_x_w.h b/riscv/insns/vfncvt_f_x_w.h
index 10a6f7b..d587be2 100644
--- a/riscv/insns/vfncvt_f_x_w.h
+++ b/riscv/insns/vfncvt_f_x_w.h
@@ -1,23 +1,10 @@
// vfncvt.f.x.v vd, vs2, vm
-VI_VFP_CVT_SCALE
-({
- ;
-},
-{
- auto vs2 = P.VU.elt<int32_t>(rs2_num, i);
- P.VU.elt<float16_t>(rd_num, i, true) = i32_to_f16(vs2);
-},
-{
- auto vs2 = P.VU.elt<int64_t>(rs2_num, i);
- P.VU.elt<float32_t>(rd_num, i, true) = i64_to_f32(vs2);
-},
-{
- ;
-},
-{
- require(p->extension_enabled(EXT_ZFH));
-},
-{
- require(p->extension_enabled('F'));
-},
-false, (P.VU.vsew >= 16))
+VI_VFP_NCVT_INT_TO_FP(
+ {;}, // BODY16
+ { vd = i32_to_f16(vs2); }, // BODY32
+ { vd = i64_to_f32(vs2); }, // BODY64
+ {;}, // CHECK16
+ { require_extension(EXT_ZFH); }, // CHECK32
+ { require_extension('F'); }, // CHECK64
+ int // sign
+)