mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
target/arm: Remove fp_status_a32
Replace with fp_status[FPST_A32]. As this was the last of the old structures, we can remove the anonymous union and struct. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20250129013857.135256-15-richard.henderson@linaro.org [PMM: tweak to account for change to is_ebf()] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
1c349f43b1
commit
54afbf6632
4 changed files with 12 additions and 17 deletions
|
@ -550,7 +550,7 @@ static void arm_cpu_reset_hold(Object *obj, ResetType type)
|
||||||
set_flush_inputs_to_zero(1, &env->vfp.fp_status[FPST_STD]);
|
set_flush_inputs_to_zero(1, &env->vfp.fp_status[FPST_STD]);
|
||||||
set_default_nan_mode(1, &env->vfp.fp_status[FPST_STD]);
|
set_default_nan_mode(1, &env->vfp.fp_status[FPST_STD]);
|
||||||
set_default_nan_mode(1, &env->vfp.fp_status[FPST_STD_F16]);
|
set_default_nan_mode(1, &env->vfp.fp_status[FPST_STD_F16]);
|
||||||
arm_set_default_fp_behaviours(&env->vfp.fp_status_a32);
|
arm_set_default_fp_behaviours(&env->vfp.fp_status[FPST_A32]);
|
||||||
arm_set_default_fp_behaviours(&env->vfp.fp_status[FPST_A64]);
|
arm_set_default_fp_behaviours(&env->vfp.fp_status[FPST_A64]);
|
||||||
arm_set_default_fp_behaviours(&env->vfp.fp_status[FPST_STD]);
|
arm_set_default_fp_behaviours(&env->vfp.fp_status[FPST_STD]);
|
||||||
arm_set_default_fp_behaviours(&env->vfp.fp_status[FPST_A32_F16]);
|
arm_set_default_fp_behaviours(&env->vfp.fp_status[FPST_A32_F16]);
|
||||||
|
|
|
@ -687,12 +687,7 @@ typedef struct CPUArchState {
|
||||||
uint32_t scratch[8];
|
uint32_t scratch[8];
|
||||||
|
|
||||||
/* There are a number of distinct float control structures. */
|
/* There are a number of distinct float control structures. */
|
||||||
union {
|
float_status fp_status[FPST_COUNT];
|
||||||
float_status fp_status[FPST_COUNT];
|
|
||||||
struct {
|
|
||||||
float_status fp_status_a32;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
uint64_t zcr_el[4]; /* ZCR_EL[1-3] */
|
uint64_t zcr_el[4]; /* ZCR_EL[1-3] */
|
||||||
uint64_t smcr_el[4]; /* SMCR_EL[1-3] */
|
uint64_t smcr_el[4]; /* SMCR_EL[1-3] */
|
||||||
|
|
|
@ -2951,7 +2951,7 @@ bool is_ebf(CPUARMState *env, float_status *statusp, float_status *oddstatusp)
|
||||||
*/
|
*/
|
||||||
bool ebf = is_a64(env) && env->vfp.fpcr & FPCR_EBF;
|
bool ebf = is_a64(env) && env->vfp.fpcr & FPCR_EBF;
|
||||||
|
|
||||||
*statusp = is_a64(env) ? env->vfp.fp_status[FPST_A64] : env->vfp.fp_status_a32;
|
*statusp = env->vfp.fp_status[is_a64(env) ? FPST_A64 : FPST_A32];
|
||||||
set_default_nan_mode(true, statusp);
|
set_default_nan_mode(true, statusp);
|
||||||
|
|
||||||
if (ebf) {
|
if (ebf) {
|
||||||
|
|
|
@ -117,7 +117,7 @@ static uint32_t vfp_get_fpsr_from_host(CPUARMState *env)
|
||||||
{
|
{
|
||||||
uint32_t a32_flags = 0, a64_flags = 0;
|
uint32_t a32_flags = 0, a64_flags = 0;
|
||||||
|
|
||||||
a32_flags |= get_float_exception_flags(&env->vfp.fp_status_a32);
|
a32_flags |= get_float_exception_flags(&env->vfp.fp_status[FPST_A32]);
|
||||||
a32_flags |= get_float_exception_flags(&env->vfp.fp_status[FPST_STD]);
|
a32_flags |= get_float_exception_flags(&env->vfp.fp_status[FPST_STD]);
|
||||||
/* FZ16 does not generate an input denormal exception. */
|
/* FZ16 does not generate an input denormal exception. */
|
||||||
a32_flags |= (get_float_exception_flags(&env->vfp.fp_status[FPST_A32_F16])
|
a32_flags |= (get_float_exception_flags(&env->vfp.fp_status[FPST_A32_F16])
|
||||||
|
@ -155,7 +155,7 @@ static void vfp_clear_float_status_exc_flags(CPUARMState *env)
|
||||||
* values. The caller should have arranged for env->vfp.fpsr to
|
* values. The caller should have arranged for env->vfp.fpsr to
|
||||||
* be the architecturally up-to-date exception flag information first.
|
* be the architecturally up-to-date exception flag information first.
|
||||||
*/
|
*/
|
||||||
set_float_exception_flags(0, &env->vfp.fp_status_a32);
|
set_float_exception_flags(0, &env->vfp.fp_status[FPST_A32]);
|
||||||
set_float_exception_flags(0, &env->vfp.fp_status[FPST_A64]);
|
set_float_exception_flags(0, &env->vfp.fp_status[FPST_A64]);
|
||||||
set_float_exception_flags(0, &env->vfp.fp_status[FPST_A32_F16]);
|
set_float_exception_flags(0, &env->vfp.fp_status[FPST_A32_F16]);
|
||||||
set_float_exception_flags(0, &env->vfp.fp_status[FPST_A64_F16]);
|
set_float_exception_flags(0, &env->vfp.fp_status[FPST_A64_F16]);
|
||||||
|
@ -198,7 +198,7 @@ static void vfp_set_fpcr_to_host(CPUARMState *env, uint32_t val, uint32_t mask)
|
||||||
i = float_round_to_zero;
|
i = float_round_to_zero;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
set_float_rounding_mode(i, &env->vfp.fp_status_a32);
|
set_float_rounding_mode(i, &env->vfp.fp_status[FPST_A32]);
|
||||||
set_float_rounding_mode(i, &env->vfp.fp_status[FPST_A64]);
|
set_float_rounding_mode(i, &env->vfp.fp_status[FPST_A64]);
|
||||||
set_float_rounding_mode(i, &env->vfp.fp_status[FPST_A32_F16]);
|
set_float_rounding_mode(i, &env->vfp.fp_status[FPST_A32_F16]);
|
||||||
set_float_rounding_mode(i, &env->vfp.fp_status[FPST_A64_F16]);
|
set_float_rounding_mode(i, &env->vfp.fp_status[FPST_A64_F16]);
|
||||||
|
@ -216,10 +216,10 @@ static void vfp_set_fpcr_to_host(CPUARMState *env, uint32_t val, uint32_t mask)
|
||||||
}
|
}
|
||||||
if (changed & FPCR_FZ) {
|
if (changed & FPCR_FZ) {
|
||||||
bool ftz_enabled = val & FPCR_FZ;
|
bool ftz_enabled = val & FPCR_FZ;
|
||||||
set_flush_to_zero(ftz_enabled, &env->vfp.fp_status_a32);
|
set_flush_to_zero(ftz_enabled, &env->vfp.fp_status[FPST_A32]);
|
||||||
set_flush_to_zero(ftz_enabled, &env->vfp.fp_status[FPST_A64]);
|
set_flush_to_zero(ftz_enabled, &env->vfp.fp_status[FPST_A64]);
|
||||||
/* FIZ is A64 only so FZ always makes A32 code flush inputs to zero */
|
/* FIZ is A64 only so FZ always makes A32 code flush inputs to zero */
|
||||||
set_flush_inputs_to_zero(ftz_enabled, &env->vfp.fp_status_a32);
|
set_flush_inputs_to_zero(ftz_enabled, &env->vfp.fp_status[FPST_A32]);
|
||||||
}
|
}
|
||||||
if (changed & (FPCR_FZ | FPCR_AH | FPCR_FIZ)) {
|
if (changed & (FPCR_FZ | FPCR_AH | FPCR_FIZ)) {
|
||||||
/*
|
/*
|
||||||
|
@ -232,7 +232,7 @@ static void vfp_set_fpcr_to_host(CPUARMState *env, uint32_t val, uint32_t mask)
|
||||||
}
|
}
|
||||||
if (changed & FPCR_DN) {
|
if (changed & FPCR_DN) {
|
||||||
bool dnan_enabled = val & FPCR_DN;
|
bool dnan_enabled = val & FPCR_DN;
|
||||||
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status_a32);
|
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status[FPST_A32]);
|
||||||
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status[FPST_A64]);
|
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status[FPST_A64]);
|
||||||
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status[FPST_A32_F16]);
|
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status[FPST_A32_F16]);
|
||||||
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status[FPST_A64_F16]);
|
set_default_nan_mode(dnan_enabled, &env->vfp.fp_status[FPST_A64_F16]);
|
||||||
|
@ -497,8 +497,8 @@ void VFP_HELPER(cmpe, P)(ARGTYPE a, ARGTYPE b, CPUARMState *env) \
|
||||||
FLOATTYPE ## _compare(a, b, &env->vfp.FPST)); \
|
FLOATTYPE ## _compare(a, b, &env->vfp.FPST)); \
|
||||||
}
|
}
|
||||||
DO_VFP_cmp(h, float16, dh_ctype_f16, fp_status[FPST_A32_F16])
|
DO_VFP_cmp(h, float16, dh_ctype_f16, fp_status[FPST_A32_F16])
|
||||||
DO_VFP_cmp(s, float32, float32, fp_status_a32)
|
DO_VFP_cmp(s, float32, float32, fp_status[FPST_A32])
|
||||||
DO_VFP_cmp(d, float64, float64, fp_status_a32)
|
DO_VFP_cmp(d, float64, float64, fp_status[FPST_A32])
|
||||||
#undef DO_VFP_cmp
|
#undef DO_VFP_cmp
|
||||||
|
|
||||||
/* Integer to float and float to integer conversions */
|
/* Integer to float and float to integer conversions */
|
||||||
|
@ -1385,7 +1385,7 @@ uint64_t HELPER(fjcvtzs)(float64 value, float_status *status)
|
||||||
|
|
||||||
uint32_t HELPER(vjcvt)(float64 value, CPUARMState *env)
|
uint32_t HELPER(vjcvt)(float64 value, CPUARMState *env)
|
||||||
{
|
{
|
||||||
uint64_t pair = HELPER(fjcvtzs)(value, &env->vfp.fp_status_a32);
|
uint64_t pair = HELPER(fjcvtzs)(value, &env->vfp.fp_status[FPST_A32]);
|
||||||
uint32_t result = pair;
|
uint32_t result = pair;
|
||||||
uint32_t z = (pair >> 32) == 0;
|
uint32_t z = (pair >> 32) == 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue