From 2d9abf7c0b366ac6c07aabc5d82938270094aab0 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sun, 28 Feb 2021 04:46:28 -0500 Subject: [PATCH] target/arm: Implement VFP fp16 for VABS, VNEG, VSQRT Implement VFP fp16 for VABS, VNEG and VSQRT. This is all the fp16 insns that use the DO_VFP_2OP macro, because there is no fp16 version of VMOV_reg. Notes: * the gen_helper_vfp_negh already exists as we needed to create it for the fp16 multiply-add insns * as usual we need to use the f16 version of the fp_status; this is only relevant for VSQRT Backports ce2d65a5d191380756cdac7a1fd1ba76bd1621cf --- qemu/aarch64.h | 2 ++ qemu/aarch64eb.h | 2 ++ qemu/arm.h | 2 ++ qemu/armeb.h | 2 ++ qemu/header_gen.py | 2 ++ qemu/m68k.h | 2 ++ qemu/mips.h | 2 ++ qemu/mips64.h | 2 ++ qemu/mips64el.h | 2 ++ qemu/mipsel.h | 2 ++ qemu/powerpc.h | 2 ++ qemu/riscv32.h | 2 ++ qemu/riscv64.h | 2 ++ qemu/sparc.h | 2 ++ qemu/sparc64.h | 2 ++ qemu/target/arm/helper.h | 2 ++ qemu/target/arm/translate-vfp.inc.c | 40 +++++++++++++++++++++++++++++ qemu/target/arm/vfp.decode | 3 +++ qemu/target/arm/vfp_helper.c | 10 ++++++++ qemu/x86_64.h | 2 ++ 20 files changed, 87 insertions(+) diff --git a/qemu/aarch64.h b/qemu/aarch64.h index 6a834979..6763c071 100644 --- a/qemu/aarch64.h +++ b/qemu/aarch64.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_aarch64 #define helper_v8m_stackcheck helper_v8m_stackcheck_aarch64 #define helper_vfp_absd helper_vfp_absd_aarch64 +#define helper_vfp_absh helper_vfp_absh_aarch64 #define helper_vfp_abss helper_vfp_abss_aarch64 #define helper_vfp_addd helper_vfp_addd_aarch64 #define helper_vfp_addh helper_vfp_addh_aarch64 @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_aarch64 #define helper_vfp_sltos helper_vfp_sltos_aarch64 #define helper_vfp_sqrtd helper_vfp_sqrtd_aarch64 +#define helper_vfp_sqrth helper_vfp_sqrth_aarch64 #define helper_vfp_sqrts helper_vfp_sqrts_aarch64 #define helper_vfp_sqtod helper_vfp_sqtod_aarch64 #define helper_vfp_sqtoh helper_vfp_sqtoh_aarch64 diff --git a/qemu/aarch64eb.h b/qemu/aarch64eb.h index c1ab3112..ba399547 100644 --- a/qemu/aarch64eb.h +++ b/qemu/aarch64eb.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_aarch64eb #define helper_v8m_stackcheck helper_v8m_stackcheck_aarch64eb #define helper_vfp_absd helper_vfp_absd_aarch64eb +#define helper_vfp_absh helper_vfp_absh_aarch64eb #define helper_vfp_abss helper_vfp_abss_aarch64eb #define helper_vfp_addd helper_vfp_addd_aarch64eb #define helper_vfp_addh helper_vfp_addh_aarch64eb @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_aarch64eb #define helper_vfp_sltos helper_vfp_sltos_aarch64eb #define helper_vfp_sqrtd helper_vfp_sqrtd_aarch64eb +#define helper_vfp_sqrth helper_vfp_sqrth_aarch64eb #define helper_vfp_sqrts helper_vfp_sqrts_aarch64eb #define helper_vfp_sqtod helper_vfp_sqtod_aarch64eb #define helper_vfp_sqtoh helper_vfp_sqtoh_aarch64eb diff --git a/qemu/arm.h b/qemu/arm.h index f16f9182..4f9f01d6 100644 --- a/qemu/arm.h +++ b/qemu/arm.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_arm #define helper_v8m_stackcheck helper_v8m_stackcheck_arm #define helper_vfp_absd helper_vfp_absd_arm +#define helper_vfp_absh helper_vfp_absh_arm #define helper_vfp_abss helper_vfp_abss_arm #define helper_vfp_addd helper_vfp_addd_arm #define helper_vfp_addh helper_vfp_addh_arm @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_arm #define helper_vfp_sltos helper_vfp_sltos_arm #define helper_vfp_sqrtd helper_vfp_sqrtd_arm +#define helper_vfp_sqrth helper_vfp_sqrth_arm #define helper_vfp_sqrts helper_vfp_sqrts_arm #define helper_vfp_sqtod helper_vfp_sqtod_arm #define helper_vfp_sqtoh helper_vfp_sqtoh_arm diff --git a/qemu/armeb.h b/qemu/armeb.h index e29c8bcd..27ce8604 100644 --- a/qemu/armeb.h +++ b/qemu/armeb.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_armeb #define helper_v8m_stackcheck helper_v8m_stackcheck_armeb #define helper_vfp_absd helper_vfp_absd_armeb +#define helper_vfp_absh helper_vfp_absh_armeb #define helper_vfp_abss helper_vfp_abss_armeb #define helper_vfp_addd helper_vfp_addd_armeb #define helper_vfp_addh helper_vfp_addh_armeb @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_armeb #define helper_vfp_sltos helper_vfp_sltos_armeb #define helper_vfp_sqrtd helper_vfp_sqrtd_armeb +#define helper_vfp_sqrth helper_vfp_sqrth_armeb #define helper_vfp_sqrts helper_vfp_sqrts_armeb #define helper_vfp_sqtod helper_vfp_sqtod_armeb #define helper_vfp_sqtoh helper_vfp_sqtoh_armeb diff --git a/qemu/header_gen.py b/qemu/header_gen.py index b36069fd..a98903c7 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -1892,6 +1892,7 @@ symbols = ( 'helper_v7m_vlstm', 'helper_v8m_stackcheck', 'helper_vfp_absd', + 'helper_vfp_absh', 'helper_vfp_abss', 'helper_vfp_addd', 'helper_vfp_addh', @@ -1943,6 +1944,7 @@ symbols = ( 'helper_vfp_sltoh', 'helper_vfp_sltos', 'helper_vfp_sqrtd', + 'helper_vfp_sqrth', 'helper_vfp_sqrts', 'helper_vfp_sqtod', 'helper_vfp_sqtoh', diff --git a/qemu/m68k.h b/qemu/m68k.h index d5f1b9a1..e07c4985 100644 --- a/qemu/m68k.h +++ b/qemu/m68k.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_m68k #define helper_v8m_stackcheck helper_v8m_stackcheck_m68k #define helper_vfp_absd helper_vfp_absd_m68k +#define helper_vfp_absh helper_vfp_absh_m68k #define helper_vfp_abss helper_vfp_abss_m68k #define helper_vfp_addd helper_vfp_addd_m68k #define helper_vfp_addh helper_vfp_addh_m68k @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_m68k #define helper_vfp_sltos helper_vfp_sltos_m68k #define helper_vfp_sqrtd helper_vfp_sqrtd_m68k +#define helper_vfp_sqrth helper_vfp_sqrth_m68k #define helper_vfp_sqrts helper_vfp_sqrts_m68k #define helper_vfp_sqtod helper_vfp_sqtod_m68k #define helper_vfp_sqtoh helper_vfp_sqtoh_m68k diff --git a/qemu/mips.h b/qemu/mips.h index 64bff2d6..f77f46ae 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_mips #define helper_v8m_stackcheck helper_v8m_stackcheck_mips #define helper_vfp_absd helper_vfp_absd_mips +#define helper_vfp_absh helper_vfp_absh_mips #define helper_vfp_abss helper_vfp_abss_mips #define helper_vfp_addd helper_vfp_addd_mips #define helper_vfp_addh helper_vfp_addh_mips @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_mips #define helper_vfp_sltos helper_vfp_sltos_mips #define helper_vfp_sqrtd helper_vfp_sqrtd_mips +#define helper_vfp_sqrth helper_vfp_sqrth_mips #define helper_vfp_sqrts helper_vfp_sqrts_mips #define helper_vfp_sqtod helper_vfp_sqtod_mips #define helper_vfp_sqtoh helper_vfp_sqtoh_mips diff --git a/qemu/mips64.h b/qemu/mips64.h index 75473620..124c2aee 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_mips64 #define helper_v8m_stackcheck helper_v8m_stackcheck_mips64 #define helper_vfp_absd helper_vfp_absd_mips64 +#define helper_vfp_absh helper_vfp_absh_mips64 #define helper_vfp_abss helper_vfp_abss_mips64 #define helper_vfp_addd helper_vfp_addd_mips64 #define helper_vfp_addh helper_vfp_addh_mips64 @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_mips64 #define helper_vfp_sltos helper_vfp_sltos_mips64 #define helper_vfp_sqrtd helper_vfp_sqrtd_mips64 +#define helper_vfp_sqrth helper_vfp_sqrth_mips64 #define helper_vfp_sqrts helper_vfp_sqrts_mips64 #define helper_vfp_sqtod helper_vfp_sqtod_mips64 #define helper_vfp_sqtoh helper_vfp_sqtoh_mips64 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index 19372167..c86d8898 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_mips64el #define helper_v8m_stackcheck helper_v8m_stackcheck_mips64el #define helper_vfp_absd helper_vfp_absd_mips64el +#define helper_vfp_absh helper_vfp_absh_mips64el #define helper_vfp_abss helper_vfp_abss_mips64el #define helper_vfp_addd helper_vfp_addd_mips64el #define helper_vfp_addh helper_vfp_addh_mips64el @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_mips64el #define helper_vfp_sltos helper_vfp_sltos_mips64el #define helper_vfp_sqrtd helper_vfp_sqrtd_mips64el +#define helper_vfp_sqrth helper_vfp_sqrth_mips64el #define helper_vfp_sqrts helper_vfp_sqrts_mips64el #define helper_vfp_sqtod helper_vfp_sqtod_mips64el #define helper_vfp_sqtoh helper_vfp_sqtoh_mips64el diff --git a/qemu/mipsel.h b/qemu/mipsel.h index 2576097d..0c51e1c3 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_mipsel #define helper_v8m_stackcheck helper_v8m_stackcheck_mipsel #define helper_vfp_absd helper_vfp_absd_mipsel +#define helper_vfp_absh helper_vfp_absh_mipsel #define helper_vfp_abss helper_vfp_abss_mipsel #define helper_vfp_addd helper_vfp_addd_mipsel #define helper_vfp_addh helper_vfp_addh_mipsel @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_mipsel #define helper_vfp_sltos helper_vfp_sltos_mipsel #define helper_vfp_sqrtd helper_vfp_sqrtd_mipsel +#define helper_vfp_sqrth helper_vfp_sqrth_mipsel #define helper_vfp_sqrts helper_vfp_sqrts_mipsel #define helper_vfp_sqtod helper_vfp_sqtod_mipsel #define helper_vfp_sqtoh helper_vfp_sqtoh_mipsel diff --git a/qemu/powerpc.h b/qemu/powerpc.h index 806e9f61..6362032d 100644 --- a/qemu/powerpc.h +++ b/qemu/powerpc.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_powerpc #define helper_v8m_stackcheck helper_v8m_stackcheck_powerpc #define helper_vfp_absd helper_vfp_absd_powerpc +#define helper_vfp_absh helper_vfp_absh_powerpc #define helper_vfp_abss helper_vfp_abss_powerpc #define helper_vfp_addd helper_vfp_addd_powerpc #define helper_vfp_addh helper_vfp_addh_powerpc @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_powerpc #define helper_vfp_sltos helper_vfp_sltos_powerpc #define helper_vfp_sqrtd helper_vfp_sqrtd_powerpc +#define helper_vfp_sqrth helper_vfp_sqrth_powerpc #define helper_vfp_sqrts helper_vfp_sqrts_powerpc #define helper_vfp_sqtod helper_vfp_sqtod_powerpc #define helper_vfp_sqtoh helper_vfp_sqtoh_powerpc diff --git a/qemu/riscv32.h b/qemu/riscv32.h index da04d4dc..043430bc 100644 --- a/qemu/riscv32.h +++ b/qemu/riscv32.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_riscv32 #define helper_v8m_stackcheck helper_v8m_stackcheck_riscv32 #define helper_vfp_absd helper_vfp_absd_riscv32 +#define helper_vfp_absh helper_vfp_absh_riscv32 #define helper_vfp_abss helper_vfp_abss_riscv32 #define helper_vfp_addd helper_vfp_addd_riscv32 #define helper_vfp_addh helper_vfp_addh_riscv32 @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_riscv32 #define helper_vfp_sltos helper_vfp_sltos_riscv32 #define helper_vfp_sqrtd helper_vfp_sqrtd_riscv32 +#define helper_vfp_sqrth helper_vfp_sqrth_riscv32 #define helper_vfp_sqrts helper_vfp_sqrts_riscv32 #define helper_vfp_sqtod helper_vfp_sqtod_riscv32 #define helper_vfp_sqtoh helper_vfp_sqtoh_riscv32 diff --git a/qemu/riscv64.h b/qemu/riscv64.h index 6aa66a9a..8acf06ab 100644 --- a/qemu/riscv64.h +++ b/qemu/riscv64.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_riscv64 #define helper_v8m_stackcheck helper_v8m_stackcheck_riscv64 #define helper_vfp_absd helper_vfp_absd_riscv64 +#define helper_vfp_absh helper_vfp_absh_riscv64 #define helper_vfp_abss helper_vfp_abss_riscv64 #define helper_vfp_addd helper_vfp_addd_riscv64 #define helper_vfp_addh helper_vfp_addh_riscv64 @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_riscv64 #define helper_vfp_sltos helper_vfp_sltos_riscv64 #define helper_vfp_sqrtd helper_vfp_sqrtd_riscv64 +#define helper_vfp_sqrth helper_vfp_sqrth_riscv64 #define helper_vfp_sqrts helper_vfp_sqrts_riscv64 #define helper_vfp_sqtod helper_vfp_sqtod_riscv64 #define helper_vfp_sqtoh helper_vfp_sqtoh_riscv64 diff --git a/qemu/sparc.h b/qemu/sparc.h index 6a83e059..f56607cb 100644 --- a/qemu/sparc.h +++ b/qemu/sparc.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_sparc #define helper_v8m_stackcheck helper_v8m_stackcheck_sparc #define helper_vfp_absd helper_vfp_absd_sparc +#define helper_vfp_absh helper_vfp_absh_sparc #define helper_vfp_abss helper_vfp_abss_sparc #define helper_vfp_addd helper_vfp_addd_sparc #define helper_vfp_addh helper_vfp_addh_sparc @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_sparc #define helper_vfp_sltos helper_vfp_sltos_sparc #define helper_vfp_sqrtd helper_vfp_sqrtd_sparc +#define helper_vfp_sqrth helper_vfp_sqrth_sparc #define helper_vfp_sqrts helper_vfp_sqrts_sparc #define helper_vfp_sqtod helper_vfp_sqtod_sparc #define helper_vfp_sqtoh helper_vfp_sqtoh_sparc diff --git a/qemu/sparc64.h b/qemu/sparc64.h index 736b83f1..cca8d433 100644 --- a/qemu/sparc64.h +++ b/qemu/sparc64.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_sparc64 #define helper_v8m_stackcheck helper_v8m_stackcheck_sparc64 #define helper_vfp_absd helper_vfp_absd_sparc64 +#define helper_vfp_absh helper_vfp_absh_sparc64 #define helper_vfp_abss helper_vfp_abss_sparc64 #define helper_vfp_addd helper_vfp_addd_sparc64 #define helper_vfp_addh helper_vfp_addh_sparc64 @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_sparc64 #define helper_vfp_sltos helper_vfp_sltos_sparc64 #define helper_vfp_sqrtd helper_vfp_sqrtd_sparc64 +#define helper_vfp_sqrth helper_vfp_sqrth_sparc64 #define helper_vfp_sqrts helper_vfp_sqrts_sparc64 #define helper_vfp_sqtod helper_vfp_sqtod_sparc64 #define helper_vfp_sqtoh helper_vfp_sqtoh_sparc64 diff --git a/qemu/target/arm/helper.h b/qemu/target/arm/helper.h index 3cfa0d7d..ded20856 100644 --- a/qemu/target/arm/helper.h +++ b/qemu/target/arm/helper.h @@ -126,8 +126,10 @@ DEF_HELPER_3(vfp_minnumd, f64, f64, f64, ptr) DEF_HELPER_1(vfp_negh, f16, f16) DEF_HELPER_1(vfp_negs, f32, f32) DEF_HELPER_1(vfp_negd, f64, f64) +DEF_HELPER_1(vfp_absh, f16, f16) DEF_HELPER_1(vfp_abss, f32, f32) DEF_HELPER_1(vfp_absd, f64, f64) +DEF_HELPER_2(vfp_sqrth, f16, f16, env) DEF_HELPER_2(vfp_sqrts, f32, f32, env) DEF_HELPER_2(vfp_sqrtd, f64, f64, env) DEF_HELPER_3(vfp_cmps, void, f32, f32, env) diff --git a/qemu/target/arm/translate-vfp.inc.c b/qemu/target/arm/translate-vfp.inc.c index f81d7e09..b601c291 100644 --- a/qemu/target/arm/translate-vfp.inc.c +++ b/qemu/target/arm/translate-vfp.inc.c @@ -1490,6 +1490,39 @@ static bool do_vfp_2op_sp(DisasContext *s, VFPGen2OpSPFn *fn, int vd, int vm) return true; } +static bool do_vfp_2op_hp(DisasContext *s, VFPGen2OpSPFn *fn, int vd, int vm) +{ + /* + * Do a half-precision operation. Functionally this is + * the same as do_vfp_2op_sp(), except: + * - it doesn't need the VFP vector handling (fp16 is a + * v8 feature, and in v8 VFP vectors don't exist) + * - it does the aa32_fp16_arith feature test + */ + TCGv_i32 f0; + TCGContext *tcg_ctx = s->uc->tcg_ctx; + + if (!dc_isar_feature(aa32_fp16_arith, s)) { + return false; + } + + if (s->vec_len != 0 || s->vec_stride != 0) { + return false; + } + + if (!vfp_access_check(s)) { + return true; + } + + f0 = tcg_temp_new_i32(tcg_ctx); + neon_load_reg32(s, f0, vm); + fn(tcg_ctx, f0, f0); + neon_store_reg32(s, f0, vd); + tcg_temp_free_i32(tcg_ctx, f0); + + return true; +} + static bool do_vfp_2op_dp(DisasContext *s, VFPGen2OpDPFn *fn, int vd, int vm) { TCGContext *tcg_ctx = s->uc->tcg_ctx; @@ -2272,12 +2305,18 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) DO_VFP_2OP(VMOV_reg, sp, tcg_gen_mov_i32) DO_VFP_2OP(VMOV_reg, dp, tcg_gen_mov_i64) +DO_VFP_2OP(VABS, hp, gen_helper_vfp_absh) DO_VFP_2OP(VABS, sp, gen_helper_vfp_abss) DO_VFP_2OP(VABS, dp, gen_helper_vfp_absd) +DO_VFP_2OP(VNEG, hp, gen_helper_vfp_negh) DO_VFP_2OP(VNEG, sp, gen_helper_vfp_negs) DO_VFP_2OP(VNEG, dp, gen_helper_vfp_negd) +static void gen_VSQRT_hp(TCGContext *tcg_ctx, TCGv_i32 vd, TCGv_i32 vm) +{ + gen_helper_vfp_sqrth(tcg_ctx, vd, vm, tcg_ctx->cpu_env); +} static void gen_VSQRT_sp(TCGContext *tcg_ctx, TCGv_i32 vd, TCGv_i32 vm) { @@ -2289,6 +2328,7 @@ static void gen_VSQRT_dp(TCGContext *tcg_ctx, TCGv_i64 vd, TCGv_i64 vm) gen_helper_vfp_sqrtd(tcg_ctx, vd, vm, tcg_ctx->cpu_env); } +DO_VFP_2OP(VSQRT, hp, gen_VSQRT_hp) DO_VFP_2OP(VSQRT, sp, gen_VSQRT_sp) DO_VFP_2OP(VSQRT, dp, gen_VSQRT_dp) diff --git a/qemu/target/arm/vfp.decode b/qemu/target/arm/vfp.decode index af4829e2..5c64701d 100644 --- a/qemu/target/arm/vfp.decode +++ b/qemu/target/arm/vfp.decode @@ -162,12 +162,15 @@ VMOV_imm_dp ---- 1110 1.11 .... .... 1011 0000 .... \ VMOV_reg_sp ---- 1110 1.11 0000 .... 1010 01.0 .... @vfp_dm_ss VMOV_reg_dp ---- 1110 1.11 0000 .... 1011 01.0 .... @vfp_dm_dd +VABS_hp ---- 1110 1.11 0000 .... 1001 11.0 .... @vfp_dm_ss VABS_sp ---- 1110 1.11 0000 .... 1010 11.0 .... @vfp_dm_ss VABS_dp ---- 1110 1.11 0000 .... 1011 11.0 .... @vfp_dm_dd +VNEG_hp ---- 1110 1.11 0001 .... 1001 01.0 .... @vfp_dm_ss VNEG_sp ---- 1110 1.11 0001 .... 1010 01.0 .... @vfp_dm_ss VNEG_dp ---- 1110 1.11 0001 .... 1011 01.0 .... @vfp_dm_dd +VSQRT_hp ---- 1110 1.11 0001 .... 1001 11.0 .... @vfp_dm_ss VSQRT_sp ---- 1110 1.11 0001 .... 1010 11.0 .... @vfp_dm_ss VSQRT_dp ---- 1110 1.11 0001 .... 1011 11.0 .... @vfp_dm_dd diff --git a/qemu/target/arm/vfp_helper.c b/qemu/target/arm/vfp_helper.c index be9ac188..fbe8185c 100644 --- a/qemu/target/arm/vfp_helper.c +++ b/qemu/target/arm/vfp_helper.c @@ -279,6 +279,11 @@ float64 VFP_HELPER(neg, d)(float64 a) return float64_chs(a); } +dh_ctype_f16 VFP_HELPER(abs, h)(dh_ctype_f16 a) +{ + return float16_abs(a); +} + float32 VFP_HELPER(abs, s)(float32 a) { return float32_abs(a); @@ -289,6 +294,11 @@ float64 VFP_HELPER(abs, d)(float64 a) return float64_abs(a); } +dh_ctype_f16 VFP_HELPER(sqrt, h)(dh_ctype_f16 a, CPUARMState *env) +{ + return float16_sqrt(a, &env->vfp.fp_status_f16); +} + float32 VFP_HELPER(sqrt, s)(float32 a, CPUARMState *env) { return float32_sqrt(a, &env->vfp.fp_status); diff --git a/qemu/x86_64.h b/qemu/x86_64.h index 6eb45dca..15fbf1e6 100644 --- a/qemu/x86_64.h +++ b/qemu/x86_64.h @@ -1886,6 +1886,7 @@ #define helper_v7m_vlstm helper_v7m_vlstm_x86_64 #define helper_v8m_stackcheck helper_v8m_stackcheck_x86_64 #define helper_vfp_absd helper_vfp_absd_x86_64 +#define helper_vfp_absh helper_vfp_absh_x86_64 #define helper_vfp_abss helper_vfp_abss_x86_64 #define helper_vfp_addd helper_vfp_addd_x86_64 #define helper_vfp_addh helper_vfp_addh_x86_64 @@ -1937,6 +1938,7 @@ #define helper_vfp_sltoh helper_vfp_sltoh_x86_64 #define helper_vfp_sltos helper_vfp_sltos_x86_64 #define helper_vfp_sqrtd helper_vfp_sqrtd_x86_64 +#define helper_vfp_sqrth helper_vfp_sqrth_x86_64 #define helper_vfp_sqrts helper_vfp_sqrts_x86_64 #define helper_vfp_sqtod helper_vfp_sqtod_x86_64 #define helper_vfp_sqtoh helper_vfp_sqtoh_x86_64