mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-22 23:25:29 +00:00
target/arm: Implement fp16 for VACGE, VACGT
Convert the neon floating-point vector absolute comparison ops VACGE and VACGT over to using a gvec hepler and use this to implement the fp16 case. Backports bb2741da186ebaebc7d5189372be4401e1ff9972
This commit is contained in:
parent
4eb39f1b2f
commit
6dd4a8e93f
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_aarch64
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_aarch64
|
||||
#define helper_gvec_eqv helper_gvec_eqv_aarch64
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_aarch64
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_aarch64
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_aarch64
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_aarch64
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_aarch64
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_aarch64
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_aarch64
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_aarch64eb
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_aarch64eb
|
||||
#define helper_gvec_eqv helper_gvec_eqv_aarch64eb
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_aarch64eb
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_aarch64eb
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_aarch64eb
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_aarch64eb
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_aarch64eb
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_aarch64eb
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_aarch64eb
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_arm
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_arm
|
||||
#define helper_gvec_eqv helper_gvec_eqv_arm
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_arm
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_arm
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_arm
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_arm
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_arm
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_arm
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_arm
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_armeb
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_armeb
|
||||
#define helper_gvec_eqv helper_gvec_eqv_armeb
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_armeb
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_armeb
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_armeb
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_armeb
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_armeb
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_armeb
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_armeb
|
||||
|
|
|
@ -1270,6 +1270,10 @@ symbols = (
|
|||
'helper_gvec_eq32',
|
||||
'helper_gvec_eq64',
|
||||
'helper_gvec_eqv',
|
||||
'helper_gvec_facge_h',
|
||||
'helper_gvec_facge_s',
|
||||
'helper_gvec_facgt_h',
|
||||
'helper_gvec_facgt_s',
|
||||
'helper_gvec_fabd_h',
|
||||
'helper_gvec_fabd_s',
|
||||
'helper_gvec_fadd_d',
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_m68k
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_m68k
|
||||
#define helper_gvec_eqv helper_gvec_eqv_m68k
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_m68k
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_m68k
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_m68k
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_m68k
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_m68k
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_m68k
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_m68k
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_mips
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_mips
|
||||
#define helper_gvec_eqv helper_gvec_eqv_mips
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_mips
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_mips
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_mips
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_mips
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_mips
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_mips
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_mips
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_mips64
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_mips64
|
||||
#define helper_gvec_eqv helper_gvec_eqv_mips64
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_mips64
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_mips64
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_mips64
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_mips64
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_mips64
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_mips64
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_mips64
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_mips64el
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_mips64el
|
||||
#define helper_gvec_eqv helper_gvec_eqv_mips64el
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_mips64el
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_mips64el
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_mips64el
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_mips64el
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_mips64el
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_mips64el
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_mips64el
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_mipsel
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_mipsel
|
||||
#define helper_gvec_eqv helper_gvec_eqv_mipsel
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_mipsel
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_mipsel
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_mipsel
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_mipsel
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_mipsel
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_mipsel
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_mipsel
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_powerpc
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_powerpc
|
||||
#define helper_gvec_eqv helper_gvec_eqv_powerpc
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_powerpc
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_powerpc
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_powerpc
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_powerpc
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_powerpc
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_powerpc
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_powerpc
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_riscv32
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_riscv32
|
||||
#define helper_gvec_eqv helper_gvec_eqv_riscv32
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_riscv32
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_riscv32
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_riscv32
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_riscv32
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_riscv32
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_riscv32
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_riscv32
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_riscv64
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_riscv64
|
||||
#define helper_gvec_eqv helper_gvec_eqv_riscv64
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_riscv64
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_riscv64
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_riscv64
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_riscv64
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_riscv64
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_riscv64
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_riscv64
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_sparc
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_sparc
|
||||
#define helper_gvec_eqv helper_gvec_eqv_sparc
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_sparc
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_sparc
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_sparc
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_sparc
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_sparc
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_sparc
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_sparc
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_sparc64
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_sparc64
|
||||
#define helper_gvec_eqv helper_gvec_eqv_sparc64
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_sparc64
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_sparc64
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_sparc64
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_sparc64
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_sparc64
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_sparc64
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_sparc64
|
||||
|
|
|
@ -639,6 +639,12 @@ DEF_HELPER_FLAGS_5(gvec_fcge_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
|
|||
DEF_HELPER_FLAGS_5(gvec_fcgt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
|
||||
DEF_HELPER_FLAGS_5(gvec_fcgt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
|
||||
|
||||
DEF_HELPER_FLAGS_5(gvec_facge_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
|
||||
DEF_HELPER_FLAGS_5(gvec_facge_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
|
||||
|
||||
DEF_HELPER_FLAGS_5(gvec_facgt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
|
||||
DEF_HELPER_FLAGS_5(gvec_facgt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
|
||||
|
||||
DEF_HELPER_FLAGS_5(gvec_ftsmul_h, TCG_CALL_NO_RWG,
|
||||
void, ptr, ptr, ptr, ptr, i32)
|
||||
DEF_HELPER_FLAGS_5(gvec_ftsmul_s, TCG_CALL_NO_RWG,
|
||||
|
|
|
@ -1134,6 +1134,8 @@ DO_3S_FP_GVEC(VMUL, gen_helper_gvec_fmul_s, gen_helper_gvec_fmul_h)
|
|||
DO_3S_FP_GVEC(VCEQ, gen_helper_gvec_fceq_s, gen_helper_gvec_fceq_h)
|
||||
DO_3S_FP_GVEC(VCGE, gen_helper_gvec_fcge_s, gen_helper_gvec_fcge_h)
|
||||
DO_3S_FP_GVEC(VCGT, gen_helper_gvec_fcgt_s, gen_helper_gvec_fcgt_h)
|
||||
DO_3S_FP_GVEC(VACGE, gen_helper_gvec_facge_s, gen_helper_gvec_facge_h)
|
||||
DO_3S_FP_GVEC(VACGT, gen_helper_gvec_facgt_s, gen_helper_gvec_facgt_h)
|
||||
|
||||
/*
|
||||
* For all the functions using this macro, size == 1 means fp16,
|
||||
|
@ -1149,8 +1151,6 @@ DO_3S_FP_GVEC(VCGT, gen_helper_gvec_fcgt_s, gen_helper_gvec_fcgt_h)
|
|||
return do_3same_fp(s, a, FUNC, READS_VD); \
|
||||
}
|
||||
|
||||
DO_3S_FP(VACGE, gen_helper_neon_acge_f32, false)
|
||||
DO_3S_FP(VACGT, gen_helper_neon_acgt_f32, false)
|
||||
DO_3S_FP(VMAX, gen_helper_vfp_maxs, false)
|
||||
DO_3S_FP(VMIN, gen_helper_vfp_mins, false)
|
||||
|
||||
|
|
|
@ -692,6 +692,26 @@ static uint32_t float32_cgt(float32 op1, float32 op2, float_status *stat)
|
|||
return -float32_lt(op2, op1, stat);
|
||||
}
|
||||
|
||||
static uint16_t float16_acge(float16 op1, float16 op2, float_status *stat)
|
||||
{
|
||||
return -float16_le(float16_abs(op2), float16_abs(op1), stat);
|
||||
}
|
||||
|
||||
static uint32_t float32_acge(float32 op1, float32 op2, float_status *stat)
|
||||
{
|
||||
return -float32_le(float32_abs(op2), float32_abs(op1), stat);
|
||||
}
|
||||
|
||||
static uint16_t float16_acgt(float16 op1, float16 op2, float_status *stat)
|
||||
{
|
||||
return -float16_lt(float16_abs(op2), float16_abs(op1), stat);
|
||||
}
|
||||
|
||||
static uint32_t float32_acgt(float32 op1, float32 op2, float_status *stat)
|
||||
{
|
||||
return -float32_lt(float32_abs(op2), float32_abs(op1), stat);
|
||||
}
|
||||
|
||||
#define DO_2OP(NAME, FUNC, TYPE) \
|
||||
void HELPER(NAME)(void *vd, void *vn, void *stat, uint32_t desc) \
|
||||
{ \
|
||||
|
@ -792,6 +812,12 @@ DO_3OP(gvec_fcge_s, float32_cge, float32)
|
|||
DO_3OP(gvec_fcgt_h, float16_cgt, float16)
|
||||
DO_3OP(gvec_fcgt_s, float32_cgt, float32)
|
||||
|
||||
DO_3OP(gvec_facge_h, float16_acge, float16)
|
||||
DO_3OP(gvec_facge_s, float32_acge, float32)
|
||||
|
||||
DO_3OP(gvec_facgt_h, float16_acgt, float16)
|
||||
DO_3OP(gvec_facgt_s, float32_acgt, float32)
|
||||
|
||||
#ifdef TARGET_AARCH64
|
||||
|
||||
DO_3OP(gvec_recps_h, helper_recpsf_f16, float16)
|
||||
|
|
|
@ -1264,6 +1264,10 @@
|
|||
#define helper_gvec_eq32 helper_gvec_eq32_x86_64
|
||||
#define helper_gvec_eq64 helper_gvec_eq64_x86_64
|
||||
#define helper_gvec_eqv helper_gvec_eqv_x86_64
|
||||
#define helper_gvec_facge_h helper_gvec_facge_h_x86_64
|
||||
#define helper_gvec_facge_s helper_gvec_facge_s_x86_64
|
||||
#define helper_gvec_facgt_h helper_gvec_facgt_h_x86_64
|
||||
#define helper_gvec_facgt_s helper_gvec_facgt_s_x86_64
|
||||
#define helper_gvec_fabd_h helper_gvec_fabd_h_x86_64
|
||||
#define helper_gvec_fabd_s helper_gvec_fabd_s_x86_64
|
||||
#define helper_gvec_fadd_d helper_gvec_fadd_d_x86_64
|
||||
|
|
Loading…
Reference in a new issue