mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-06-22 16:47:54 +00:00
target/arm/vfp_helper: Extract vfp_set_fpscr_from_host()
The vfp_set_fpscr() helper contains code specific to the host floating point implementation (here the SoftFloat library). Extract this code to vfp_set_fpscr_from_host(). Backports commit 0c6ad94809b37a1f0f1f75d3cd0e4a24fb77e65c from qemu
This commit is contained in:
parent
2b5d731f56
commit
4e214e5d64
|
@ -83,6 +83,18 @@ static inline int vfp_exceptbits_to_host(int target_bits)
|
||||||
return host_bits;
|
return host_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t vfp_get_fpscr_from_host(CPUARMState *env)
|
||||||
|
{
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
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);
|
||||||
|
return vfp_exceptbits_from_host(i);
|
||||||
|
}
|
||||||
|
|
||||||
static void vfp_set_fpscr_to_host(CPUARMState *env, uint32_t val)
|
static void vfp_set_fpscr_to_host(CPUARMState *env, uint32_t val)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -143,12 +155,7 @@ uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env)
|
||||||
| (env->vfp.vec_len << 16)
|
| (env->vfp.vec_len << 16)
|
||||||
| (env->vfp.vec_stride << 20);
|
| (env->vfp.vec_stride << 20);
|
||||||
|
|
||||||
i = get_float_exception_flags(&env->vfp.fp_status);
|
fpscr |= vfp_get_fpscr_from_host(env);
|
||||||
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];
|
i = env->vfp.qc[0] | env->vfp.qc[1] | env->vfp.qc[2] | env->vfp.qc[3];
|
||||||
fpscr |= i ? FPCR_QC : 0;
|
fpscr |= i ? FPCR_QC : 0;
|
||||||
|
|
Loading…
Reference in a new issue