From nobody Sun May 5 01:58:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526923724861820.1568385774424; Mon, 21 May 2018 10:28:44 -0700 (PDT) Received: from localhost ([::1]:51688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKobz-0004ku-W8 for importer@patchew.org; Mon, 21 May 2018 13:28:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKoac-0004AN-GH for qemu-devel@nongnu.org; Mon, 21 May 2018 13:27:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKoab-0007Te-Nj for qemu-devel@nongnu.org; Mon, 21 May 2018 13:27:18 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:42032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fKoaZ-0007S7-NY; Mon, 21 May 2018 13:27:15 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fKoaX-00082A-9r; Mon, 21 May 2018 18:27:13 +0100 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Mon, 21 May 2018 18:27:12 +0100 Message-Id: <20180521172712.19930-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH] target/arm: Honour FPCR.FZ in FRECPX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The FRECPX instructions should (like most other floating point operations) honour the FPCR.FZ bit which specifies whether input denormals should be flushed to zero (or FZ16 for the half-precision version). We forgot to implement this, which doesn't affect the results (since the calculation doesn't actually care about the mantissa bits) but did mean we were failing to set the FPSR.IDC bit. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/helper-a64.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c index f92bdea732..c4d2a04827 100644 --- a/target/arm/helper-a64.c +++ b/target/arm/helper-a64.c @@ -384,6 +384,8 @@ float16 HELPER(frecpx_f16)(float16 a, void *fpstp) return nan; } =20 + a =3D float16_squash_input_denormal(a, fpst); + val16 =3D float16_val(a); sbit =3D 0x8000 & val16; exp =3D extract32(val16, 10, 5); @@ -413,6 +415,8 @@ float32 HELPER(frecpx_f32)(float32 a, void *fpstp) return nan; } =20 + a =3D float32_squash_input_denormal(a, fpst); + val32 =3D float32_val(a); sbit =3D 0x80000000ULL & val32; exp =3D extract32(val32, 23, 8); @@ -442,6 +446,8 @@ float64 HELPER(frecpx_f64)(float64 a, void *fpstp) return nan; } =20 + a =3D float64_squash_input_denormal(a, fpst); + val64 =3D float64_val(a); sbit =3D 0x8000000000000000ULL & val64; exp =3D extract64(float64_val(a), 52, 11); --=20 2.17.0