Patchwork [2/2] target-arm: Detect tininess before rounding for FP operations

login
register
mail settings
Submitter Peter Maydell
Date April 12, 2011, 12:56 p.m.
Message ID <1302613001-17540-3-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/90789/
State New
Headers show

Comments

Peter Maydell - April 12, 2011, 12:56 p.m.
The ARM architecture mandates that we detect tininess before rounding,
so set the softfloat fp_status up appropriately.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/helper.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/target-arm/helper.c b/target-arm/helper.c
index ce9a9d8..9172fc7 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -269,6 +269,10 @@  void cpu_reset(CPUARMState *env)
     set_flush_to_zero(1, &env->vfp.standard_fp_status);
     set_flush_inputs_to_zero(1, &env->vfp.standard_fp_status);
     set_default_nan_mode(1, &env->vfp.standard_fp_status);
+    set_float_detect_tininess(float_tininess_before_rounding,
+                              &env->vfp.fp_status);
+    set_float_detect_tininess(float_tininess_before_rounding,
+                              &env->vfp.standard_fp_status);
     tlb_flush(env, 1);
 }