From nobody Thu Oct 30 15:33:06 2025 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 1525999779006947.518427757109; Thu, 10 May 2018 17:49:39 -0700 (PDT) Received: from localhost ([::1]:36180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGwFe-0004NC-6D for importer@patchew.org; Thu, 10 May 2018 20:49:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGwAN-0007Jv-FJ for qemu-devel@nongnu.org; Thu, 10 May 2018 20:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGwAL-0004tQ-UI for qemu-devel@nongnu.org; Thu, 10 May 2018 20:44:11 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:41024) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGwAL-0004tF-Og for qemu-devel@nongnu.org; Thu, 10 May 2018 20:44:09 -0400 Received: by mail-pf0-x244.google.com with SMTP id v63-v6so1861862pfk.8 for ; Thu, 10 May 2018 17:44:09 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id y24-v6sm4216728pfn.23.2018.05.10.17.44.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 17:44:07 -0700 (PDT) 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; bh=xAOPy8F+Mz2BqbptFVIU6iCHdlg7tOjKkktWd84cltQ=; b=jP1ylhX7gyUTdjltq4kzmn+IIfvdkxVFb2f6PqaIM2uZ2qiBtFOwB5IshbPtGnDHGs yeFXoHLgbjqd20BGsL98koht69h4YP3/LN7Q0xGltsTh4YMBu7oU2/lcFhCkXLFmQIbd rLUaFQVqFIVu3IPVGkjAJLXUdlTwodO+9WZBM= 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; bh=xAOPy8F+Mz2BqbptFVIU6iCHdlg7tOjKkktWd84cltQ=; b=naB52h3/hBG6EStH4D/WP3pQMExZcojain2AY9Zk3VSsnWyZQv7/R4q+K+lbL6mzLh 7k7SfdOxVturCc3X4DkuJ318A710qb/uO41GAWlIjg3Ffy4vQinUOlTsgF6CDD7EhBKc kUsKY1LmHQ5KQRN/iEFYbGeCFrmlQHZhcbyj+jErGehqcNqh+OVoFKKXVqn63VKH9ha1 0+9RF6OEyOPqFApq2mm9UU/Uum6c606K/okc1qFzhtuYk/qxiNXcmz5Ng8ciZhQv+tkU /UxcqiEnAGLWs4iNk7A3rQolsGajeAUI099qGM7+xlMtvB5ysmPEdAe5qQJdOCBdCw+O HHug== X-Gm-Message-State: ALKqPwfxG1liRcNs/wXIgWznP+MV2F19wR1pTFvhLoaUuBiC2zfxlUJf 1alEsliEFPRPp7TqB70df0mJ8yYRikg= X-Google-Smtp-Source: AB8JxZoOEaUTJcMWGnXvfnm8YmU8TXk9961mRUgTg/uW/+QiLHRFfAqxTr9hfoHo3Z3joaK+p6WG5w== X-Received: by 2002:aa7:8354:: with SMTP id z20-v6mr3337201pfm.166.1525999448342; Thu, 10 May 2018 17:44:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 17:43:41 -0700 Message-Id: <20180511004345.26708-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511004345.26708-1-richard.henderson@linaro.org> References: <20180511004345.26708-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH 15/19] fpu/softfloat: Use float*_silence_nan in propagateFloat*NaN 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, alex.bennee@linaro.org 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 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have already checked the arguments for SNaN; we don't need to do it again. Signed-off-by: Richard Henderson --- fpu/softfloat-specialize.h | 44 +++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index 53a4f45a8c..08ab8181d5 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -498,7 +498,7 @@ static float32 commonNaNToFloat32(commonNaNT a, float_s= tatus *status) | The routine is passed various bits of information about the | two NaNs and should return 0 to select NaN a and 1 for NaN b. | Note that signalling NaNs are always squashed to quiet NaNs -| by the caller, by calling floatXX_maybe_silence_nan() before +| by the caller, by calling floatXX_silence_nan() before | returning them. | | aIsLargerSignificand is only valid if both a and b are NaNs @@ -536,7 +536,7 @@ static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIs= QNaN, flag bIsSNaN, { /* According to MIPS specifications, if one of the two operands is * a sNaN, a new qNaN has to be generated. This is done in - * floatXX_maybe_silence_nan(). For qNaN inputs the specifications + * floatXX_silence_nan(). For qNaN inputs the specifications * says: "When possible, this QNaN result is one of the operand QNaN * values." In practice it seems that most implementations choose * the first operand if both operands are qNaN. In short this gives @@ -788,9 +788,15 @@ static float32 propagateFloat32NaN(float32 a, float32 = b, float_status *status) =20 if (pickNaN(aIsQuietNaN, aIsSignalingNaN, bIsQuietNaN, bIsSignalingNaN, aIsLargerSignificand)) { - return float32_maybe_silence_nan(b, status); + if (bIsSignalingNaN) { + return float32_silence_nan(b, status); + } + return b; } else { - return float32_maybe_silence_nan(a, status); + if (aIsSignalingNaN) { + return float32_silence_nan(a, status); + } + return a; } } =20 @@ -950,9 +956,15 @@ static float64 propagateFloat64NaN(float64 a, float64 = b, float_status *status) =20 if (pickNaN(aIsQuietNaN, aIsSignalingNaN, bIsQuietNaN, bIsSignalingNaN, aIsLargerSignificand)) { - return float64_maybe_silence_nan(b, status); + if (bIsSignalingNaN) { + return float64_silence_nan(b, status); + } + return b; } else { - return float64_maybe_silence_nan(a, status); + if (aIsSignalingNaN) { + return float64_silence_nan(a, status); + } + return a; } } =20 @@ -1121,9 +1133,15 @@ floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b= , float_status *status) =20 if (pickNaN(aIsQuietNaN, aIsSignalingNaN, bIsQuietNaN, bIsSignalingNaN, aIsLargerSignificand)) { - return floatx80_maybe_silence_nan(b, status); + if (bIsSignalingNaN) { + return floatx80_silence_nan(b, status); + } + return b; } else { - return floatx80_maybe_silence_nan(a, status); + if (aIsSignalingNaN) { + return floatx80_silence_nan(a, status); + } + return a; } } =20 @@ -1270,8 +1288,14 @@ static float128 propagateFloat128NaN(float128 a, flo= at128 b, =20 if (pickNaN(aIsQuietNaN, aIsSignalingNaN, bIsQuietNaN, bIsSignalingNaN, aIsLargerSignificand)) { - return float128_maybe_silence_nan(b, status); + if (bIsSignalingNaN) { + return float128_silence_nan(b, status); + } + return b; } else { - return float128_maybe_silence_nan(a, status); + if (aIsSignalingNaN) { + return float128_silence_nan(a, status); + } + return a; } } --=20 2.17.0