From 3a3b925d4724e729a7cfe33c4f61e346252a2a2f Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Tue, 9 Sep 2008 19:02:49 +0000 Subject: Implement ldxfsr/stxfsr, fix ld(x)fsr masks, convert to TCG git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5185 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/op_helper.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'target-sparc/op_helper.c') diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index 75020a92f2..75d648bab1 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -2487,11 +2487,10 @@ void helper_stqf(target_ulong addr, int mem_idx) #endif } -void helper_ldfsr(void) +static inline void set_fsr(void) { int rnd_mode; - PUT_FSR32(env, *((uint32_t *) &FT0)); switch (env->fsr & FSR_RD_MASK) { case FSR_RD_NEAREST: rnd_mode = float_round_nearest_even; @@ -2510,11 +2509,20 @@ void helper_ldfsr(void) set_float_rounding_mode(rnd_mode, &env->fp_status); } -void helper_stfsr(void) +void helper_ldfsr(uint32_t new_fsr) { - *((uint32_t *) &FT0) = GET_FSR32(env); + env->fsr = (new_fsr & FSR_LDFSR_MASK) | (env->fsr & FSR_LDFSR_OLDMASK); + set_fsr(); } +#ifdef TARGET_SPARC64 +void helper_ldxfsr(uint64_t new_fsr) +{ + env->fsr = (new_fsr & FSR_LDXFSR_MASK) | (env->fsr & FSR_LDXFSR_OLDMASK); + set_fsr(); +} +#endif + void helper_debug(void) { env->exception_index = EXCP_DEBUG; -- cgit v1.2.3