diff --git a/qemu/aarch64.h b/qemu/aarch64.h index 19eff986..79f72744 100644 --- a/qemu/aarch64.h +++ b/qemu/aarch64.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_aarch64 #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_aarch64 #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_aarch64 +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_aarch64 +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_aarch64 #define helper_power_down helper_power_down_aarch64 #define helper_pre_hvc helper_pre_hvc_aarch64 #define helper_pre_smc helper_pre_smc_aarch64 @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_aarch64 #define helper_set_cp_reg helper_set_cp_reg_aarch64 #define helper_set_cp_reg64 helper_set_cp_reg64_aarch64 -#define helper_set_neon_rmode helper_set_neon_rmode_aarch64 #define helper_set_r13_banked helper_set_r13_banked_aarch64 #define helper_set_rmode helper_set_rmode_aarch64 #define helper_set_user_reg helper_set_user_reg_aarch64 diff --git a/qemu/aarch64eb.h b/qemu/aarch64eb.h index 78eab736..d26c4e31 100644 --- a/qemu/aarch64eb.h +++ b/qemu/aarch64eb.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_aarch64eb #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_aarch64eb #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_aarch64eb +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_aarch64eb +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_aarch64eb #define helper_power_down helper_power_down_aarch64eb #define helper_pre_hvc helper_pre_hvc_aarch64eb #define helper_pre_smc helper_pre_smc_aarch64eb @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_aarch64eb #define helper_set_cp_reg helper_set_cp_reg_aarch64eb #define helper_set_cp_reg64 helper_set_cp_reg64_aarch64eb -#define helper_set_neon_rmode helper_set_neon_rmode_aarch64eb #define helper_set_r13_banked helper_set_r13_banked_aarch64eb #define helper_set_rmode helper_set_rmode_aarch64eb #define helper_set_user_reg helper_set_user_reg_aarch64eb diff --git a/qemu/arm.h b/qemu/arm.h index 01e01b35..3b858ce7 100644 --- a/qemu/arm.h +++ b/qemu/arm.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_arm #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_arm #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_arm +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_arm +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_arm #define helper_power_down helper_power_down_arm #define helper_pre_hvc helper_pre_hvc_arm #define helper_pre_smc helper_pre_smc_arm @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_arm #define helper_set_cp_reg helper_set_cp_reg_arm #define helper_set_cp_reg64 helper_set_cp_reg64_arm -#define helper_set_neon_rmode helper_set_neon_rmode_arm #define helper_set_r13_banked helper_set_r13_banked_arm #define helper_set_rmode helper_set_rmode_arm #define helper_set_user_reg helper_set_user_reg_arm diff --git a/qemu/armeb.h b/qemu/armeb.h index 663e4945..0e8eb744 100644 --- a/qemu/armeb.h +++ b/qemu/armeb.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_armeb #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_armeb #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_armeb +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_armeb +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_armeb #define helper_power_down helper_power_down_armeb #define helper_pre_hvc helper_pre_hvc_armeb #define helper_pre_smc helper_pre_smc_armeb @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_armeb #define helper_set_cp_reg helper_set_cp_reg_armeb #define helper_set_cp_reg64 helper_set_cp_reg64_armeb -#define helper_set_neon_rmode helper_set_neon_rmode_armeb #define helper_set_r13_banked helper_set_r13_banked_armeb #define helper_set_rmode helper_set_rmode_armeb #define helper_set_user_reg helper_set_user_reg_armeb diff --git a/qemu/header_gen.py b/qemu/header_gen.py index a9412d54..04a1717c 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -1854,6 +1854,8 @@ symbols = ( 'helper_gvec_vcvt_rm_us', 'helper_gvec_vcvt_rm_sh', 'helper_gvec_vcvt_rm_uh', + 'helper_gvec_vrint_rm_h', + 'helper_gvec_vrint_rm_s', 'helper_power_down', 'helper_pre_hvc', 'helper_pre_smc', @@ -1900,7 +1902,6 @@ symbols = ( 'helper_sel_flags', 'helper_set_cp_reg', 'helper_set_cp_reg64', - 'helper_set_neon_rmode', 'helper_set_r13_banked', 'helper_set_rmode', 'helper_set_user_reg', diff --git a/qemu/m68k.h b/qemu/m68k.h index b424f5af..db52d0aa 100644 --- a/qemu/m68k.h +++ b/qemu/m68k.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_m68k #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_m68k #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_m68k +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_m68k +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_m68k #define helper_power_down helper_power_down_m68k #define helper_pre_hvc helper_pre_hvc_m68k #define helper_pre_smc helper_pre_smc_m68k @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_m68k #define helper_set_cp_reg helper_set_cp_reg_m68k #define helper_set_cp_reg64 helper_set_cp_reg64_m68k -#define helper_set_neon_rmode helper_set_neon_rmode_m68k #define helper_set_r13_banked helper_set_r13_banked_m68k #define helper_set_rmode helper_set_rmode_m68k #define helper_set_user_reg helper_set_user_reg_m68k diff --git a/qemu/mips.h b/qemu/mips.h index 8706d454..0aa1b397 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_mips #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_mips #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_mips +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_mips +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_mips #define helper_power_down helper_power_down_mips #define helper_pre_hvc helper_pre_hvc_mips #define helper_pre_smc helper_pre_smc_mips @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_mips #define helper_set_cp_reg helper_set_cp_reg_mips #define helper_set_cp_reg64 helper_set_cp_reg64_mips -#define helper_set_neon_rmode helper_set_neon_rmode_mips #define helper_set_r13_banked helper_set_r13_banked_mips #define helper_set_rmode helper_set_rmode_mips #define helper_set_user_reg helper_set_user_reg_mips diff --git a/qemu/mips64.h b/qemu/mips64.h index 4ad3ca06..77794509 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_mips64 #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_mips64 #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_mips64 +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_mips64 +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_mips64 #define helper_power_down helper_power_down_mips64 #define helper_pre_hvc helper_pre_hvc_mips64 #define helper_pre_smc helper_pre_smc_mips64 @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_mips64 #define helper_set_cp_reg helper_set_cp_reg_mips64 #define helper_set_cp_reg64 helper_set_cp_reg64_mips64 -#define helper_set_neon_rmode helper_set_neon_rmode_mips64 #define helper_set_r13_banked helper_set_r13_banked_mips64 #define helper_set_rmode helper_set_rmode_mips64 #define helper_set_user_reg helper_set_user_reg_mips64 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index 283f5796..fdf05ba5 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_mips64el #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_mips64el #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_mips64el +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_mips64el +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_mips64el #define helper_power_down helper_power_down_mips64el #define helper_pre_hvc helper_pre_hvc_mips64el #define helper_pre_smc helper_pre_smc_mips64el @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_mips64el #define helper_set_cp_reg helper_set_cp_reg_mips64el #define helper_set_cp_reg64 helper_set_cp_reg64_mips64el -#define helper_set_neon_rmode helper_set_neon_rmode_mips64el #define helper_set_r13_banked helper_set_r13_banked_mips64el #define helper_set_rmode helper_set_rmode_mips64el #define helper_set_user_reg helper_set_user_reg_mips64el diff --git a/qemu/mipsel.h b/qemu/mipsel.h index 1b324aac..964851bf 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_mipsel #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_mipsel #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_mipsel +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_mipsel +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_mipsel #define helper_power_down helper_power_down_mipsel #define helper_pre_hvc helper_pre_hvc_mipsel #define helper_pre_smc helper_pre_smc_mipsel @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_mipsel #define helper_set_cp_reg helper_set_cp_reg_mipsel #define helper_set_cp_reg64 helper_set_cp_reg64_mipsel -#define helper_set_neon_rmode helper_set_neon_rmode_mipsel #define helper_set_r13_banked helper_set_r13_banked_mipsel #define helper_set_rmode helper_set_rmode_mipsel #define helper_set_user_reg helper_set_user_reg_mipsel diff --git a/qemu/powerpc.h b/qemu/powerpc.h index cf916403..257edd51 100644 --- a/qemu/powerpc.h +++ b/qemu/powerpc.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_powerpc #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_powerpc #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_powerpc +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_powerpc +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_powerpc #define helper_power_down helper_power_down_powerpc #define helper_pre_hvc helper_pre_hvc_powerpc #define helper_pre_smc helper_pre_smc_powerpc @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_powerpc #define helper_set_cp_reg helper_set_cp_reg_powerpc #define helper_set_cp_reg64 helper_set_cp_reg64_powerpc -#define helper_set_neon_rmode helper_set_neon_rmode_powerpc #define helper_set_r13_banked helper_set_r13_banked_powerpc #define helper_set_rmode helper_set_rmode_powerpc #define helper_set_user_reg helper_set_user_reg_powerpc diff --git a/qemu/riscv32.h b/qemu/riscv32.h index f55c1747..c9636579 100644 --- a/qemu/riscv32.h +++ b/qemu/riscv32.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_riscv32 #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_riscv32 #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_riscv32 +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_riscv32 +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_riscv32 #define helper_power_down helper_power_down_riscv32 #define helper_pre_hvc helper_pre_hvc_riscv32 #define helper_pre_smc helper_pre_smc_riscv32 @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_riscv32 #define helper_set_cp_reg helper_set_cp_reg_riscv32 #define helper_set_cp_reg64 helper_set_cp_reg64_riscv32 -#define helper_set_neon_rmode helper_set_neon_rmode_riscv32 #define helper_set_r13_banked helper_set_r13_banked_riscv32 #define helper_set_rmode helper_set_rmode_riscv32 #define helper_set_user_reg helper_set_user_reg_riscv32 diff --git a/qemu/riscv64.h b/qemu/riscv64.h index f210ccd6..7ff87883 100644 --- a/qemu/riscv64.h +++ b/qemu/riscv64.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_riscv64 #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_riscv64 #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_riscv64 +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_riscv64 +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_riscv64 #define helper_power_down helper_power_down_riscv64 #define helper_pre_hvc helper_pre_hvc_riscv64 #define helper_pre_smc helper_pre_smc_riscv64 @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_riscv64 #define helper_set_cp_reg helper_set_cp_reg_riscv64 #define helper_set_cp_reg64 helper_set_cp_reg64_riscv64 -#define helper_set_neon_rmode helper_set_neon_rmode_riscv64 #define helper_set_r13_banked helper_set_r13_banked_riscv64 #define helper_set_rmode helper_set_rmode_riscv64 #define helper_set_user_reg helper_set_user_reg_riscv64 diff --git a/qemu/sparc.h b/qemu/sparc.h index 5ea77b8a..02803b3c 100644 --- a/qemu/sparc.h +++ b/qemu/sparc.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_sparc #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_sparc #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_sparc +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_sparc +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_sparc #define helper_power_down helper_power_down_sparc #define helper_pre_hvc helper_pre_hvc_sparc #define helper_pre_smc helper_pre_smc_sparc @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_sparc #define helper_set_cp_reg helper_set_cp_reg_sparc #define helper_set_cp_reg64 helper_set_cp_reg64_sparc -#define helper_set_neon_rmode helper_set_neon_rmode_sparc #define helper_set_r13_banked helper_set_r13_banked_sparc #define helper_set_rmode helper_set_rmode_sparc #define helper_set_user_reg helper_set_user_reg_sparc diff --git a/qemu/sparc64.h b/qemu/sparc64.h index 08e57d74..e8ed1c21 100644 --- a/qemu/sparc64.h +++ b/qemu/sparc64.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_sparc64 #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_sparc64 #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_sparc64 +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_sparc64 +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_sparc64 #define helper_power_down helper_power_down_sparc64 #define helper_pre_hvc helper_pre_hvc_sparc64 #define helper_pre_smc helper_pre_smc_sparc64 @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_sparc64 #define helper_set_cp_reg helper_set_cp_reg_sparc64 #define helper_set_cp_reg64 helper_set_cp_reg64_sparc64 -#define helper_set_neon_rmode helper_set_neon_rmode_sparc64 #define helper_set_r13_banked helper_set_r13_banked_sparc64 #define helper_set_rmode helper_set_rmode_sparc64 #define helper_set_user_reg helper_set_user_reg_sparc64 diff --git a/qemu/target/arm/helper.h b/qemu/target/arm/helper.h index 179b6b35..f2feb71e 100644 --- a/qemu/target/arm/helper.h +++ b/qemu/target/arm/helper.h @@ -212,7 +212,6 @@ DEF_HELPER_3(vfp_sqtoh, f16, i64, i32, ptr) DEF_HELPER_3(vfp_uqtoh, f16, i64, i32, ptr) DEF_HELPER_FLAGS_2(set_rmode, TCG_CALL_NO_RWG, i32, i32, ptr) -DEF_HELPER_FLAGS_2(set_neon_rmode, TCG_CALL_NO_RWG, i32, i32, env) DEF_HELPER_FLAGS_3(vfp_fcvt_f16_to_f32, TCG_CALL_NO_RWG, f32, f16, ptr, i32) DEF_HELPER_FLAGS_3(vfp_fcvt_f32_to_f16, TCG_CALL_NO_RWG, f16, f32, ptr, i32) @@ -636,6 +635,9 @@ DEF_HELPER_FLAGS_4(gvec_vcvt_rm_us, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_uh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vrint_rm_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vrint_rm_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + DEF_HELPER_FLAGS_4(gvec_frecpe_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_frecpe_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_frecpe_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/qemu/target/arm/translate-neon.inc.c b/qemu/target/arm/translate-neon.inc.c index 77bf8d99..15dbc902 100644 --- a/qemu/target/arm/translate-neon.inc.c +++ b/qemu/target/arm/translate-neon.inc.c @@ -3817,68 +3817,6 @@ static bool trans_VRINTX(DisasContext *s, arg_2misc *a) return do_2misc_fp(s, a, gen_helper_rints_exact); } -static bool do_vrint(DisasContext *s, arg_2misc *a, int rmode) -{ - /* - * Handle a VRINT* operation by iterating 32 bits at a time, - * with a specified rounding mode in operation. - */ - int pass; - TCGv_ptr fpst; - TCGv_i32 tcg_rmode; - TCGContext *tcg_ctx = s->uc->tcg_ctx; - - if (!arm_dc_feature(s, ARM_FEATURE_NEON) || - !arm_dc_feature(s, ARM_FEATURE_V8)) { - return false; - } - - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && - ((a->vd | a->vm) & 0x10)) { - return false; - } - - if (a->size != 2) { - /* TODO: FP16 will be the size == 1 case */ - return false; - } - - if ((a->vd | a->vm) & a->q) { - return false; - } - - if (!vfp_access_check(s)) { - return true; - } - - fpst = fpstatus_ptr(tcg_ctx, FPST_STD); - tcg_rmode = tcg_const_i32(tcg_ctx, arm_rmode_to_sf(rmode)); - gen_helper_set_neon_rmode(tcg_ctx, tcg_rmode, tcg_rmode, tcg_ctx->cpu_env); - for (pass = 0; pass < (a->q ? 4 : 2); pass++) { - TCGv_i32 tmp = neon_load_reg(s, a->vm, pass); - gen_helper_rints(tcg_ctx, tmp, tmp, fpst); - neon_store_reg(s, a->vd, pass, tmp); - } - gen_helper_set_neon_rmode(tcg_ctx, tcg_rmode, tcg_rmode, tcg_ctx->cpu_env); - tcg_temp_free_i32(tcg_ctx, tcg_rmode); - tcg_temp_free_ptr(tcg_ctx, fpst); - - return true; -} - -#define DO_VRINT(INSN, RMODE) \ - static bool trans_##INSN(DisasContext *s, arg_2misc *a) \ - { \ - return do_vrint(s, a, RMODE); \ - } - -DO_VRINT(VRINTN, FPROUNDING_TIEEVEN) -DO_VRINT(VRINTA, FPROUNDING_TIEAWAY) -DO_VRINT(VRINTZ, FPROUNDING_ZERO) -DO_VRINT(VRINTM, FPROUNDING_NEGINF) -DO_VRINT(VRINTP, FPROUNDING_POSINF) - #define DO_VEC_RMODE(INSN, RMODE, OP) \ static void gen_##INSN(TCGContext *s, unsigned vece, uint32_t rd_ofs, \ uint32_t rm_ofs, \ @@ -3920,6 +3858,12 @@ DO_VEC_RMODE(VCVTPS, FPROUNDING_POSINF, vcvt_rm_s) DO_VEC_RMODE(VCVTMU, FPROUNDING_NEGINF, vcvt_rm_u) DO_VEC_RMODE(VCVTMS, FPROUNDING_NEGINF, vcvt_rm_s) +DO_VEC_RMODE(VRINTN, FPROUNDING_TIEEVEN, vrint_rm_) +DO_VEC_RMODE(VRINTA, FPROUNDING_TIEAWAY, vrint_rm_) +DO_VEC_RMODE(VRINTZ, FPROUNDING_ZERO, vrint_rm_) +DO_VEC_RMODE(VRINTM, FPROUNDING_NEGINF, vrint_rm_) +DO_VEC_RMODE(VRINTP, FPROUNDING_POSINF, vrint_rm_) + static bool trans_VSWP(DisasContext *s, arg_2misc *a) { TCGv_i64 rm, rd; diff --git a/qemu/target/arm/vec_helper.c b/qemu/target/arm/vec_helper.c index 489eabd5..d82a5db2 100644 --- a/qemu/target/arm/vec_helper.c +++ b/qemu/target/arm/vec_helper.c @@ -1892,3 +1892,24 @@ DO_VCVT_RMODE(gvec_vcvt_rm_sh, helper_vfp_toshh, uint16_t) DO_VCVT_RMODE(gvec_vcvt_rm_uh, helper_vfp_touhh, uint16_t) #undef DO_VCVT_RMODE + +#define DO_VRINT_RMODE(NAME, FUNC, TYPE) \ + void HELPER(NAME)(void *vd, void *vn, void *stat, uint32_t desc) \ + { \ + float_status *fpst = stat; \ + intptr_t i, oprsz = simd_oprsz(desc); \ + uint32_t rmode = simd_data(desc); \ + uint32_t prev_rmode = get_float_rounding_mode(fpst); \ + TYPE *d = vd, *n = vn; \ + set_float_rounding_mode(rmode, fpst); \ + for (i = 0; i < oprsz / sizeof(TYPE); i++) { \ + d[i] = FUNC(n[i], fpst); \ + } \ + set_float_rounding_mode(prev_rmode, fpst); \ + clear_tail(d, oprsz, simd_maxsz(desc)); \ + } + +DO_VRINT_RMODE(gvec_vrint_rm_h, helper_rinth, uint16_t) +DO_VRINT_RMODE(gvec_vrint_rm_s, helper_rints, uint32_t) + +#undef DO_VRINT_RMODE diff --git a/qemu/target/arm/vfp_helper.c b/qemu/target/arm/vfp_helper.c index 91c4a5e5..b0f60bb0 100644 --- a/qemu/target/arm/vfp_helper.c +++ b/qemu/target/arm/vfp_helper.c @@ -463,24 +463,6 @@ uint32_t HELPER(set_rmode)(uint32_t rmode, void *fpstp) return prev_rmode; } -/* - * Set the current fp rounding mode in the standard fp status and return - * the old one. This is for NEON instructions that need to change the - * rounding mode but wish to use the standard FPSCR values for everything - * else. Always set the rounding mode back to the correct value after - * modifying it. - * The argument is a softfloat float_round_ value. - */ -uint32_t HELPER(set_neon_rmode)(uint32_t rmode, CPUARMState *env) -{ - float_status *fp_status = &env->vfp.standard_fp_status; - - uint32_t prev_rmode = get_float_rounding_mode(fp_status); - set_float_rounding_mode(rmode, fp_status); - - return prev_rmode; -} - /* Half precision conversions. */ float32 HELPER(vfp_fcvt_f16_to_f32)(uint32_t a, void *fpstp, uint32_t ahp_mode) { diff --git a/qemu/x86_64.h b/qemu/x86_64.h index a0db8d6e..51feda6d 100644 --- a/qemu/x86_64.h +++ b/qemu/x86_64.h @@ -1848,6 +1848,8 @@ #define helper_gvec_vcvt_rm_us helper_gvec_vcvt_rm_us_x86_64 #define helper_gvec_vcvt_rm_sh helper_gvec_vcvt_rm_sh_x86_64 #define helper_gvec_vcvt_rm_uh helper_gvec_vcvt_rm_uh_x86_64 +#define helper_gvec_vrint_rm_h helper_gvec_vrint_rm_h_x86_64 +#define helper_gvec_vrint_rm_s helper_gvec_vrint_rm_s_x86_64 #define helper_power_down helper_power_down_x86_64 #define helper_pre_hvc helper_pre_hvc_x86_64 #define helper_pre_smc helper_pre_smc_x86_64 @@ -1894,7 +1896,6 @@ #define helper_sel_flags helper_sel_flags_x86_64 #define helper_set_cp_reg helper_set_cp_reg_x86_64 #define helper_set_cp_reg64 helper_set_cp_reg64_x86_64 -#define helper_set_neon_rmode helper_set_neon_rmode_x86_64 #define helper_set_r13_banked helper_set_r13_banked_x86_64 #define helper_set_rmode helper_set_rmode_x86_64 #define helper_set_user_reg helper_set_user_reg_x86_64