Received: from eggs.gnu.org ([2001:4830:134:3::10]:49694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJN1a-0001OP-L0 for qemu-devel@nongnu.org; Thu, 05 Feb 2015 09:03:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJN1Y-0007Sz-FW for qemu-devel@nongnu.org; Thu, 05 Feb 2015 09:03:18 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJN1Y-0007RD-8i for qemu-devel@nongnu.org; Thu, 05 Feb 2015 09:03:16 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YJN1R-000310-06 for qemu-devel@nongnu.org; Thu, 05 Feb 2015 14:03:09 +0000 From: Peter Maydell Date: Thu, 5 Feb 2015 14:03:07 +0000 Message-Id: <1423144987-11425-29-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1423144987-11425-1-git-send-email-peter.maydell@linaro.org> References: <1423144987-11425-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 28/28] target-arm: fix for exponent comparison in recpe_f64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Ildar Isaev 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 Signed-off-by: Peter Maydell --- 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