target-arm: Signal Underflow when denormal flushed to zero on output
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 19 May 2011 13:46:18 +0000 (14:46 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Mon, 23 May 2011 20:39:36 +0000 (22:39 +0200)
On ARM the architecture mandates that when an output denormal is flushed to
zero we must set the FPSCR UFC (underflow) bit, so map softfloat's
float_flag_output_denormal accordingly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm/helper.c

index f07252768a4268dc04ad784fd25e0b2d16ded42f..05b3ccca2d05ffdddb633d2a7ad4ac56679a64d5 100644 (file)
@@ -2355,7 +2355,7 @@ static inline int vfp_exceptbits_from_host(int host_bits)
         target_bits |= 2;
     if (host_bits & float_flag_overflow)
         target_bits |= 4;
-    if (host_bits & float_flag_underflow)
+    if (host_bits & (float_flag_underflow | float_flag_output_denormal))
         target_bits |= 8;
     if (host_bits & float_flag_inexact)
         target_bits |= 0x10;