target/arm: Handle FPCR.AH in FRECPS and FRSQRTS vector insns
Handle the FPCR.AH "don't negate the sign of a NaN" semantics in the vector versions of FRECPS and FRSQRTS, by implementing new vector wrappers that call the _ah_ scalar helpers. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
28048a3d18
commit
fdf89638dc
@ -980,6 +980,20 @@ DEF_HELPER_FLAGS_5(gvec_rsqrts_s, TCG_CALL_NO_RWG,
|
|||||||
DEF_HELPER_FLAGS_5(gvec_rsqrts_d, TCG_CALL_NO_RWG,
|
DEF_HELPER_FLAGS_5(gvec_rsqrts_d, TCG_CALL_NO_RWG,
|
||||||
void, ptr, ptr, ptr, fpst, i32)
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
|
|
||||||
|
DEF_HELPER_FLAGS_5(gvec_ah_recps_h, TCG_CALL_NO_RWG,
|
||||||
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
|
DEF_HELPER_FLAGS_5(gvec_ah_recps_s, TCG_CALL_NO_RWG,
|
||||||
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
|
DEF_HELPER_FLAGS_5(gvec_ah_recps_d, TCG_CALL_NO_RWG,
|
||||||
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
|
|
||||||
|
DEF_HELPER_FLAGS_5(gvec_ah_rsqrts_h, TCG_CALL_NO_RWG,
|
||||||
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
|
DEF_HELPER_FLAGS_5(gvec_ah_rsqrts_s, TCG_CALL_NO_RWG,
|
||||||
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
|
DEF_HELPER_FLAGS_5(gvec_ah_rsqrts_d, TCG_CALL_NO_RWG,
|
||||||
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
|
|
||||||
DEF_HELPER_FLAGS_5(gvec_ah_fmax_h, TCG_CALL_NO_RWG,
|
DEF_HELPER_FLAGS_5(gvec_ah_fmax_h, TCG_CALL_NO_RWG,
|
||||||
void, ptr, ptr, ptr, fpst, i32)
|
void, ptr, ptr, ptr, fpst, i32)
|
||||||
DEF_HELPER_FLAGS_5(gvec_ah_fmax_s, TCG_CALL_NO_RWG,
|
DEF_HELPER_FLAGS_5(gvec_ah_fmax_s, TCG_CALL_NO_RWG,
|
||||||
|
@ -5767,10 +5767,11 @@ static bool do_fp3_vector_2fn(DisasContext *s, arg_qrrr_e *a, int data,
|
|||||||
return do_fp3_vector(s, a, data, s->fpcr_ah ? fah : fnormal);
|
return do_fp3_vector(s, a, data, s->fpcr_ah ? fah : fnormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool do_fp3_vector_ah(DisasContext *s, arg_qrrr_e *a, int data,
|
static bool do_fp3_vector_ah_2fn(DisasContext *s, arg_qrrr_e *a, int data,
|
||||||
gen_helper_gvec_3_ptr * const f[3])
|
gen_helper_gvec_3_ptr * const fnormal[3],
|
||||||
|
gen_helper_gvec_3_ptr * const fah[3])
|
||||||
{
|
{
|
||||||
return do_fp3_vector_with_fpsttype(s, a, data, f,
|
return do_fp3_vector_with_fpsttype(s, a, data, s->fpcr_ah ? fah : fnormal,
|
||||||
select_ah_fpst(s, a->esz));
|
select_ah_fpst(s, a->esz));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5913,14 +5914,24 @@ static gen_helper_gvec_3_ptr * const f_vector_frecps[3] = {
|
|||||||
gen_helper_gvec_recps_s,
|
gen_helper_gvec_recps_s,
|
||||||
gen_helper_gvec_recps_d,
|
gen_helper_gvec_recps_d,
|
||||||
};
|
};
|
||||||
TRANS(FRECPS_v, do_fp3_vector_ah, a, 0, f_vector_frecps)
|
static gen_helper_gvec_3_ptr * const f_vector_ah_frecps[3] = {
|
||||||
|
gen_helper_gvec_ah_recps_h,
|
||||||
|
gen_helper_gvec_ah_recps_s,
|
||||||
|
gen_helper_gvec_ah_recps_d,
|
||||||
|
};
|
||||||
|
TRANS(FRECPS_v, do_fp3_vector_ah_2fn, a, 0, f_vector_frecps, f_vector_ah_frecps)
|
||||||
|
|
||||||
static gen_helper_gvec_3_ptr * const f_vector_frsqrts[3] = {
|
static gen_helper_gvec_3_ptr * const f_vector_frsqrts[3] = {
|
||||||
gen_helper_gvec_rsqrts_h,
|
gen_helper_gvec_rsqrts_h,
|
||||||
gen_helper_gvec_rsqrts_s,
|
gen_helper_gvec_rsqrts_s,
|
||||||
gen_helper_gvec_rsqrts_d,
|
gen_helper_gvec_rsqrts_d,
|
||||||
};
|
};
|
||||||
TRANS(FRSQRTS_v, do_fp3_vector_ah, a, 0, f_vector_frsqrts)
|
static gen_helper_gvec_3_ptr * const f_vector_ah_frsqrts[3] = {
|
||||||
|
gen_helper_gvec_ah_rsqrts_h,
|
||||||
|
gen_helper_gvec_ah_rsqrts_s,
|
||||||
|
gen_helper_gvec_ah_rsqrts_d,
|
||||||
|
};
|
||||||
|
TRANS(FRSQRTS_v, do_fp3_vector_ah_2fn, a, 0, f_vector_frsqrts, f_vector_ah_frsqrts)
|
||||||
|
|
||||||
static gen_helper_gvec_3_ptr * const f_vector_faddp[3] = {
|
static gen_helper_gvec_3_ptr * const f_vector_faddp[3] = {
|
||||||
gen_helper_gvec_faddp_h,
|
gen_helper_gvec_faddp_h,
|
||||||
|
@ -3741,7 +3741,12 @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a)
|
|||||||
NULL, gen_helper_gvec_##name##_h, \
|
NULL, gen_helper_gvec_##name##_h, \
|
||||||
gen_helper_gvec_##name##_s, gen_helper_gvec_##name##_d \
|
gen_helper_gvec_##name##_s, gen_helper_gvec_##name##_d \
|
||||||
}; \
|
}; \
|
||||||
TRANS_FEAT(NAME, aa64_sve, gen_gvec_fpst_ah_arg_zzz, name##_fns[a->esz], a, 0)
|
static gen_helper_gvec_3_ptr * const name##_ah_fns[4] = { \
|
||||||
|
NULL, gen_helper_gvec_ah_##name##_h, \
|
||||||
|
gen_helper_gvec_ah_##name##_s, gen_helper_gvec_ah_##name##_d \
|
||||||
|
}; \
|
||||||
|
TRANS_FEAT(NAME, aa64_sve, gen_gvec_fpst_ah_arg_zzz, \
|
||||||
|
s->fpcr_ah ? name##_ah_fns[a->esz] : name##_fns[a->esz], a, 0)
|
||||||
|
|
||||||
DO_FP3(FADD_zzz, fadd)
|
DO_FP3(FADD_zzz, fadd)
|
||||||
DO_FP3(FSUB_zzz, fsub)
|
DO_FP3(FSUB_zzz, fsub)
|
||||||
|
@ -1477,6 +1477,14 @@ DO_3OP(gvec_rsqrts_h, helper_rsqrtsf_f16, float16)
|
|||||||
DO_3OP(gvec_rsqrts_s, helper_rsqrtsf_f32, float32)
|
DO_3OP(gvec_rsqrts_s, helper_rsqrtsf_f32, float32)
|
||||||
DO_3OP(gvec_rsqrts_d, helper_rsqrtsf_f64, float64)
|
DO_3OP(gvec_rsqrts_d, helper_rsqrtsf_f64, float64)
|
||||||
|
|
||||||
|
DO_3OP(gvec_ah_recps_h, helper_recpsf_ah_f16, float16)
|
||||||
|
DO_3OP(gvec_ah_recps_s, helper_recpsf_ah_f32, float32)
|
||||||
|
DO_3OP(gvec_ah_recps_d, helper_recpsf_ah_f64, float64)
|
||||||
|
|
||||||
|
DO_3OP(gvec_ah_rsqrts_h, helper_rsqrtsf_ah_f16, float16)
|
||||||
|
DO_3OP(gvec_ah_rsqrts_s, helper_rsqrtsf_ah_f32, float32)
|
||||||
|
DO_3OP(gvec_ah_rsqrts_d, helper_rsqrtsf_ah_f64, float64)
|
||||||
|
|
||||||
DO_3OP(gvec_ah_fmax_h, helper_vfp_ah_maxh, float16)
|
DO_3OP(gvec_ah_fmax_h, helper_vfp_ah_maxh, float16)
|
||||||
DO_3OP(gvec_ah_fmax_s, helper_vfp_ah_maxs, float32)
|
DO_3OP(gvec_ah_fmax_s, helper_vfp_ah_maxs, float32)
|
||||||
DO_3OP(gvec_ah_fmax_d, helper_vfp_ah_maxd, float64)
|
DO_3OP(gvec_ah_fmax_d, helper_vfp_ah_maxd, float64)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user