diff mbox series

[RFC,49/65] target/riscv: rvv-0.9: floating-point move instructions

Message ID 20200710104920.13550-50-frank.chang@sifive.com (mailing list archive)
State New, archived
Headers show
Series target/riscv: support vector extension v0.9 | expand

Commit Message

Frank Chang July 10, 2020, 10:49 a.m. UTC
From: Frank Chang <frank.chang@sifive.com>

Signed-off-by: Frank Chang <frank.chang@sifive.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 57 ++++++++++++-------------
 1 file changed, 28 insertions(+), 29 deletions(-)
diff mbox series

Patch

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index 986f62dabc..264cd6509f 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -2600,37 +2600,36 @@  GEN_OPFVF_TRANS(vfmerge_vfm,  opfvf_check)
 
 static bool trans_vfmv_v_f(DisasContext *s, arg_vfmv_v_f *a)
 {
-    if (vext_check_isa_ill(s) &&
-        vext_check_reg(s, a->rd, false) &&
-        (s->sew != 0)) {
+    REQUIRE_RVV;
+    VEXT_CHECK_ISA_ILL(s);
+    require_align(a->rd, s->flmul);
+    require(s->sew != 0);
 
-        if (s->vl_eq_vlmax) {
-            tcg_gen_gvec_dup_i64(s->sew, vreg_ofs(s, a->rd),
-                                 MAXSZ(s), MAXSZ(s), cpu_fpr[a->rs1]);
-        } else {
-            TCGv_ptr dest;
-            TCGv_i32 desc;
-            uint32_t data = FIELD_DP32(0, VDATA, LMUL, s->lmul);
-            static gen_helper_vmv_vx * const fns[3] = {
-                gen_helper_vmv_v_x_h,
-                gen_helper_vmv_v_x_w,
-                gen_helper_vmv_v_x_d,
-            };
-            TCGLabel *over = gen_new_label();
-            tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_vl, 0, over);
-
-            dest = tcg_temp_new_ptr();
-            desc = tcg_const_i32(simd_desc(0, s->vlen / 8, data));
-            tcg_gen_addi_ptr(dest, cpu_env, vreg_ofs(s, a->rd));
-            fns[s->sew - 1](dest, cpu_fpr[a->rs1], cpu_env, desc);
-
-            tcg_temp_free_ptr(dest);
-            tcg_temp_free_i32(desc);
-            gen_set_label(over);
-        }
-        return true;
+    if (s->vl_eq_vlmax) {
+        tcg_gen_gvec_dup_i64(s->sew, vreg_ofs(s, a->rd),
+                             MAXSZ(s), MAXSZ(s), cpu_fpr[a->rs1]);
+    } else {
+        TCGv_ptr dest;
+        TCGv_i32 desc;
+        uint32_t data = FIELD_DP32(0, VDATA, LMUL, s->lmul);
+        static gen_helper_vmv_vx * const fns[3] = {
+            gen_helper_vmv_v_x_h,
+            gen_helper_vmv_v_x_w,
+            gen_helper_vmv_v_x_d,
+        };
+        TCGLabel *over = gen_new_label();
+        tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_vl, 0, over);
+
+        dest = tcg_temp_new_ptr();
+        desc = tcg_const_i32(simd_desc(0, s->vlen / 8, data));
+        tcg_gen_addi_ptr(dest, cpu_env, vreg_ofs(s, a->rd));
+        fns[s->sew - 1](dest, cpu_fpr[a->rs1], cpu_env, desc);
+
+        tcg_temp_free_ptr(dest);
+        tcg_temp_free_i32(desc);
+        gen_set_label(over);
     }
-    return false;
+    return true;
 }
 
 /* Single-Width Floating-Point/Integer Type-Convert Instructions */