From patchwork Fri Nov 19 16:04:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519264 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp2740500imj; Fri, 19 Nov 2021 08:23:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZAXABM1Z3VHZ/a1yYTqcPVv5xfOSwPOocF8NKBkrB22p8MgzQSHtebT+Xpp/Tgy6liNwH X-Received: by 2002:ac8:57cb:: with SMTP id w11mr7313363qta.41.1637339010588; Fri, 19 Nov 2021 08:23:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637339010; cv=none; d=google.com; s=arc-20160816; b=l7CkJ8r+s40kSEbSzJ+zwaa4yTh65hsICdYzfmIB7HGiPIqP+0xCv7maaaBbHv4CYU yWMB2QylUsXdqVQTNp8E2vJLD8WmcDHkSUs5Pjm0EvF1QFvi7CdMutqCwi2FfHbI6i8N 1xB0A3XeaEtzUvkBfqyWRASEt/oHOcFH+uGECFN+PsD0/tm8O1J67AqSZ5aHL/bvFLBB 5S1VuzPpJZFi7iNL3Y6PnErjsbaJJFNFevkuzufiOzaiIUSzmQ00OuZI/sO/fMrz8wBo 3eQtVOzqqTiKaRDhwtUbSp7Zc3paurbaOfVsnaBTuVys+Q1g9cLMUwlYwA9nc6WncKLi vVSg== 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=8exqE87Bjdy/DSYC/o9ceeSlARYk7qq6FBzm+CHWIhc=; b=bZ21mL8c61aNswvMFa58VFYsHzTVxxhmpif0g8T0kvaoiVzaYNPIDT3j9k1K31MDOO vGv1eQYihyQN6XQ/nlH0q8VU/2J+nJAMbkjxkAtnYKfz77OWW7nVyNyaSfDuA3ZQmsSo tOzZ6YUSzQB0g8rhcldr5JaLbyKqL7LAd5fsaJckF3Okug3fcX6wbTw9yzz5MMHnipVg xcrSQH7SCPPiVF9VIc5qYk/T7a/DvsCc9LkqjVmVG9hCWDI7JzCfO0Hm/A18gBtYckfu yAdNl3DG5AVk2BGzakBFa2ZRTlOEW6cTBlK8ABky/t2yApP0HMsXnfSNOpCVQCOGL4ya 7tSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rS9Jt9JU; 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 p9si252818qti.79.2021.11.19.08.23.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Nov 2021 08:23:30 -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=rS9Jt9JU; 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]:42474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo6fh-0004Jk-RD for patch@linaro.org; Fri, 19 Nov 2021 11:23:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo6On-00065m-HE for qemu-devel@nongnu.org; Fri, 19 Nov 2021 11:06:01 -0500 Received: from [2a00:1450:4864:20::431] (port=42818 helo=mail-wr1-x431.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mo6Ol-0004N8-H4 for qemu-devel@nongnu.org; Fri, 19 Nov 2021 11:06:01 -0500 Received: by mail-wr1-x431.google.com with SMTP id c4so18948059wrd.9 for ; Fri, 19 Nov 2021 08:05:59 -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=8exqE87Bjdy/DSYC/o9ceeSlARYk7qq6FBzm+CHWIhc=; b=rS9Jt9JUoHf6nDqv79eIpwWIz4m9WBt3Sf42kvAlwzoGoiVAKk7ZIqPYLLPXRDN3jO X6EcY2JHao1S5XTdDOKsjldAc4ML5m6GGi7QspbGYqA4jbLTpn66Dj9+DUO7EdkdJycD Ij5gtYSlbxjmJjqbuF5nYCL37+Sf/8uFCFx6EUE7JtGZ02/8Tacget9Nh7e0YmZ61NIb PqIl/dYuPI/GQp+thnA1HOq2KsoLYv6gnd/L/7y/Jiy5uHpEgY3xD+5/j5Urnor13mNv 3T31vpC9/82DkP0WapGQW/0Api7bDYYG6RNU2kJ/PfUXPSyAduvr0XrIQTyzw+VD5Ohp fbog== 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=8exqE87Bjdy/DSYC/o9ceeSlARYk7qq6FBzm+CHWIhc=; b=Z95risMe/TaT8OwPpZQo+t88WJhrZpKtJG7UfjvSLGfql9rdyHjZJALoflIRf4ZK4N fuyL7Jrw9Tn21YiiVSFsQP70L9L/jnBtq6KXoALXC64g///n0oDz5MUbWe9wMAyhl5PV QGtAdFV6LE81bH21WoCG51n5lPYdxzvYUNoTDbIxVTJzVGnjXUYbq87lF3txH+Kgoxfv JzHb/YAsuhzX7k3WimC+sSZsYxZQn2D5YelE8iseq/2d+GU3qETSTTkgzAsAxNrzOAze z1bE1oWVcvL30PW6RPu8ULeUSdxTlBOWd+qcp8+WkWUx7dBxiQM0kCjMWxUm1aoQaaNV FZUA== X-Gm-Message-State: AOAM531Eaa8EWxV+dwFtPV/PucKI/aFBs7kHKFFeNP4phSF4nhmIfc7d LKa9shg5Q5ju3r61d4QCrjAxVUdAcrXg1O9QrRY= X-Received: by 2002:adf:fa0b:: with SMTP id m11mr8659784wrr.152.1637337958107; Fri, 19 Nov 2021 08:05:58 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 08:05:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 21/35] target/ppc: Split out do_frsp Date: Fri, 19 Nov 2021 17:04:48 +0100 Message-Id: <20211119160502.17432-22-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::431 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x431.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" Calling helper_frsp directly from other helpers generates the incorrect retaddr. Split out a helper that takes the retaddr as a parameter. Signed-off-by: Richard Henderson --- target/ppc/fpu_helper.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index e0c35a3977..e91a6b0212 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -673,7 +673,7 @@ FPU_FMADD(fmsub, MSUB_FLGS) FPU_FMADD(fnmsub, NMSUB_FLGS) /* frsp - frsp. */ -uint64_t helper_frsp(CPUPPCState *env, uint64_t arg) +static uint64_t do_frsp(CPUPPCState *env, uint64_t arg, uintptr_t retaddr) { CPU_DoubleU farg; float32 f32; @@ -681,7 +681,7 @@ uint64_t helper_frsp(CPUPPCState *env, uint64_t arg) farg.ll = arg; if (unlikely(float64_is_signaling_nan(farg.d, &env->fp_status))) { - float_invalid_op_vxsnan(env, GETPC()); + float_invalid_op_vxsnan(env, retaddr); } f32 = float64_to_float32(farg.d, &env->fp_status); farg.d = float32_to_float64(f32, &env->fp_status); @@ -689,6 +689,11 @@ uint64_t helper_frsp(CPUPPCState *env, uint64_t arg) return farg.ll; } +uint64_t helper_frsp(CPUPPCState *env, uint64_t arg) +{ + return do_frsp(env, arg, GETPC()); +} + /* fsqrt - fsqrt. */ float64 helper_fsqrt(CPUPPCState *env, float64 arg) { @@ -1578,7 +1583,7 @@ void helper_##name(CPUPPCState *env, ppc_vsr_t *xt, \ } \ \ if (r2sp) { \ - t.fld = helper_frsp(env, t.fld); \ + t.fld = do_frsp(env, t.fld, GETPC()); \ } \ \ if (sfprf) { \ @@ -1654,7 +1659,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, \ } \ \ if (r2sp) { \ - t.fld = helper_frsp(env, t.fld); \ + t.fld = do_frsp(env, t.fld, GETPC()); \ } \ \ if (sfprf) { \ @@ -1728,7 +1733,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, \ } \ \ if (r2sp) { \ - t.fld = helper_frsp(env, t.fld); \ + t.fld = do_frsp(env, t.fld, GETPC()); \ } \ \ if (sfprf) { \ @@ -1796,7 +1801,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, ppc_vsr_t *xb) \ t.fld = tp##_div(tp##_one, xb->fld, &env->fp_status); \ \ if (r2sp) { \ - t.fld = helper_frsp(env, t.fld); \ + t.fld = do_frsp(env, t.fld, GETPC()); \ } \ \ if (sfprf) { \ @@ -1844,7 +1849,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, ppc_vsr_t *xb) \ } \ \ if (r2sp) { \ - t.fld = helper_frsp(env, t.fld); \ + t.fld = do_frsp(env, t.fld, GETPC()); \ } \ \ if (sfprf) { \ @@ -1893,7 +1898,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, ppc_vsr_t *xb) \ } \ \ if (r2sp) { \ - t.fld = helper_frsp(env, t.fld); \ + t.fld = do_frsp(env, t.fld, GETPC()); \ } \ \ if (sfprf) { \ @@ -2064,7 +2069,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, \ } \ \ if (r2sp) { \ - t.fld = helper_frsp(env, t.fld); \ + t.fld = do_frsp(env, t.fld, GETPC()); \ } \ \ if (sfprf) { \ @@ -2803,7 +2808,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, ppc_vsr_t *xb) \ for (i = 0; i < nels; i++) { \ t.tfld = stp##_to_##ttp(xb->sfld, &env->fp_status); \ if (r2sp) { \ - t.tfld = helper_frsp(env, t.tfld); \ + t.tfld = do_frsp(env, t.tfld, GETPC()); \ } \ if (sfprf) { \ helper_compute_fprf_float64(env, t.tfld); \ @@ -2928,7 +2933,7 @@ uint64_t helper_xsrsp(CPUPPCState *env, uint64_t xb) { helper_reset_fpstatus(env); - uint64_t xt = helper_frsp(env, xb); + uint64_t xt = do_frsp(env, xb, GETPC()); helper_compute_fprf_float64(env, xt); do_float_check_status(env, GETPC());