target/arm: Simplify fp_status indexing in mve_helper.c
Select on index instead of pointer. No functional change. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20250129013857.135256-16-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
54afbf6632
commit
f81c46987a
@ -2814,8 +2814,7 @@ DO_VMAXMINA(vminaw, 4, int32_t, uint32_t, DO_MIN)
|
|||||||
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & 1)) { \
|
if (!(mask & 1)) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -2888,8 +2887,7 @@ DO_2OP_FP_ALL(vminnma, minnuma)
|
|||||||
r[e] = 0; \
|
r[e] = 0; \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(tm & 1)) { \
|
if (!(tm & 1)) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -2926,8 +2924,7 @@ DO_VCADD_FP(vfcadd270s, 4, float32, float32_add, float32_sub)
|
|||||||
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & 1)) { \
|
if (!(mask & 1)) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -2964,8 +2961,7 @@ DO_VFMA(vfmss, 4, float32, true)
|
|||||||
if ((mask & MAKE_64BIT_MASK(0, ESIZE * 2)) == 0) { \
|
if ((mask & MAKE_64BIT_MASK(0, ESIZE * 2)) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst0 = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst0 = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
fpst1 = fpst0; \
|
fpst1 = fpst0; \
|
||||||
if (!(mask & 1)) { \
|
if (!(mask & 1)) { \
|
||||||
scratch_fpst = *fpst0; \
|
scratch_fpst = *fpst0; \
|
||||||
@ -3049,8 +3045,7 @@ DO_VCMLA(vcmla270s, 4, float32, 3, DO_VCMLAS)
|
|||||||
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & 1)) { \
|
if (!(mask & 1)) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -3084,8 +3079,7 @@ DO_2OP_FP_SCALAR_ALL(vfmul_scalar, mul)
|
|||||||
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & 1)) { \
|
if (!(mask & 1)) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -3116,9 +3110,8 @@ DO_2OP_FP_ACC_SCALAR(vfmas_scalars, 4, float32, DO_VFMAS_SCALARS)
|
|||||||
unsigned e; \
|
unsigned e; \
|
||||||
TYPE *m = vm; \
|
TYPE *m = vm; \
|
||||||
TYPE ra = (TYPE)ra_in; \
|
TYPE ra = (TYPE)ra_in; \
|
||||||
float_status *fpst = (ESIZE == 2) ? \
|
float_status *fpst = \
|
||||||
&env->vfp.fp_status[FPST_STD_F16] : \
|
&env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \
|
for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \
|
||||||
if (mask & 1) { \
|
if (mask & 1) { \
|
||||||
TYPE v = m[H##ESIZE(e)]; \
|
TYPE v = m[H##ESIZE(e)]; \
|
||||||
@ -3168,8 +3161,7 @@ DO_FP_VMAXMINV(vminnmavs, 4, float32, true, float32_minnum)
|
|||||||
if ((mask & emask) == 0) { \
|
if ((mask & emask) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & (1 << (e * ESIZE)))) { \
|
if (!(mask & (1 << (e * ESIZE)))) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -3202,8 +3194,7 @@ DO_FP_VMAXMINV(vminnmavs, 4, float32, true, float32_minnum)
|
|||||||
if ((mask & emask) == 0) { \
|
if ((mask & emask) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & (1 << (e * ESIZE)))) { \
|
if (!(mask & (1 << (e * ESIZE)))) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -3267,8 +3258,7 @@ DO_VCMP_FP_BOTH(vfcmples, vfcmple_scalars, 4, float32, !DO_GT32)
|
|||||||
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & 1)) { \
|
if (!(mask & 1)) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
@ -3300,9 +3290,8 @@ DO_VCVT_FIXED(vcvt_fu, 4, uint32_t, helper_vfp_touls_round_to_zero)
|
|||||||
unsigned e; \
|
unsigned e; \
|
||||||
float_status *fpst; \
|
float_status *fpst; \
|
||||||
float_status scratch_fpst; \
|
float_status scratch_fpst; \
|
||||||
float_status *base_fpst = (ESIZE == 2) ? \
|
float_status *base_fpst = \
|
||||||
&env->vfp.fp_status[FPST_STD_F16] : \
|
&env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
uint32_t prev_rmode = get_float_rounding_mode(base_fpst); \
|
uint32_t prev_rmode = get_float_rounding_mode(base_fpst); \
|
||||||
set_float_rounding_mode(rmode, base_fpst); \
|
set_float_rounding_mode(rmode, base_fpst); \
|
||||||
for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \
|
for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \
|
||||||
@ -3427,8 +3416,7 @@ void HELPER(mve_vcvtt_hs)(CPUARMState *env, void *vd, void *vm)
|
|||||||
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \
|
fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \
|
||||||
&env->vfp.fp_status[FPST_STD]; \
|
|
||||||
if (!(mask & 1)) { \
|
if (!(mask & 1)) { \
|
||||||
/* We need the result but without updating flags */ \
|
/* We need the result but without updating flags */ \
|
||||||
scratch_fpst = *fpst; \
|
scratch_fpst = *fpst; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user