target/arm: Implement fp16 for Neon pairwise fp ops

Convert the Neon pairwise fp ops to use a single gvic-style
helper to do the full operation instead of one helper call
for each 32-bit part. This allows us to use the same
framework to implement the fp16.

Backports 1dc587ee9bfe804406eb3e0bacf47a80644d8abc
This commit is contained in:
Peter Maydell 2021-03-01 17:25:16 -05:00 committed by Lioncash
parent b08ea84374
commit 82f4a7e135
19 changed files with 164 additions and 27 deletions

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_aarch64
#define helper_neon_paddl_u16 helper_neon_paddl_u16_aarch64
#define helper_neon_paddl_u32 helper_neon_paddl_u32_aarch64
#define helper_neon_paddh helper_neon_paddh_aarch64
#define helper_neon_padds helper_neon_padds_aarch64
#define helper_neon_pmax_s16 helper_neon_pmax_s16_aarch64
#define helper_neon_pmax_s8 helper_neon_pmax_s8_aarch64
#define helper_neon_pmax_u16 helper_neon_pmax_u16_aarch64
#define helper_neon_pmax_u8 helper_neon_pmax_u8_aarch64
#define helper_neon_pmaxh helper_neon_pmaxh_aarch64
#define helper_neon_pmaxs helper_neon_pmaxs_aarch64
#define helper_neon_pmin_s16 helper_neon_pmin_s16_aarch64
#define helper_neon_pmin_s8 helper_neon_pmin_s8_aarch64
#define helper_neon_pmin_u16 helper_neon_pmin_u16_aarch64
#define helper_neon_pmin_u8 helper_neon_pmin_u8_aarch64
#define helper_neon_pminh helper_neon_pminh_aarch64
#define helper_neon_pmins helper_neon_pmins_aarch64
#define helper_neon_pmull_h helper_neon_pmull_h_aarch64
#define helper_neon_qabs_s16 helper_neon_qabs_s16_aarch64
#define helper_neon_qabs_s32 helper_neon_qabs_s32_aarch64

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_aarch64eb
#define helper_neon_paddl_u16 helper_neon_paddl_u16_aarch64eb
#define helper_neon_paddl_u32 helper_neon_paddl_u32_aarch64eb
#define helper_neon_paddh helper_neon_paddh_aarch64eb
#define helper_neon_padds helper_neon_padds_aarch64eb
#define helper_neon_pmax_s16 helper_neon_pmax_s16_aarch64eb
#define helper_neon_pmax_s8 helper_neon_pmax_s8_aarch64eb
#define helper_neon_pmax_u16 helper_neon_pmax_u16_aarch64eb
#define helper_neon_pmax_u8 helper_neon_pmax_u8_aarch64eb
#define helper_neon_pmaxh helper_neon_pmaxh_aarch64eb
#define helper_neon_pmaxs helper_neon_pmaxs_aarch64eb
#define helper_neon_pmin_s16 helper_neon_pmin_s16_aarch64eb
#define helper_neon_pmin_s8 helper_neon_pmin_s8_aarch64eb
#define helper_neon_pmin_u16 helper_neon_pmin_u16_aarch64eb
#define helper_neon_pmin_u8 helper_neon_pmin_u8_aarch64eb
#define helper_neon_pminh helper_neon_pminh_aarch64eb
#define helper_neon_pmins helper_neon_pmins_aarch64eb
#define helper_neon_pmull_h helper_neon_pmull_h_aarch64eb
#define helper_neon_qabs_s16 helper_neon_qabs_s16_aarch64eb
#define helper_neon_qabs_s32 helper_neon_qabs_s32_aarch64eb

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_arm
#define helper_neon_paddl_u16 helper_neon_paddl_u16_arm
#define helper_neon_paddl_u32 helper_neon_paddl_u32_arm
#define helper_neon_paddh helper_neon_paddh_arm
#define helper_neon_padds helper_neon_padds_arm
#define helper_neon_pmax_s16 helper_neon_pmax_s16_arm
#define helper_neon_pmax_s8 helper_neon_pmax_s8_arm
#define helper_neon_pmax_u16 helper_neon_pmax_u16_arm
#define helper_neon_pmax_u8 helper_neon_pmax_u8_arm
#define helper_neon_pmaxh helper_neon_pmaxh_arm
#define helper_neon_pmaxs helper_neon_pmaxs_arm
#define helper_neon_pmin_s16 helper_neon_pmin_s16_arm
#define helper_neon_pmin_s8 helper_neon_pmin_s8_arm
#define helper_neon_pmin_u16 helper_neon_pmin_u16_arm
#define helper_neon_pmin_u8 helper_neon_pmin_u8_arm
#define helper_neon_pminh helper_neon_pminh_arm
#define helper_neon_pmins helper_neon_pmins_arm
#define helper_neon_pmull_h helper_neon_pmull_h_arm
#define helper_neon_qabs_s16 helper_neon_qabs_s16_arm
#define helper_neon_qabs_s32 helper_neon_qabs_s32_arm

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_armeb
#define helper_neon_paddl_u16 helper_neon_paddl_u16_armeb
#define helper_neon_paddl_u32 helper_neon_paddl_u32_armeb
#define helper_neon_paddh helper_neon_paddh_armeb
#define helper_neon_padds helper_neon_padds_armeb
#define helper_neon_pmax_s16 helper_neon_pmax_s16_armeb
#define helper_neon_pmax_s8 helper_neon_pmax_s8_armeb
#define helper_neon_pmax_u16 helper_neon_pmax_u16_armeb
#define helper_neon_pmax_u8 helper_neon_pmax_u8_armeb
#define helper_neon_pmaxh helper_neon_pmaxh_armeb
#define helper_neon_pmaxs helper_neon_pmaxs_armeb
#define helper_neon_pmin_s16 helper_neon_pmin_s16_armeb
#define helper_neon_pmin_s8 helper_neon_pmin_s8_armeb
#define helper_neon_pmin_u16 helper_neon_pmin_u16_armeb
#define helper_neon_pmin_u8 helper_neon_pmin_u8_armeb
#define helper_neon_pminh helper_neon_pminh_armeb
#define helper_neon_pmins helper_neon_pmins_armeb
#define helper_neon_pmull_h helper_neon_pmull_h_armeb
#define helper_neon_qabs_s16 helper_neon_qabs_s16_armeb
#define helper_neon_qabs_s32 helper_neon_qabs_s32_armeb

View file

@ -1713,14 +1713,20 @@ symbols = (
'helper_neon_padd_u8',
'helper_neon_paddl_u16',
'helper_neon_paddl_u32',
'helper_neon_paddh',
'helper_neon_padds',
'helper_neon_pmax_s16',
'helper_neon_pmax_s8',
'helper_neon_pmax_u16',
'helper_neon_pmax_u8',
'helper_neon_pmaxh',
'helper_neon_pmaxs',
'helper_neon_pmin_s16',
'helper_neon_pmin_s8',
'helper_neon_pmin_u16',
'helper_neon_pmin_u8',
'helper_neon_pminh',
'helper_neon_pmins',
'helper_neon_pmull_h',
'helper_neon_qabs_s16',
'helper_neon_qabs_s32',

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_m68k
#define helper_neon_paddl_u16 helper_neon_paddl_u16_m68k
#define helper_neon_paddl_u32 helper_neon_paddl_u32_m68k
#define helper_neon_paddh helper_neon_paddh_m68k
#define helper_neon_padds helper_neon_padds_m68k
#define helper_neon_pmax_s16 helper_neon_pmax_s16_m68k
#define helper_neon_pmax_s8 helper_neon_pmax_s8_m68k
#define helper_neon_pmax_u16 helper_neon_pmax_u16_m68k
#define helper_neon_pmax_u8 helper_neon_pmax_u8_m68k
#define helper_neon_pmaxh helper_neon_pmaxh_m68k
#define helper_neon_pmaxs helper_neon_pmaxs_m68k
#define helper_neon_pmin_s16 helper_neon_pmin_s16_m68k
#define helper_neon_pmin_s8 helper_neon_pmin_s8_m68k
#define helper_neon_pmin_u16 helper_neon_pmin_u16_m68k
#define helper_neon_pmin_u8 helper_neon_pmin_u8_m68k
#define helper_neon_pminh helper_neon_pminh_m68k
#define helper_neon_pmins helper_neon_pmins_m68k
#define helper_neon_pmull_h helper_neon_pmull_h_m68k
#define helper_neon_qabs_s16 helper_neon_qabs_s16_m68k
#define helper_neon_qabs_s32 helper_neon_qabs_s32_m68k

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_mips
#define helper_neon_paddl_u16 helper_neon_paddl_u16_mips
#define helper_neon_paddl_u32 helper_neon_paddl_u32_mips
#define helper_neon_paddh helper_neon_paddh_mips
#define helper_neon_padds helper_neon_padds_mips
#define helper_neon_pmax_s16 helper_neon_pmax_s16_mips
#define helper_neon_pmax_s8 helper_neon_pmax_s8_mips
#define helper_neon_pmax_u16 helper_neon_pmax_u16_mips
#define helper_neon_pmax_u8 helper_neon_pmax_u8_mips
#define helper_neon_pmaxh helper_neon_pmaxh_mips
#define helper_neon_pmaxs helper_neon_pmaxs_mips
#define helper_neon_pmin_s16 helper_neon_pmin_s16_mips
#define helper_neon_pmin_s8 helper_neon_pmin_s8_mips
#define helper_neon_pmin_u16 helper_neon_pmin_u16_mips
#define helper_neon_pmin_u8 helper_neon_pmin_u8_mips
#define helper_neon_pminh helper_neon_pminh_mips
#define helper_neon_pmins helper_neon_pmins_mips
#define helper_neon_pmull_h helper_neon_pmull_h_mips
#define helper_neon_qabs_s16 helper_neon_qabs_s16_mips
#define helper_neon_qabs_s32 helper_neon_qabs_s32_mips

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_mips64
#define helper_neon_paddl_u16 helper_neon_paddl_u16_mips64
#define helper_neon_paddl_u32 helper_neon_paddl_u32_mips64
#define helper_neon_paddh helper_neon_paddh_mips64
#define helper_neon_padds helper_neon_padds_mips64
#define helper_neon_pmax_s16 helper_neon_pmax_s16_mips64
#define helper_neon_pmax_s8 helper_neon_pmax_s8_mips64
#define helper_neon_pmax_u16 helper_neon_pmax_u16_mips64
#define helper_neon_pmax_u8 helper_neon_pmax_u8_mips64
#define helper_neon_pmaxh helper_neon_pmaxh_mips64
#define helper_neon_pmaxs helper_neon_pmaxs_mips64
#define helper_neon_pmin_s16 helper_neon_pmin_s16_mips64
#define helper_neon_pmin_s8 helper_neon_pmin_s8_mips64
#define helper_neon_pmin_u16 helper_neon_pmin_u16_mips64
#define helper_neon_pmin_u8 helper_neon_pmin_u8_mips64
#define helper_neon_pminh helper_neon_pminh_mips64
#define helper_neon_pmins helper_neon_pmins_mips64
#define helper_neon_pmull_h helper_neon_pmull_h_mips64
#define helper_neon_qabs_s16 helper_neon_qabs_s16_mips64
#define helper_neon_qabs_s32 helper_neon_qabs_s32_mips64

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_mips64el
#define helper_neon_paddl_u16 helper_neon_paddl_u16_mips64el
#define helper_neon_paddl_u32 helper_neon_paddl_u32_mips64el
#define helper_neon_paddh helper_neon_paddh_mips64el
#define helper_neon_padds helper_neon_padds_mips64el
#define helper_neon_pmax_s16 helper_neon_pmax_s16_mips64el
#define helper_neon_pmax_s8 helper_neon_pmax_s8_mips64el
#define helper_neon_pmax_u16 helper_neon_pmax_u16_mips64el
#define helper_neon_pmax_u8 helper_neon_pmax_u8_mips64el
#define helper_neon_pmaxh helper_neon_pmaxh_mips64el
#define helper_neon_pmaxs helper_neon_pmaxs_mips64el
#define helper_neon_pmin_s16 helper_neon_pmin_s16_mips64el
#define helper_neon_pmin_s8 helper_neon_pmin_s8_mips64el
#define helper_neon_pmin_u16 helper_neon_pmin_u16_mips64el
#define helper_neon_pmin_u8 helper_neon_pmin_u8_mips64el
#define helper_neon_pminh helper_neon_pminh_mips64el
#define helper_neon_pmins helper_neon_pmins_mips64el
#define helper_neon_pmull_h helper_neon_pmull_h_mips64el
#define helper_neon_qabs_s16 helper_neon_qabs_s16_mips64el
#define helper_neon_qabs_s32 helper_neon_qabs_s32_mips64el

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_mipsel
#define helper_neon_paddl_u16 helper_neon_paddl_u16_mipsel
#define helper_neon_paddl_u32 helper_neon_paddl_u32_mipsel
#define helper_neon_paddh helper_neon_paddh_mipsel
#define helper_neon_padds helper_neon_padds_mipsel
#define helper_neon_pmax_s16 helper_neon_pmax_s16_mipsel
#define helper_neon_pmax_s8 helper_neon_pmax_s8_mipsel
#define helper_neon_pmax_u16 helper_neon_pmax_u16_mipsel
#define helper_neon_pmax_u8 helper_neon_pmax_u8_mipsel
#define helper_neon_pmaxh helper_neon_pmaxh_mipsel
#define helper_neon_pmaxs helper_neon_pmaxs_mipsel
#define helper_neon_pmin_s16 helper_neon_pmin_s16_mipsel
#define helper_neon_pmin_s8 helper_neon_pmin_s8_mipsel
#define helper_neon_pmin_u16 helper_neon_pmin_u16_mipsel
#define helper_neon_pmin_u8 helper_neon_pmin_u8_mipsel
#define helper_neon_pminh helper_neon_pminh_mipsel
#define helper_neon_pmins helper_neon_pmins_mipsel
#define helper_neon_pmull_h helper_neon_pmull_h_mipsel
#define helper_neon_qabs_s16 helper_neon_qabs_s16_mipsel
#define helper_neon_qabs_s32 helper_neon_qabs_s32_mipsel

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_powerpc
#define helper_neon_paddl_u16 helper_neon_paddl_u16_powerpc
#define helper_neon_paddl_u32 helper_neon_paddl_u32_powerpc
#define helper_neon_paddh helper_neon_paddh_powerpc
#define helper_neon_padds helper_neon_padds_powerpc
#define helper_neon_pmax_s16 helper_neon_pmax_s16_powerpc
#define helper_neon_pmax_s8 helper_neon_pmax_s8_powerpc
#define helper_neon_pmax_u16 helper_neon_pmax_u16_powerpc
#define helper_neon_pmax_u8 helper_neon_pmax_u8_powerpc
#define helper_neon_pmaxh helper_neon_pmaxh_powerpc
#define helper_neon_pmaxs helper_neon_pmaxs_powerpc
#define helper_neon_pmin_s16 helper_neon_pmin_s16_powerpc
#define helper_neon_pmin_s8 helper_neon_pmin_s8_powerpc
#define helper_neon_pmin_u16 helper_neon_pmin_u16_powerpc
#define helper_neon_pmin_u8 helper_neon_pmin_u8_powerpc
#define helper_neon_pminh helper_neon_pminh_powerpc
#define helper_neon_pmins helper_neon_pmins_powerpc
#define helper_neon_pmull_h helper_neon_pmull_h_powerpc
#define helper_neon_qabs_s16 helper_neon_qabs_s16_powerpc
#define helper_neon_qabs_s32 helper_neon_qabs_s32_powerpc

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_riscv32
#define helper_neon_paddl_u16 helper_neon_paddl_u16_riscv32
#define helper_neon_paddl_u32 helper_neon_paddl_u32_riscv32
#define helper_neon_paddh helper_neon_paddh_riscv32
#define helper_neon_padds helper_neon_padds_riscv32
#define helper_neon_pmax_s16 helper_neon_pmax_s16_riscv32
#define helper_neon_pmax_s8 helper_neon_pmax_s8_riscv32
#define helper_neon_pmax_u16 helper_neon_pmax_u16_riscv32
#define helper_neon_pmax_u8 helper_neon_pmax_u8_riscv32
#define helper_neon_pmaxh helper_neon_pmaxh_riscv32
#define helper_neon_pmaxs helper_neon_pmaxs_riscv32
#define helper_neon_pmin_s16 helper_neon_pmin_s16_riscv32
#define helper_neon_pmin_s8 helper_neon_pmin_s8_riscv32
#define helper_neon_pmin_u16 helper_neon_pmin_u16_riscv32
#define helper_neon_pmin_u8 helper_neon_pmin_u8_riscv32
#define helper_neon_pminh helper_neon_pminh_riscv32
#define helper_neon_pmins helper_neon_pmins_riscv32
#define helper_neon_pmull_h helper_neon_pmull_h_riscv32
#define helper_neon_qabs_s16 helper_neon_qabs_s16_riscv32
#define helper_neon_qabs_s32 helper_neon_qabs_s32_riscv32

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_riscv64
#define helper_neon_paddl_u16 helper_neon_paddl_u16_riscv64
#define helper_neon_paddl_u32 helper_neon_paddl_u32_riscv64
#define helper_neon_paddh helper_neon_paddh_riscv64
#define helper_neon_padds helper_neon_padds_riscv64
#define helper_neon_pmax_s16 helper_neon_pmax_s16_riscv64
#define helper_neon_pmax_s8 helper_neon_pmax_s8_riscv64
#define helper_neon_pmax_u16 helper_neon_pmax_u16_riscv64
#define helper_neon_pmax_u8 helper_neon_pmax_u8_riscv64
#define helper_neon_pmaxh helper_neon_pmaxh_riscv64
#define helper_neon_pmaxs helper_neon_pmaxs_riscv64
#define helper_neon_pmin_s16 helper_neon_pmin_s16_riscv64
#define helper_neon_pmin_s8 helper_neon_pmin_s8_riscv64
#define helper_neon_pmin_u16 helper_neon_pmin_u16_riscv64
#define helper_neon_pmin_u8 helper_neon_pmin_u8_riscv64
#define helper_neon_pminh helper_neon_pminh_riscv64
#define helper_neon_pmins helper_neon_pmins_riscv64
#define helper_neon_pmull_h helper_neon_pmull_h_riscv64
#define helper_neon_qabs_s16 helper_neon_qabs_s16_riscv64
#define helper_neon_qabs_s32 helper_neon_qabs_s32_riscv64

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_sparc
#define helper_neon_paddl_u16 helper_neon_paddl_u16_sparc
#define helper_neon_paddl_u32 helper_neon_paddl_u32_sparc
#define helper_neon_paddh helper_neon_paddh_sparc
#define helper_neon_padds helper_neon_padds_sparc
#define helper_neon_pmax_s16 helper_neon_pmax_s16_sparc
#define helper_neon_pmax_s8 helper_neon_pmax_s8_sparc
#define helper_neon_pmax_u16 helper_neon_pmax_u16_sparc
#define helper_neon_pmax_u8 helper_neon_pmax_u8_sparc
#define helper_neon_pmaxh helper_neon_pmaxh_sparc
#define helper_neon_pmaxs helper_neon_pmaxs_sparc
#define helper_neon_pmin_s16 helper_neon_pmin_s16_sparc
#define helper_neon_pmin_s8 helper_neon_pmin_s8_sparc
#define helper_neon_pmin_u16 helper_neon_pmin_u16_sparc
#define helper_neon_pmin_u8 helper_neon_pmin_u8_sparc
#define helper_neon_pminh helper_neon_pminh_sparc
#define helper_neon_pmins helper_neon_pmins_sparc
#define helper_neon_pmull_h helper_neon_pmull_h_sparc
#define helper_neon_qabs_s16 helper_neon_qabs_s16_sparc
#define helper_neon_qabs_s32 helper_neon_qabs_s32_sparc

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_sparc64
#define helper_neon_paddl_u16 helper_neon_paddl_u16_sparc64
#define helper_neon_paddl_u32 helper_neon_paddl_u32_sparc64
#define helper_neon_paddh helper_neon_paddh_sparc64
#define helper_neon_padds helper_neon_padds_sparc64
#define helper_neon_pmax_s16 helper_neon_pmax_s16_sparc64
#define helper_neon_pmax_s8 helper_neon_pmax_s8_sparc64
#define helper_neon_pmax_u16 helper_neon_pmax_u16_sparc64
#define helper_neon_pmax_u8 helper_neon_pmax_u8_sparc64
#define helper_neon_pmaxh helper_neon_pmaxh_sparc64
#define helper_neon_pmaxs helper_neon_pmaxs_sparc64
#define helper_neon_pmin_s16 helper_neon_pmin_s16_sparc64
#define helper_neon_pmin_s8 helper_neon_pmin_s8_sparc64
#define helper_neon_pmin_u16 helper_neon_pmin_u16_sparc64
#define helper_neon_pmin_u8 helper_neon_pmin_u8_sparc64
#define helper_neon_pminh helper_neon_pminh_sparc64
#define helper_neon_pmins helper_neon_pmins_sparc64
#define helper_neon_pmull_h helper_neon_pmull_h_sparc64
#define helper_neon_qabs_s16 helper_neon_qabs_s16_sparc64
#define helper_neon_qabs_s32 helper_neon_qabs_s32_sparc64

View file

@ -605,6 +605,13 @@ DEF_HELPER_FLAGS_5(gvec_fcmlas_idx, TCG_CALL_NO_RWG,
DEF_HELPER_FLAGS_5(gvec_fcmlad, TCG_CALL_NO_RWG,
void, ptr, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_5(neon_paddh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_5(neon_pmaxh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_5(neon_pminh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_5(neon_padds, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_5(neon_pmaxs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_5(neon_pmins, TCG_CALL_NO_RWG, void, ptr, 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)

View file

@ -1132,10 +1132,10 @@ static bool trans_VMINNM_fp_3s(DisasContext *s, arg_3same *a)
return do_3same(s, a, gen_VMINNM_fp32_3s);
}
static bool do_3same_fp_pair(DisasContext *s, arg_3same *a, VFPGen3OpSPFn *fn)
static bool do_3same_fp_pair(DisasContext *s, arg_3same *a,
gen_helper_gvec_3_ptr *fn)
{
/* FP operations handled pairwise 32 bits at a time */
TCGv_i32 tmp, tmp2, tmp3;
/* FP pairwise operations */
TCGv_ptr fpstatus;
TCGContext *tcg_ctx = s->uc->tcg_ctx;
@ -1155,26 +1155,13 @@ static bool do_3same_fp_pair(DisasContext *s, arg_3same *a, VFPGen3OpSPFn *fn)
assert(a->q == 0); /* enforced by decode patterns */
/*
* Note that we have to be careful not to clobber the source operands
* in the "vm == vd" case by storing the result of the first pass too
* early. Since Q is 0 there are always just two passes, so instead
* of a complicated loop over each pass we just unroll.
*/
fpstatus = fpstatus_ptr(tcg_ctx, FPST_STD);
tmp = neon_load_reg(s, a->vn, 0);
tmp2 = neon_load_reg(s, a->vn, 1);
fn(tcg_ctx, tmp, tmp, tmp2, fpstatus);
tcg_temp_free_i32(tcg_ctx, tmp2);
tmp3 = neon_load_reg(s, a->vm, 0);
tmp2 = neon_load_reg(s, a->vm, 1);
fn(tcg_ctx, tmp3, tmp3, tmp2, fpstatus);
tcg_temp_free_i32(tcg_ctx, tmp2);
fpstatus = fpstatus_ptr(tcg_ctx, a->size != 0 ? FPST_STD_F16 : FPST_STD);
tcg_gen_gvec_3_ptr(tcg_ctx, vfp_reg_offset(1, a->vd),
vfp_reg_offset(1, a->vn),
vfp_reg_offset(1, a->vm),
fpstatus, 8, 8, 0, fn);
tcg_temp_free_ptr(tcg_ctx, fpstatus);
neon_store_reg(s, a->vd, 0, tmp);
neon_store_reg(s, a->vd, 1, tmp3);
return true;
}
@ -1186,15 +1173,17 @@ static bool do_3same_fp_pair(DisasContext *s, arg_3same *a, VFPGen3OpSPFn *fn)
static bool trans_##INSN##_fp_3s(DisasContext *s, arg_3same *a) \
{ \
if (a->size != 0) { \
/* TODO fp16 support */ \
return false; \
if (!dc_isar_feature(aa32_fp16_arith, s)) { \
return false; \
} \
return do_3same_fp_pair(s, a, FUNC##h); \
} \
return do_3same_fp_pair(s, a, FUNC); \
return do_3same_fp_pair(s, a, FUNC##s); \
}
DO_3S_FP_PAIR(VPADD, gen_helper_vfp_adds)
DO_3S_FP_PAIR(VPMAX, gen_helper_vfp_maxs)
DO_3S_FP_PAIR(VPMIN, gen_helper_vfp_mins)
DO_3S_FP_PAIR(VPADD, gen_helper_neon_padd)
DO_3S_FP_PAIR(VPMAX, gen_helper_neon_pmax)
DO_3S_FP_PAIR(VPMIN, gen_helper_neon_pmin)
static bool do_vector_2sh(DisasContext *s, arg_2reg_shift *a, GVecGen2iFn *fn)
{

View file

@ -1771,3 +1771,48 @@ DO_ABA(gvec_uaba_s, uint32_t)
DO_ABA(gvec_uaba_d, uint64_t)
#undef DO_ABA
#define DO_NEON_PAIRWISE(NAME, OP) \
void HELPER(NAME##s)(void *vd, void *vn, void *vm, \
void *stat, uint32_t oprsz) \
{ \
float_status *fpst = stat; \
float32 *d = vd; \
float32 *n = vn; \
float32 *m = vm; \
float32 r0, r1; \
\
/* Read all inputs before writing outputs in case vm == vd */ \
r0 = float32_##OP(n[H4(0)], n[H4(1)], fpst); \
r1 = float32_##OP(m[H4(0)], m[H4(1)], fpst); \
\
d[H4(0)] = r0; \
d[H4(1)] = r1; \
} \
\
void HELPER(NAME##h)(void *vd, void *vn, void *vm, \
void *stat, uint32_t oprsz) \
{ \
float_status *fpst = stat; \
float16 *d = vd; \
float16 *n = vn; \
float16 *m = vm; \
float16 r0, r1, r2, r3; \
\
/* Read all inputs before writing outputs in case vm == vd */ \
r0 = float16_##OP(n[H2(0)], n[H2(1)], fpst); \
r1 = float16_##OP(n[H2(2)], n[H2(3)], fpst); \
r2 = float16_##OP(m[H2(0)], m[H2(1)], fpst); \
r3 = float16_##OP(m[H2(2)], m[H2(3)], fpst); \
\
d[H4(0)] = r0; \
d[H4(1)] = r1; \
d[H4(2)] = r2; \
d[H4(3)] = r3; \
}
DO_NEON_PAIRWISE(neon_padd, add)
DO_NEON_PAIRWISE(neon_pmax, max)
DO_NEON_PAIRWISE(neon_pmin, min)
#undef DO_NEON_PAIRWISE

View file

@ -1707,14 +1707,20 @@
#define helper_neon_padd_u8 helper_neon_padd_u8_x86_64
#define helper_neon_paddl_u16 helper_neon_paddl_u16_x86_64
#define helper_neon_paddl_u32 helper_neon_paddl_u32_x86_64
#define helper_neon_paddh helper_neon_paddh_x86_64
#define helper_neon_padds helper_neon_padds_x86_64
#define helper_neon_pmax_s16 helper_neon_pmax_s16_x86_64
#define helper_neon_pmax_s8 helper_neon_pmax_s8_x86_64
#define helper_neon_pmax_u16 helper_neon_pmax_u16_x86_64
#define helper_neon_pmax_u8 helper_neon_pmax_u8_x86_64
#define helper_neon_pmaxh helper_neon_pmaxh_x86_64
#define helper_neon_pmaxs helper_neon_pmaxs_x86_64
#define helper_neon_pmin_s16 helper_neon_pmin_s16_x86_64
#define helper_neon_pmin_s8 helper_neon_pmin_s8_x86_64
#define helper_neon_pmin_u16 helper_neon_pmin_u16_x86_64
#define helper_neon_pmin_u8 helper_neon_pmin_u8_x86_64
#define helper_neon_pminh helper_neon_pminh_x86_64
#define helper_neon_pmins helper_neon_pmins_x86_64
#define helper_neon_pmull_h helper_neon_pmull_h_x86_64
#define helper_neon_qabs_s16 helper_neon_qabs_s16_x86_64
#define helper_neon_qabs_s32 helper_neon_qabs_s32_x86_64