summaryrefslogtreecommitdiff
path: root/target-mips/op_helper.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-28 22:22:40 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-28 22:22:40 +0000
commit41e0c701599de298beec6853f9bb055365e51174 (patch)
tree855c8e0721054e8222ffc771ad2a73240a6a0f76 /target-mips/op_helper.c
parent36556b20c5c9a02f5e238435cd41bf67740359ee (diff)
target-mips: implement FPU Flush-To-Zero mode
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6914 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/op_helper.c')
-rw-r--r--target-mips/op_helper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 0162ac177..b28ee933f 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -1879,6 +1879,9 @@ unsigned int ieee_rm[] = {
#define RESTORE_ROUNDING_MODE \
set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3], &env->active_fpu.fp_status)
+#define RESTORE_FLUSH_MODE \
+ set_flush_to_zero((env->active_fpu.fcr31 & (1 << 24)) != 0, &env->active_fpu.fp_status);
+
target_ulong helper_cfc1 (uint32_t reg)
{
target_ulong t0;
@@ -1934,6 +1937,8 @@ void helper_ctc1 (target_ulong t0, uint32_t reg)
}
/* set rounding mode */
RESTORE_ROUNDING_MODE;
+ /* set flush-to-zero mode */
+ RESTORE_FLUSH_MODE;
set_float_exception_flags(0, &env->active_fpu.fp_status);
if ((GET_FP_ENABLE(env->active_fpu.fcr31) | 0x20) & GET_FP_CAUSE(env->active_fpu.fcr31))
helper_raise_exception(EXCP_FPE);