From 04cd79625fa4103c5839ba36ad476dd22f7f7557 Mon Sep 17 00:00:00 2001 From: Leon Alrae Date: Fri, 20 Feb 2015 13:07:44 +0000 Subject: target-mips: replace cpu_save/cpu_load with VMStateDescription Create VMStateDescription for MIPS CPU. The new structure contains exactly the same fields as before, therefore leaving existing version_id. Signed-off-by: Leon Alrae --- target-mips/cpu.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'target-mips/cpu.h') diff --git a/target-mips/cpu.h b/target-mips/cpu.h index 5ea61bceea..59a2373245 100644 --- a/target-mips/cpu.h +++ b/target-mips/cpu.h @@ -614,8 +614,6 @@ void mips_cpu_list (FILE *f, fprintf_function cpu_fprintf); extern void cpu_wrdsp(uint32_t rs, uint32_t mask_num, CPUMIPSState *env); extern uint32_t cpu_rddsp(uint32_t mask_num, CPUMIPSState *env); -#define CPU_SAVE_VERSION 5 - /* MMU modes definitions. We carefully match the indices with our hflags layout. */ #define MMU_MODE0_SUFFIX _kernel -- cgit v1.2.3 From 644511117e7ca9f26d633a59c202a297113a796c Mon Sep 17 00:00:00 2001 From: Leon Alrae Date: Fri, 20 Feb 2015 13:07:45 +0000 Subject: target-mips: add missing MSACSR and restore fp_status and hflags Save MSACSR state. Also remove fp_status, msa_fp_status, hflags and restore them in post_load() from the architectural registers. Float exception flags are not present in vmstate. Information they carry is used only by softfloat caller who translates them into MIPS FCSR.Cause, FCSR.Flags and then they are cleared. Therefore there is no need for saving them in vmstate. Signed-off-by: Leon Alrae Reviewed-by: Richard Henderson --- target-mips/cpu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'target-mips/cpu.h') diff --git a/target-mips/cpu.h b/target-mips/cpu.h index 59a2373245..283a546854 100644 --- a/target-mips/cpu.h +++ b/target-mips/cpu.h @@ -786,6 +786,23 @@ static inline void restore_flush_mode(CPUMIPSState *env) &env->active_fpu.fp_status); } +static inline void restore_fp_status(CPUMIPSState *env) +{ + restore_rounding_mode(env); + restore_flush_mode(env); +} + +static inline void restore_msa_fp_status(CPUMIPSState *env) +{ + float_status *status = &env->active_tc.msa_fp_status; + int rounding_mode = (env->active_tc.msacsr & MSACSR_RM_MASK) >> MSACSR_RM; + bool flush_to_zero = (env->active_tc.msacsr & MSACSR_FS_MASK) != 0; + + set_float_rounding_mode(ieee_rm[rounding_mode], status); + set_flush_to_zero(flush_to_zero, status); + set_flush_inputs_to_zero(flush_to_zero, status); +} + static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc, target_ulong *cs_base, int *flags) { -- cgit v1.2.3