From nobody Tue Feb 10 04:15:00 2026 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; dkim=fail; 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 1523628341262624.6401688576101; Fri, 13 Apr 2018 07:05:41 -0700 (PDT) Received: from localhost ([::1]:55964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6zKa-0004EX-B3 for importer@patchew.org; Fri, 13 Apr 2018 10:05:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6zIl-00037P-PH for qemu-devel@nongnu.org; Fri, 13 Apr 2018 10:03:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6zIf-0000bO-Vc for qemu-devel@nongnu.org; Fri, 13 Apr 2018 10:03:43 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:35317) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6zIf-0000b6-Or for qemu-devel@nongnu.org; Fri, 13 Apr 2018 10:03:37 -0400 Received: by mail-wr0-x241.google.com with SMTP id o3so8435937wri.2 for ; Fri, 13 Apr 2018 07:03:37 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l131sm3623179wmb.36.2018.04.13.07.03.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 07:03:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 3E4873E061C; Fri, 13 Apr 2018 15:03:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7EujjhTl4udGdJbhRHyWMrTYrxgmGjapgU23kkosbxs=; b=d1uzxxYZyizcYgh4AATAqFktEWXqN95tRaokTxI/lE93ee+aJg3lysJd92QIYxSv1o H7VVYDPEno1fvttamO/X4D7ptsLpadbWUJs4Nzb9BKUcuPKpCjlC6FwAuxk0JQ1hgUCQ LEYD1diO2s6UkskT+zXwA5uWEPjBm9xZLSsRc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7EujjhTl4udGdJbhRHyWMrTYrxgmGjapgU23kkosbxs=; b=VoWRzKrJcGpeuWJYq8vCUpts2nj2tSoj3vUccxagqh+j63Gh04EFtmUWufWe47XFxy Jm4J4jHeYEvrAblNWQb1rjaIvHPZD3Z8Fu26sHf2pBLReceix6a+SpeI+pnfdq6TPQoI 2Hi6DtYK+0ikD6gLuGqfS58OBi859GZSciSFCW/aWqZGxbEkZ75T/Km76jK3SmdTDo0x 1dZwdmkqHHi8jUbW3txeML0hCkH+qXYuJfWaANG2rRa8OcmKAUjBqXl+fQkzp4Haelab NWn87GHS3yN8hO96DHu8tIbOG2AoRu1tlGyOb3DDlvLcRl7jcCyefYnrycOBnSej1Snk hGwg== X-Gm-Message-State: ALQs6tAAjvnsO/e8b848WJ7A/Fsx+Y2xPv6rPffuoHHs5K7RmlMecNcA zTzgDLanA4htREgYixPw3DTxIg== X-Google-Smtp-Source: AIpwx4/Cs1kKXTXoYsrOVCNCA8+yMNtFaIf+q8nHWAzu225XiUJ9yPi1c5qOyYxBYryd5QzXanm9eA== X-Received: by 10.223.146.69 with SMTP id 63mr142067wrj.156.1523628216620; Fri, 13 Apr 2018 07:03:36 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 13 Apr 2018 15:03:34 +0100 Message-Id: <20180413140334.26622-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180413140334.26622-1-alex.bennee@linaro.org> References: <20180413140334.26622-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 2/2] fpu/softfloat: raise float_invalid for NaN/Inf in round_to_int_and_pack 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: Bastian Koppelmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 The re-factor broke the raising of INVALID when NaN/Inf is passed to the float_to_int conversion functions. round_to_uint_and_pack got this right for NaN but also missed out the Inf handling. Fixes https://bugs.launchpad.net/qemu/+bug/1759264 Signed-off-by: Alex Benn=C3=A9e Cc: Bastian Koppelmann Reviewed-by: Bastian Koppelmann Reviewed-by: Peter Maydell Tested-by: Bastian Koppelmann --- fpu/softfloat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 9b99aa6ec8..fb8663f59e 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1344,8 +1344,10 @@ static int64_t round_to_int_and_pack(FloatParts in, = int rmode, case float_class_qnan: case float_class_dnan: case float_class_msnan: + s->float_exception_flags =3D orig_flags | float_flag_invalid; return max; case float_class_inf: + s->float_exception_flags =3D orig_flags | float_flag_invalid; return p.sign ? min : max; case float_class_zero: return 0; @@ -1437,6 +1439,7 @@ static uint64_t round_to_uint_and_pack(FloatParts in,= int rmode, uint64_t max, s->float_exception_flags =3D orig_flags | float_flag_invalid; return max; case float_class_inf: + s->float_exception_flags =3D orig_flags | float_flag_invalid; return p.sign ? 0 : max; case float_class_zero: return 0; --=20 2.17.0