From nobody Tue Feb 10 22:17:38 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15079123425891003.6601087431509; Fri, 13 Oct 2017 09:32:22 -0700 (PDT) Received: from localhost ([::1]:51059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e32sj-0000Gj-S8 for importer@patchew.org; Fri, 13 Oct 2017 12:32:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e32ld-0002cy-Po for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e32lZ-0006bL-8Z for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:24:57 -0400 Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]:54683) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e32lZ-0006ak-2N for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:24:53 -0400 Received: by mail-wr0-x233.google.com with SMTP id o44so1427033wrf.11 for ; Fri, 13 Oct 2017 09:24:52 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a34sm3466724wra.64.2017.10.13.09.24.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 09:24:48 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 131903E0899; Fri, 13 Oct 2017 17:24:39 +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=HeMI3G4s0BPN1NotGhq0tBi6MXXSlwpVMAwWeGBeoTo=; b=QpslxyNDSBZ8lywHLIylgjxkUnzov8qA6ACb5km2okuQKpoES21bCTqeCpN3FjOil9 w8T+ESMF/oGKBY1/CuAQJRGaOYgJW59ONqLuv8H8FQx7jLFuPhTrXXlKSDjlLB4qWezl HS7t92BJnR1IgivEW/8DhLcN710Irmmuf69oE= 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=HeMI3G4s0BPN1NotGhq0tBi6MXXSlwpVMAwWeGBeoTo=; b=ZwPMWOBam4Sf8agMFLQM1z/rbK3QlT1BRvUIL2wGkNKi4MdrYCGgXNvh2DO9qpzJBz QMgPaUy9OZyV5hl0aADxUbLMSiS/1DkfQPuYwoPBRY2Kg4Snqy8rwK4jL8dUx9EDvPnG AsjN6yx/368nCecWWvMHE4X/G4WRQtfejP5+GC+PL9k2SxR5uQKI+sTeme+8+D5uSmDB Db8tMaqbFBqjBazZ5wWlrI4JNwm2EMEKAzS/2//TVtvwihZql/pkhepSRwrM65JE8ujL IH0AgKo5AvxZwLzy5duYRMBSxUK+CQzSsk13T6LtlupioSgcNEUU4bw71Wl+mTaSiOJg qpZA== X-Gm-Message-State: AMCzsaX2pIYZNhwOkl+Gi5iS2XW40rSg3V6KL+o1CONCtKAE7bva9qUB IrhskGFddSUXv8dIzqZfGb5VLw== X-Google-Smtp-Source: AOwi7QCv2o6VDU6p62S36IE40CNFT+E+0I95aKF6OHExxN0YRvcO6aIHvMsMI7WCg44vfP0V2Kj8KA== X-Received: by 10.223.134.154 with SMTP id 26mr2046858wrx.137.1507911892023; Fri, 13 Oct 2017 09:24:52 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: richard.henderson@linaro.org Date: Fri, 13 Oct 2017 17:24:17 +0100 Message-Id: <20171013162438.32458-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013162438.32458-1-alex.bennee@linaro.org> References: <20171013162438.32458-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::233 Subject: [Qemu-devel] [RFC PATCH 09/30] softfloat: propagate signalling NaNs in MINMAX 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: peter.maydell@linaro.org, qemu-arm@nongnu.org, =?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 While a comparison between a QNaN and a number will return the number it is not the same with a signaling NaN. In this case the SNaN will "win" and after potentially raising an exception it will be quietened. Signed-off-by: Alex Benn=C3=A9e --- fpu/softfloat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 013b223947..6ab4b39c09 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -7684,6 +7684,7 @@ int float128_compare_quiet(float128 a, float128 b, fl= oat_status *status) * minnum() and maxnum() functions. These are similar to the min() * and max() functions but if one of the arguments is a QNaN and * the other is numerical then the numerical argument is returned. + * SNaNs will get quietened before being returned. * minnum() and maxnum correspond to the IEEE 754-2008 minNum() * and maxNum() operations. min() and max() are the typical min/max * semantics provided by many CPUs which predate that specification. @@ -7704,11 +7705,14 @@ static inline float ## s float ## s ## _minmax(floa= t ## s a, float ## s b, \ if (float ## s ## _is_any_nan(a) || \ float ## s ## _is_any_nan(b)) { \ if (isieee) { \ - if (float ## s ## _is_quiet_nan(a, status) && \ + if (float ## s ## _is_signaling_nan(a, status) || \ + float ## s ## _is_signaling_nan(b, status)) { \ + propagateFloat ## s ## NaN(a, b, status); \ + } else if (float ## s ## _is_quiet_nan(a, status) && \ !float ## s ##_is_any_nan(b)) { \ return b; \ } else if (float ## s ## _is_quiet_nan(b, status) && \ - !float ## s ## _is_any_nan(a)) { \ + !float ## s ## _is_any_nan(a)) { \ return a; \ } \ } \ --=20 2.14.1