mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 17:35:33 +00:00
target-mips: Add missing calls to synchronise SoftFloat status
Add missing calls to synchronise the SoftFloat status with the CP1.FSCR: + for the rounding and flush-to-zero modes upon processor reset, + for the flush-to-zero mode on FSCR updates through the GDB stub. Refactor code accordingly and remove the redundant RESTORE_ROUNDING_MODE macro. Backports commit bb962386b82c1b0e9e12fdb6b9bb62106bf1f822 from qemu
This commit is contained in:
parent
e4ce0e92b1
commit
e97c07cdca
|
@ -771,6 +771,19 @@ target_ulong exception_resume_pc (CPUMIPSState *env);
|
||||||
extern unsigned int ieee_rm[];
|
extern unsigned int ieee_rm[];
|
||||||
int ieee_ex_to_mips(int xcpt);
|
int ieee_ex_to_mips(int xcpt);
|
||||||
|
|
||||||
|
static inline void restore_rounding_mode(CPUMIPSState *env)
|
||||||
|
{
|
||||||
|
set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3],
|
||||||
|
&env->active_fpu.fp_status);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void restore_flush_mode(CPUMIPSState *env)
|
||||||
|
{
|
||||||
|
set_flush_to_zero((env->active_fpu.fcr31 & (1 << 24)) != 0,
|
||||||
|
&env->active_fpu.fp_status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
|
static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
|
||||||
target_ulong *cs_base, int *flags)
|
target_ulong *cs_base, int *flags)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2283,18 +2283,6 @@ unsigned int ieee_rm[] = {
|
||||||
float_round_down
|
float_round_down
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void restore_rounding_mode(CPUMIPSState *env)
|
|
||||||
{
|
|
||||||
set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3],
|
|
||||||
&env->active_fpu.fp_status);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void restore_flush_mode(CPUMIPSState *env)
|
|
||||||
{
|
|
||||||
set_flush_to_zero((env->active_fpu.fcr31 & (1 << 24)) != 0,
|
|
||||||
&env->active_fpu.fp_status);
|
|
||||||
}
|
|
||||||
|
|
||||||
target_ulong helper_cfc1(CPUMIPSState *env, uint32_t reg)
|
target_ulong helper_cfc1(CPUMIPSState *env, uint32_t reg)
|
||||||
{
|
{
|
||||||
target_ulong arg1 = 0;
|
target_ulong arg1 = 0;
|
||||||
|
|
|
@ -19826,6 +19826,8 @@ void cpu_state_reset(CPUMIPSState *env)
|
||||||
}
|
}
|
||||||
|
|
||||||
compute_hflags(env);
|
compute_hflags(env);
|
||||||
|
restore_rounding_mode(env);
|
||||||
|
restore_flush_mode(env);
|
||||||
cs->exception_index = EXCP_NONE;
|
cs->exception_index = EXCP_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue