@@ -2709,3 +2709,52 @@ static bool trans_vmv_s_x(DisasContext *s, arg_vmv_s_x *a)
2709
2709
}
2710
2710
return false;
2711
2711
}
2712
+
2713
+ /* Floating-Point Scalar Move Instructions */
2714
+ static bool trans_vfmv_f_s (DisasContext * s , arg_vfmv_f_s * a )
2715
+ {
2716
+ if (!s -> vill && has_ext (s , RVF ) &&
2717
+ (s -> mstatus_fs != 0 ) && (s -> sew != 0 )) {
2718
+ unsigned int len = 8 << s -> sew ;
2719
+
2720
+ vec_element_loadi (s , cpu_fpr [a -> rd ], a -> rs2 , 0 );
2721
+ if (len < 64 ) {
2722
+ tcg_gen_ori_i64 (cpu_fpr [a -> rd ], cpu_fpr [a -> rd ],
2723
+ MAKE_64BIT_MASK (len , 64 - len ));
2724
+ }
2725
+
2726
+ mark_fs_dirty (s );
2727
+ return true;
2728
+ }
2729
+ return false;
2730
+ }
2731
+
2732
+ /* vfmv.s.f vd, rs1 # vd[0] = rs1 (vs2=0) */
2733
+ static bool trans_vfmv_s_f (DisasContext * s , arg_vfmv_s_f * a )
2734
+ {
2735
+ if (!s -> vill && has_ext (s , RVF ) && (s -> sew != 0 )) {
2736
+ TCGv_i64 t1 ;
2737
+ /* The instructions ignore LMUL and vector register group. */
2738
+ uint32_t vlmax = s -> vlen >> 3 ;
2739
+
2740
+ /* if vl == 0, skip vector register write back */
2741
+ TCGLabel * over = gen_new_label ();
2742
+ tcg_gen_brcondi_tl (TCG_COND_EQ , cpu_vl , 0 , over );
2743
+
2744
+ /* zeroed all elements */
2745
+ tcg_gen_gvec_dup_imm (SEW64 , vreg_ofs (s , a -> rd ), vlmax , vlmax , 0 );
2746
+
2747
+ /* NaN-box f[rs1] as necessary for SEW */
2748
+ t1 = tcg_temp_new_i64 ();
2749
+ if (s -> sew == MO_64 && !has_ext (s , RVD )) {
2750
+ tcg_gen_ori_i64 (t1 , cpu_fpr [a -> rs1 ], MAKE_64BIT_MASK (32 , 32 ));
2751
+ } else {
2752
+ tcg_gen_mov_i64 (t1 , cpu_fpr [a -> rs1 ]);
2753
+ }
2754
+ vec_element_storei (s , a -> rd , 0 , t1 );
2755
+ tcg_temp_free_i64 (t1 );
2756
+ gen_set_label (over );
2757
+ return true;
2758
+ }
2759
+ return false;
2760
+ }
0 commit comments