From patchwork Fri Nov 19 16:04:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519259 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp2735089imj; Fri, 19 Nov 2021 08:19:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsgT4SzF7Jt7z71b5QNHwmMnNQUEzr1KqpQ22cbeqmCKaWCcuap3cml0j1ILKBrmJqvbxS X-Received: by 2002:a05:620a:208c:: with SMTP id e12mr17944014qka.445.1637338767029; Fri, 19 Nov 2021 08:19:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637338767; cv=none; d=google.com; s=arc-20160816; b=pM7db1nFbRKzdqVP17BhatY9YXZkEgKQVx96r7If9ig5NQr79leKVa2BBBC6+v/gkz kRD2NvGxYQPDtqOutTdBONc4qHQBRbaFwEBoJogoLYEA6rRIMiYLxSNZ/O2RfPtflDxy 6eLTXul3weZVbq/pxE1/vCUgIV5r5UiHi3PtnScoFb7WROxqdZ/bdVaCACoIUiTp4KdZ mJ9QYm3lN79pUX/5Mt9pY3mKVQdkGPiZTo+pTFzjFFtryRseicWELvgmyMuv/pNqMssJ gK7SDcKXX9kDDT9+zG3U8oBuHHiZDtZvB31eSnXUEyADlj7Hp22VmyHN7wa0Jha50QWg kllw== 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=TRfc/RFSZ/tSn5hrRAh3s014f/r4fo5NoHM3mYm54cI=; b=ETF2zWZPc1FbV9G9FqVdhG7QI3gc55NFty8t47vS8Xij2RyFsleyJ8HM2g8hKARRV8 9O+qbdNh6aV42s7RAIRNYX+x0UvuIzU2lp3TIjUrljOIrgwVECvt4xqCrRoERNMn++fV J5wMsk1ykQBvoEAScXVhQhAJyI5chhoVn4jCG1OTX9PJDU76j97TVwDH9evOV/zKSpGp Hfr3aS+YICcTGNwSbF3AFwT1MinyfjMQtU8tTxUCtbjT8WU4eJ6EMf07FpAQ3rxMnVUI AibF8TGOaGYb0GDxITOTJGi2PF0OzckAF7gmvbFLEo5Z8Z2HRVi84jSGZCHWVs3p1Rv+ ggaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AIBM680n; 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 g17si322469qtg.255.2021.11.19.08.19.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Nov 2021 08:19:27 -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=AIBM680n; 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]:59336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo6bm-0004p0-H3 for patch@linaro.org; Fri, 19 Nov 2021 11:19:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo6OU-0005Mi-ER for qemu-devel@nongnu.org; Fri, 19 Nov 2021 11:05:44 -0500 Received: from [2a00:1450:4864:20::42f] (port=44789 helo=mail-wr1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mo6OO-0004Cw-4V for qemu-devel@nongnu.org; Fri, 19 Nov 2021 11:05:40 -0500 Received: by mail-wr1-x42f.google.com with SMTP id n29so18917012wra.11 for ; Fri, 19 Nov 2021 08:05:35 -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=TRfc/RFSZ/tSn5hrRAh3s014f/r4fo5NoHM3mYm54cI=; b=AIBM680nBipdPfuCXb0EEx89RHiqWGV+MoLlD21DBHRtUfBDiHHD71PP17u02qgQe9 uCpHw5qiGVm+Wt8JRlVQIHyN8V+K2w2/T/RHmvMS3eTaXeRk2uFqL6YrM7yLTIUUFrli NEBV+uegS7cQjr/CS/GS2vWfvVdpvACo1TyP01WGoP1+EKdtQqBLOzm5kjHIUMQrwvy3 +PJJU334m9zMav7IOAjL2MJqYAsMFsOXJ7zlzY/gNPgBew4M5/vz90WYFcuSpQHYLi4O Fn+DBG4Y7Ju2ztwiuzjQEpmvzojkvTuK/hA6kxIjtB9PFjOsLoLB4aeQ0TatPQPEHiin 2ldw== 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=TRfc/RFSZ/tSn5hrRAh3s014f/r4fo5NoHM3mYm54cI=; b=mV2yUVaPTm5gof5uj3q5otIJbM71r911BmC0W51kfRG6lqShKUfc7Flqdkq0YYYkJw GHnd8f/g+dbqkhQoHoxZQ5EGhaktpv+fEoRUiSj4OZMkOlX4N4hAQ4WadAv/BJBmqXYC XsUO5RHd+84OHVHbwKs8+TC2+T8EME6wqWVhwFt/U9AiOBSZKlkSznWePNG6EnEyaT2W AVgC1efI7LQnWKdW5S5ZHtH4injddPpI/OrEFILGQbN7OIf3jctmowCBS5qXZUysBysJ Mw+1A8Yvz2cd3gdUdbIInsLAhIrDE/QXK8TRwLRv8BkFIcVHxURNMYPBJRBuHD9xRvnG Ehyg== X-Gm-Message-State: AOAM532FBtexnnkiKMLxen7/WlBqkMhdChXfVKYO05AuxgKqXXl+Gyp5 zOSouAP0jNAnfkE2TVoIfwKC2aqdp3AIK6FM9uM= X-Received: by 2002:a05:6000:2a4:: with SMTP id l4mr8926686wry.238.1637337933660; Fri, 19 Nov 2021 08:05:33 -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.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 08:05:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/35] target/ppc: Move float_check_status from FPU_FCTI to translate Date: Fri, 19 Nov 2021 17:04:38 +0100 Message-Id: <20211119160502.17432-12-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::42f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42f.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, T_SPF_TEMPERROR=0.01 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" Fixes a bug in which e.g XE enabled causes inexact to be raised before the writeback to the architectural register. All of the users of GEN_FLOAT_B either set set_fprf, or are one of the convert-to-integer instructions that require this behaviour. Split out the two gen_helper_* calls in gen_compute_fprf_float64 and protect only the first with set_fprf. Signed-off-by: Richard Henderson --- target/ppc/fpu_helper.c | 9 +++------ target/ppc/translate/fp-impl.c.inc | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index 2ab34236a3..0d58fd82a6 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -552,12 +552,9 @@ uint64_t helper_##op(CPUPPCState *env, float64 arg) \ uint64_t ret = float64_to_##cvt(arg, &env->fp_status); \ int status = get_float_exception_flags(&env->fp_status); \ \ - if (unlikely(status)) { \ - if (status & float_flag_invalid) { \ - float_invalid_cvt(env, 1, GETPC(), float64_classify(arg)); \ - ret = nanval; \ - } \ - do_float_check_status(env, GETPC()); \ + if (unlikely(status & float_flag_invalid)) { \ + float_invalid_cvt(env, 1, GETPC(), float64_classify(arg)); \ + ret = nanval; \ } \ return ret; \ } diff --git a/target/ppc/translate/fp-impl.c.inc b/target/ppc/translate/fp-impl.c.inc index c9e05201d9..aad97a12e8 100644 --- a/target/ppc/translate/fp-impl.c.inc +++ b/target/ppc/translate/fp-impl.c.inc @@ -157,8 +157,9 @@ static void gen_f##name(DisasContext *ctx) \ gen_helper_f##name(t1, cpu_env, t0); \ set_fpr(rD(ctx->opcode), t1); \ if (set_fprf) { \ - gen_compute_fprf_float64(t1); \ + gen_helper_compute_fprf_float64(cpu_env, t1); \ } \ + gen_helper_float_check_status(cpu_env); \ if (unlikely(Rc(ctx->opcode) != 0)) { \ gen_set_cr1_from_fpscr(ctx); \ } \