diff --git a/qemu/aarch64.h b/qemu/aarch64.h index 254c94e8..1d964a98 100644 --- a/qemu/aarch64.h +++ b/qemu/aarch64.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_aarch64 #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_aarch64 #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_aarch64 +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_aarch64 +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_aarch64 +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_aarch64 +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/aarch64eb.h b/qemu/aarch64eb.h index 71f495d8..5a1929e1 100644 --- a/qemu/aarch64eb.h +++ b/qemu/aarch64eb.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_aarch64eb #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_aarch64eb #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_aarch64eb +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_aarch64eb +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_aarch64eb +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_aarch64eb +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/arm.h b/qemu/arm.h index 2471b7ba..7b32f089 100644 --- a/qemu/arm.h +++ b/qemu/arm.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_arm #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_arm #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_arm +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_arm +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_arm +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_arm +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/armeb.h b/qemu/armeb.h index 6be6fb58..2eb31bc2 100644 --- a/qemu/armeb.h +++ b/qemu/armeb.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_armeb #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_armeb #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_armeb +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_armeb +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_armeb +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_armeb +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/header_gen.py b/qemu/header_gen.py index dd8cb5a9..cfec3f64 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -1846,6 +1846,10 @@ symbols = ( 'helper_gvec_vcvt_uf', 'helper_gvec_vcvt_fs', 'helper_gvec_vcvt_fu', + 'helper_gvec_vcvt_sh', + 'helper_gvec_vcvt_uh', + 'helper_gvec_vcvt_hs', + 'helper_gvec_vcvt_hu', 'helper_power_down', 'helper_pre_hvc', 'helper_pre_smc', diff --git a/qemu/m68k.h b/qemu/m68k.h index 27ca362d..20721a59 100644 --- a/qemu/m68k.h +++ b/qemu/m68k.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_m68k #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_m68k #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_m68k +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_m68k +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_m68k +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_m68k +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/mips.h b/qemu/mips.h index 8b44bdfb..fb114f1a 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_mips #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_mips #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_mips +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_mips +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_mips +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_mips +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/mips64.h b/qemu/mips64.h index 03513957..87c1f191 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_mips64 #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_mips64 #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_mips64 +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_mips64 +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_mips64 +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_mips64 +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index db3a4f2c..80633733 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_mips64el #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_mips64el #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_mips64el +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_mips64el +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_mips64el +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_mips64el +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/mipsel.h b/qemu/mipsel.h index 4fbec7ea..338e0c3e 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_mipsel #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_mipsel #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_mipsel +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_mipsel +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_mipsel +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_mipsel +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/powerpc.h b/qemu/powerpc.h index dea9a272..6d53ec17 100644 --- a/qemu/powerpc.h +++ b/qemu/powerpc.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_powerpc #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_powerpc #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_powerpc +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_powerpc +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_powerpc +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_powerpc +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/riscv32.h b/qemu/riscv32.h index acaa31b6..a0857839 100644 --- a/qemu/riscv32.h +++ b/qemu/riscv32.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_riscv32 #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_riscv32 #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_riscv32 +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_riscv32 +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_riscv32 +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_riscv32 +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/riscv64.h b/qemu/riscv64.h index 29e9ca3f..a071be08 100644 --- a/qemu/riscv64.h +++ b/qemu/riscv64.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_riscv64 #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_riscv64 #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_riscv64 +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_riscv64 +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_riscv64 +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_riscv64 +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/sparc.h b/qemu/sparc.h index a9e97a6a..6dff0138 100644 --- a/qemu/sparc.h +++ b/qemu/sparc.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_sparc #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_sparc #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_sparc +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_sparc +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_sparc +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_sparc +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/sparc64.h b/qemu/sparc64.h index 1dbb5e80..77fce46c 100644 --- a/qemu/sparc64.h +++ b/qemu/sparc64.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_sparc64 #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_sparc64 #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_sparc64 +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_sparc64 +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_sparc64 +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_sparc64 +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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 diff --git a/qemu/target/arm/helper.h b/qemu/target/arm/helper.h index c2808810..6787f362 100644 --- a/qemu/target/arm/helper.h +++ b/qemu/target/arm/helper.h @@ -626,6 +626,11 @@ DEF_HELPER_FLAGS_4(gvec_vcvt_uf, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_fs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_fu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_uh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_hs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_hu, 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/neon-dp.decode b/qemu/target/arm/neon-dp.decode index 686f9fbf..1e9e8592 100644 --- a/qemu/target/arm/neon-dp.decode +++ b/qemu/target/arm/neon-dp.decode @@ -254,6 +254,8 @@ VMINNM_fp_3s 1111 001 1 0 . 1 . .... .... 1111 ... 1 .... @3same_fp # We use size=0 for fp32 and size=1 for fp16 to match the 3-same encodings. @2reg_vcvt .... ... . . . 1 ..... .... .... . q:1 . . .... \ &2reg_shift vm=%vm_dp vd=%vd_dp size=0 shift=%neon_rshift_i5 +@2reg_vcvt_f16 .... ... . . . 11 .... .... .... . q:1 . . .... \ + &2reg_shift vm=%vm_dp vd=%vd_dp size=1 shift=%neon_rshift_i4 VSHR_S_2sh 1111 001 0 1 . ...... .... 0000 . . . 1 .... @2reg_shr_d VSHR_S_2sh 1111 001 0 1 . ...... .... 0000 . . . 1 .... @2reg_shr_s @@ -370,7 +372,11 @@ VSHLL_U_2sh 1111 001 1 1 . ...... .... 1010 . 0 . 1 .... @2reg_shll_h VSHLL_U_2sh 1111 001 1 1 . ...... .... 1010 . 0 . 1 .... @2reg_shll_b # VCVT fixed<->float conversions -# TODO: FP16 fixed<->float conversions are opc==0b1100 and 0b1101 +VCVT_SH_2sh 1111 001 0 1 . ...... .... 1100 0 . . 1 .... @2reg_vcvt_f16 +VCVT_UH_2sh 1111 001 1 1 . ...... .... 1100 0 . . 1 .... @2reg_vcvt_f16 +VCVT_HS_2sh 1111 001 0 1 . ...... .... 1101 0 . . 1 .... @2reg_vcvt_f16 +VCVT_HU_2sh 1111 001 1 1 . ...... .... 1101 0 . . 1 .... @2reg_vcvt_f16 + VCVT_SF_2sh 1111 001 0 1 . ...... .... 1110 0 . . 1 .... @2reg_vcvt VCVT_UF_2sh 1111 001 1 1 . ...... .... 1110 0 . . 1 .... @2reg_vcvt VCVT_FS_2sh 1111 001 0 1 . ...... .... 1111 0 . . 1 .... @2reg_vcvt diff --git a/qemu/target/arm/translate-neon.inc.c b/qemu/target/arm/translate-neon.inc.c index 4d3ff4e4..8a47a3b3 100644 --- a/qemu/target/arm/translate-neon.inc.c +++ b/qemu/target/arm/translate-neon.inc.c @@ -1684,6 +1684,11 @@ DO_FP_2SH(VCVT_UF, gen_helper_gvec_vcvt_uf) DO_FP_2SH(VCVT_FS, gen_helper_gvec_vcvt_fs) DO_FP_2SH(VCVT_FU, gen_helper_gvec_vcvt_fu) +DO_FP_2SH(VCVT_SH, gen_helper_gvec_vcvt_sh) +DO_FP_2SH(VCVT_UH, gen_helper_gvec_vcvt_uh) +DO_FP_2SH(VCVT_HS, gen_helper_gvec_vcvt_hs) +DO_FP_2SH(VCVT_HU, gen_helper_gvec_vcvt_hu) + static uint64_t asimd_imm_const(uint32_t imm, int cmode, int op) { /* diff --git a/qemu/target/arm/vec_helper.c b/qemu/target/arm/vec_helper.c index b411c5e2..772853a9 100644 --- a/qemu/target/arm/vec_helper.c +++ b/qemu/target/arm/vec_helper.c @@ -1863,5 +1863,9 @@ DO_VCVT_FIXED(gvec_vcvt_sf, helper_vfp_sltos, uint32_t) DO_VCVT_FIXED(gvec_vcvt_uf, helper_vfp_ultos, uint32_t) DO_VCVT_FIXED(gvec_vcvt_fs, helper_vfp_tosls_round_to_zero, uint32_t) DO_VCVT_FIXED(gvec_vcvt_fu, helper_vfp_touls_round_to_zero, uint32_t) +DO_VCVT_FIXED(gvec_vcvt_sh, helper_vfp_shtoh, uint16_t) +DO_VCVT_FIXED(gvec_vcvt_uh, helper_vfp_uhtoh, uint16_t) +DO_VCVT_FIXED(gvec_vcvt_hs, helper_vfp_toshh_round_to_zero, uint16_t) +DO_VCVT_FIXED(gvec_vcvt_hu, helper_vfp_touhh_round_to_zero, uint16_t) #undef DO_VCVT_FIXED diff --git a/qemu/x86_64.h b/qemu/x86_64.h index d941646a..0c77cf9b 100644 --- a/qemu/x86_64.h +++ b/qemu/x86_64.h @@ -1840,6 +1840,10 @@ #define helper_gvec_vcvt_uf helper_gvec_vcvt_uf_x86_64 #define helper_gvec_vcvt_fs helper_gvec_vcvt_fs_x86_64 #define helper_gvec_vcvt_fu helper_gvec_vcvt_fu_x86_64 +#define helper_gvec_vcvt_sh helper_gvec_vcvt_sh_x86_64 +#define helper_gvec_vcvt_uh helper_gvec_vcvt_uh_x86_64 +#define helper_gvec_vcvt_hs helper_gvec_vcvt_hs_x86_64 +#define helper_gvec_vcvt_hu helper_gvec_vcvt_hu_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