]> git.proxmox.com Git - qemu.git/commitdiff
target-sh4: implement flush-to-zero
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 14 Jan 2011 19:39:18 +0000 (20:39 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 14 Jan 2011 19:39:18 +0000 (20:39 +0100)
When the FPSCR.DN bit is set, the SH4 FPU treat denormalized numbers as
zero. Enable the corresponding softfloat option when this bit is set.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-sh4/op_helper.c
target-sh4/translate.c

index d69b94b0b14d1f402dc7998041fff04c75929e33..9025a2916ae5eef21ec7c399cf1252d957ba71f3 100644 (file)
@@ -449,6 +449,7 @@ void helper_ld_fpscr(uint32_t val)
     } else {
        set_float_rounding_mode(float_round_nearest_even, &env->fp_status);
     }
+    set_flush_to_zero((val & FPSCR_DN) != 0, &env->fp_status);
 }
 
 uint32_t helper_fabs_FT(uint32_t t0)
index d4cd0a3f865d5527a2a8a2ebf6a54a06271dfb5a..8b2f1fc3ed247c10dabc5510a5616dc1e445639d 100644 (file)
@@ -205,6 +205,7 @@ static void cpu_sh4_reset(CPUSH4State * env)
 #else
     env->fpscr = FPSCR_DN | FPSCR_RM_ZERO; /* CPU reset value according to SH4 manual */
     set_float_rounding_mode(float_round_to_zero, &env->fp_status);
+    set_flush_to_zero(1, &env->fp_status);
 #endif
     set_default_nan_mode(1, &env->fp_status);
     env->mmucr = 0;