diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-09 19:02:49 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-09 19:02:49 +0000 |
commit | 3a3b925d4724e729a7cfe33c4f61e346252a2a2f (patch) | |
tree | 832d76a4e6fa102330b4c7899c0d4c9863275934 /target-sparc/op_helper.c | |
parent | 6f9e38017c6a690284bd6634019477193ba8d142 (diff) |
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
Diffstat (limited to 'target-sparc/op_helper.c')
-rw-r--r-- | target-sparc/op_helper.c | 16 |
1 files changed, 12 insertions, 4 deletions
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; |