qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 28/28] target-arm: fix for exponent comparison in rec


From: Peter Maydell
Subject: [Qemu-devel] [PULL 28/28] target-arm: fix for exponent comparison in recpe_f64
Date: Thu, 5 Feb 2015 14:03:07 +0000

From: Ildar Isaev <address@hidden>

f64 exponent in HELPER(recpe_f64) should be compared to 2045 rather than 1023
(FPRecipEstimate in ARMV8 spec). This fixes incorrect underflow handling when
flushing denormals to zero in the FRECPE instructions operating on 64-bit
values.

Signed-off-by: Ildar Isaev <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
 target-arm/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-arm/helper.c b/target-arm/helper.c
index d930021..1a1a005 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -6526,7 +6526,7 @@ float64 HELPER(recpe_f64)(float64 input, void *fpstp)
         } else {
             return float64_set_sign(float64_maxnorm, float64_is_neg(f64));
         }
-    } else if (f64_exp >= 1023 && fpst->flush_to_zero) {
+    } else if (f64_exp >= 2045 && fpst->flush_to_zero) {
         float_raise(float_flag_underflow, fpst);
         return float64_set_sign(float64_zero, float64_is_neg(f64));
     }
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]