Patchwork [v2,5/6] target-arm: Signal Underflow when denormal flushed to zero on output

login
register
mail settings
Submitter Peter Maydell
Date May 19, 2011, 1:46 p.m.
Message ID <1305812779-23175-6-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/96400/
State New
Headers show

Comments

Peter Maydell - May 19, 2011, 1:46 p.m.
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>
---
 target-arm/helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/target-arm/helper.c b/target-arm/helper.c
index f072527..05b3ccc 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -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;