mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-24 22:25:11 +00:00
target/arm/vfp_helper: Move code around
To ease the review of the next commit, move the vfp_exceptbits_to_host() function directly after vfp_exceptbits_from_host(). Amusingly the diff shows we are moving vfp_get_fpscr(). Backports commit 20e62dd8c831c9065ed4a8e64813c93ad61c50d7 from qemu.
This commit is contained in:
parent
91e264823e
commit
76bae63014
|
@ -57,32 +57,6 @@ static inline int vfp_exceptbits_from_host(int host_bits)
|
||||||
return target_bits;
|
return target_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env)
|
|
||||||
{
|
|
||||||
uint32_t i, fpscr;
|
|
||||||
|
|
||||||
fpscr = env->vfp.xregs[ARM_VFP_FPSCR]
|
|
||||||
| (env->vfp.vec_len << 16)
|
|
||||||
| (env->vfp.vec_stride << 20);
|
|
||||||
|
|
||||||
i = get_float_exception_flags(&env->vfp.fp_status);
|
|
||||||
i |= get_float_exception_flags(&env->vfp.standard_fp_status);
|
|
||||||
/* FZ16 does not generate an input denormal exception. */
|
|
||||||
i |= (get_float_exception_flags(&env->vfp.fp_status_f16)
|
|
||||||
& ~float_flag_input_denormal);
|
|
||||||
fpscr |= vfp_exceptbits_from_host(i);
|
|
||||||
|
|
||||||
i = env->vfp.qc[0] | env->vfp.qc[1] | env->vfp.qc[2] | env->vfp.qc[3];
|
|
||||||
fpscr |= i ? FPCR_QC : 0;
|
|
||||||
|
|
||||||
return fpscr;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t vfp_get_fpscr(CPUARMState *env)
|
|
||||||
{
|
|
||||||
return HELPER(vfp_get_fpscr)(env);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert vfp exception flags to target form. */
|
/* Convert vfp exception flags to target form. */
|
||||||
static inline int vfp_exceptbits_to_host(int target_bits)
|
static inline int vfp_exceptbits_to_host(int target_bits)
|
||||||
{
|
{
|
||||||
|
@ -109,6 +83,32 @@ static inline int vfp_exceptbits_to_host(int target_bits)
|
||||||
return host_bits;
|
return host_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env)
|
||||||
|
{
|
||||||
|
uint32_t i, fpscr;
|
||||||
|
|
||||||
|
fpscr = env->vfp.xregs[ARM_VFP_FPSCR]
|
||||||
|
| (env->vfp.vec_len << 16)
|
||||||
|
| (env->vfp.vec_stride << 20);
|
||||||
|
|
||||||
|
i = get_float_exception_flags(&env->vfp.fp_status);
|
||||||
|
i |= get_float_exception_flags(&env->vfp.standard_fp_status);
|
||||||
|
/* FZ16 does not generate an input denormal exception. */
|
||||||
|
i |= (get_float_exception_flags(&env->vfp.fp_status_f16)
|
||||||
|
& ~float_flag_input_denormal);
|
||||||
|
fpscr |= vfp_exceptbits_from_host(i);
|
||||||
|
|
||||||
|
i = env->vfp.qc[0] | env->vfp.qc[1] | env->vfp.qc[2] | env->vfp.qc[3];
|
||||||
|
fpscr |= i ? FPCR_QC : 0;
|
||||||
|
|
||||||
|
return fpscr;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t vfp_get_fpscr(CPUARMState *env)
|
||||||
|
{
|
||||||
|
return HELPER(vfp_get_fpscr)(env);
|
||||||
|
}
|
||||||
|
|
||||||
void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val)
|
void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
Loading…
Reference in a new issue