From patchwork Fri Nov 19 16:04:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519265 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp2741285imj; Fri, 19 Nov 2021 08:24:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8e8lCTzGzB5BMzqHxQaT+of8CHjEBwcVwUtCjxh0mW4Y6hE+tC74mObGPDRBdoScDp1GK X-Received: by 2002:a05:622a:15cc:: with SMTP id d12mr7424486qty.387.1637339047384; Fri, 19 Nov 2021 08:24:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637339047; cv=none; d=google.com; s=arc-20160816; b=0L9ihgvoOoKMV0RstJUYaLLSd7x4575E5feBi5bMdoJpzOw38yZoostvZgNPViz9ZV YbUGO3By218fKYbbhSvZ82r4CjO0Gxwf+l36Os7Efe8F9v3xL4KQcwvhS3J18wMG/1n8 tzw4U3rgusmsTr5Iq+45szirChNHm18/+gYyQRf+SmKG049i8Y3uDyHBzyj2uMhYRrYy ygaJ0eAt/hQ8udw8GbOJX5bGYYscFN7EAOtaUIO5qcZv+TUeEAWzMbQW0iua+QZlDp1Y NJg9Xo3ue/ttdcoThvxqvUK/32g1yU0iFAMoMNAKFW/+rhTD1TqbaIL3rNIKDEFdWeGy SF0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/fq8YVZ41y2m63Xbs624QcT/491tkKkPk8MVBVrP9XU=; b=zOKFzJgeBjMmqBeLz+N5qc2A1mUM8qVCPIOYUB4lK4TXW2suyWOhAUw6M1Vj2V4FDp dJq4wiplvvEa+h4ykPT/3Fm/qBMSFtHjbfy9XaAOEgJO37FLyhhgdniiXdeXJ3HF8Cq0 /8uRzRMZJ7EWNEPg4MblTlSTPG9AtCITR1qGAhNmgjMfCN9Q6TDUYuZxlKi7ZaovQVjA wD/oaZ1OjyA0i3lNl+cBJp07s/TRBmycLr1RUKaJpAP+ve/qsucpxgG15WF5XB0lwxId 3Sf1JdH98awlxRvKI4OBenSC+ng7jc7EcSdSmyMqGsU8RaprCNjJQKB+T6bdIJ8Y1F/6 QJYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=L20IbaCS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i1si200434qvu.59.2021.11.19.08.24.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Nov 2021 08:24:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=L20IbaCS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo6gH-00063G-7R for patch@linaro.org; Fri, 19 Nov 2021 11:24:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo6Ow-0006dq-Rc for qemu-devel@nongnu.org; Fri, 19 Nov 2021 11:06:10 -0500 Received: from [2a00:1450:4864:20::430] (port=37448 helo=mail-wr1-x430.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mo6Ov-0004U0-96 for qemu-devel@nongnu.org; Fri, 19 Nov 2021 11:06:10 -0500 Received: by mail-wr1-x430.google.com with SMTP id b12so18965838wrh.4 for ; Fri, 19 Nov 2021 08:06:08 -0800 (PST) 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=/fq8YVZ41y2m63Xbs624QcT/491tkKkPk8MVBVrP9XU=; b=L20IbaCSCw2joaYjiV86ERzsKPG66sNPl0PMblYgPd42h8nBoLlG10lQTURLUkCoad pQG6ikhqoEfqZyMI06BNcndCaeJ4i3p/icMTI2wOjJC+YRCVZUCooXhO8DdwYjqv3k0t 7ZycddbrFt7eFxYjKyZtTFX3iFFVuN9aOlWub1A6oelEMcQB4db/m90fZr2nNMgZG/HS 68VxHyjN1FHXbw5MQ6kcETN1Omj2xObzYfWWPDYfMzUwHT/Z3oTi48Jwwo+AiE8gqMYm zUT6v5EWf+wQL+cD2U3hLdGnJ6c2Vh+SsKXND0SwT7wlhsTz7HWe+/KBxXInQ53xy7Hd rbFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/fq8YVZ41y2m63Xbs624QcT/491tkKkPk8MVBVrP9XU=; b=q0tKUGOhSliIHqnejgmmR7kNqKaOlyoZ6FYgz1mKiWKEqV6MMZBgzu70YXWihhLcxZ eU2a/hNVRCUpcmhuEPTw8ILcj0fkMHSvZJVOGyyppA+zuU/GQ2H05f2Su4qI8ozmRjWU uFldjFkca7/vYC5FntJ7+gnRRPiRrwKEcdGdTvRonwvCeKGruMhMsBbqwJqtm7hs0OSH 3t0FAgBPvLq6THqOpv3I0wHwi3zYeeV5uuXMwCuht/LrWClTYGQ7z+1G/CjSZg4lBDXS 5iDDbV1GO+mxz+WalEC5NUF9JFAlVj93XQiNALYMlIkjNvCFuaGCsGeyJ/7JGBUQgzug tbgg== X-Gm-Message-State: AOAM531BxFlVV4veae33Tw8vgzuFFalSm3JcMgAtI2HvLpwCSx1rHhxY vqJqWrEE6vgFfxLo+Mqv9xl1yFeN2Vym1+Y2pDE= X-Received: by 2002:adf:e882:: with SMTP id d2mr8748452wrm.389.1637337967756; Fri, 19 Nov 2021 08:06:07 -0800 (PST) Received: from localhost.localdomain (165.red-37-158-79.dynamicip.rima-tde.net. [37.158.79.165]) by smtp.gmail.com with ESMTPSA id q84sm14044877wme.3.2021.11.19.08.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 08:06:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 26/35] target/ppc: Update fre to new flags Date: Fri, 19 Nov 2021 17:04:53 +0100 Message-Id: <20211119160502.17432-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211119160502.17432-1-richard.henderson@linaro.org> References: <20211119160502.17432-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::430 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, alex.bennee@linaro.org, clg@kaod.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use float_flag_invalid_snan instead of recomputing the snan-ness of the operand. Signed-off-by: Richard Henderson --- target/ppc/fpu_helper.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index f46d529f04..7b4407e189 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -717,20 +717,15 @@ float64 helper_fre(CPUPPCState *env, float64 arg) { /* "Estimate" the reciprocal with actual division. */ float64 ret = float64_div(float64_one, arg, &env->fp_status); - int status = get_float_exception_flags(&env->fp_status); + int flags = get_float_exception_flags(&env->fp_status); - if (unlikely(status)) { - if (status & float_flag_invalid) { - if (float64_is_signaling_nan(arg, &env->fp_status)) { - /* sNaN reciprocal */ - float_invalid_op_vxsnan(env, GETPC()); - } - } - if (status & float_flag_divbyzero) { - float_zero_divide_excp(env, GETPC()); - /* For FPSCR.ZE == 0, the result is 1/2. */ - ret = float64_set_sign(float64_half, float64_is_neg(arg)); - } + if (unlikely(flags & float_flag_invalid_snan)) { + float_invalid_op_vxsnan(env, GETPC()); + } + if (unlikely(flags & float_flag_divbyzero)) { + float_zero_divide_excp(env, GETPC()); + /* For FPSCR.ZE == 0, the result is 1/2. */ + ret = float64_set_sign(float64_half, float64_is_neg(arg)); } return ret;