From patchwork Mon May 30 16:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 577276 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp439076mag; Mon, 30 May 2022 10:32:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbib3O2yPL+EB4bt4gDC3pu1wfwmhf/sqflxmgGHM0OXK6LGwuCg0C8wd9BANEBLSR1YEr X-Received: by 2002:a05:6214:2523:b0:464:29c8:8cd9 with SMTP id gg3-20020a056214252300b0046429c88cd9mr14381733qvb.16.1653931959423; Mon, 30 May 2022 10:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653931959; cv=none; d=google.com; s=arc-20160816; b=zGS4trd5hOUFOuu0WFFuA8p06SPiCSkqewGpw+SomLdSSpjKcVkm+fhEpGsbQ2q2sC cGw0Ody9IXTlUFuCfbrD8+JZimdJJb035ZWp2SxDBJ3itGURtYV9beYi7aSAWdlrt6wW 4ayTmvy/TazX7U4QdTSMpr0rl1xxMXWT2eVzkL4xtfYdOV6xVh16ji3Mz/PRxll18Gk+ ZgrFuTXXx2o6HhKhfIM73M46gfPX8fmrnZ7fvdc2F/BhHuQwyreoby+6wUgATI0smbLY B9WGVwnAkkZBALWbuUywK3lOHHO7ukObwcdvsawWUm6HAnohvFnWsag/3l23FGg6Fzuv B79g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=B+S5E6ge/+wsWYJ5Kej7wJNG7Uhv19vqV3imdXXvdmk=; b=cpF5l9nj3PWFYqFIgeOZkSR4Guq8NYCEh5Lcmu3AqSps3JhfwLipqqYlIpw6zxsLVs WXhNjGRcWUyhKWRkEbrNQfw8qEFGi9vrZwflcQ68olysWC6QSsrPTwJNP97d4EIVN6rE eVm4X2WBG66Vnf8lFh88TkpVtEmAyP2Z0Vvuy8k/OMSVbBlvtif5PM24cDmR6roW0QK0 OF9/SUauWxYV3sR8cjH3FpkpvFlxQ2HmgYB3tbDTR/jRTAZCzl4AGVdToaFk+fHewRqD QLDeh7PKoFRvwETdN6gc+MNAE9Z5Uu7yjsmCG8Jzol4IvOauMMefQ5pcL9NcP8TwPy9i fzig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uA3QkP8H; 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=pass (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 d7-20020a05622a05c700b002fbc8932a67si7637339qtb.103.2022.05.30.10.32.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 May 2022 10:32:39 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=uA3QkP8H; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvjFv-0001pK-0R for patch@linaro.org; Mon, 30 May 2022 13:32:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhwd-00046s-Ad for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:39 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:46665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvhwa-0007Hl-2j for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:38 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d26so9674574wrb.13 for ; Mon, 30 May 2022 09:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=B+S5E6ge/+wsWYJ5Kej7wJNG7Uhv19vqV3imdXXvdmk=; b=uA3QkP8HXQZMkqYDVsiDNZdE9WiJiSpt8JMxIFPqFp3ZWxnnqQzyzeGftZ8W/Cdt5p zpLfNzdGzCSDuTIWE9kxMCLiqlz3910BuLF+kKqnP34/6naC8VkWqqoHZW1WnbCuwr04 aC6zZ+BCJyO3VETwzD/XJKFY7WVn5yeojwSdh7+nf7f+vXW7xnH1TMbHR83sa5P1iAjB JKt1YbtbT8r0/qJpwdWsnQZnyL/6xQra3QlFG7jZ8qiJ4Wm4FhZ5VLrQNZaTzgCpsZVe XOsM6Dw2G7Fw81nbyX/rTFMAD514lHf1m2Xi9SlHhlGVDeM4sa4FOml3mzzNkIE42GRj KbiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B+S5E6ge/+wsWYJ5Kej7wJNG7Uhv19vqV3imdXXvdmk=; b=5FchlGXn58LLpo+cxrNXRmZLzDjTmc+Ja88UFeXiKfaQkkjRpbZeO680B11Uo8sOaE YWNh+Q2iB99GJMIqxgOgNzIzDQVdLqHVyYNxo2msC4nuiO5rUDB6dFarzOnYGlWx+KJ6 g2UZQnBwvkbyUPqS/A7ildxdwauDWYGkIP7FnKQmiQ05YKywhW2nunQxd03Yix7y+GOK crDkWo+GmSh+o/eBoc2D7ibsfMtCsHuKlVzfYX7jEuFUxaSpCNYWVpbSA3hkWF+cCM7X NbVIoZPEF/xNI7C0InNB/jPJB1YOIy9KsLBabO9AsX67GDfH0Wsooj+23YHhb5RUYLhW VFwg== X-Gm-Message-State: AOAM533jNzcgDBqdx1xqA9S/USFtLpatxSgmylC1qVUmUx9BjxTbwk6U ongIp1T/qPPsaD9cKp63YhKX5L3NhUCjAg== X-Received: by 2002:a5d:58c2:0:b0:210:2baa:52b8 with SMTP id o2-20020a5d58c2000000b002102baa52b8mr8200007wrf.20.1653926914452; Mon, 30 May 2022 09:08:34 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bi12-20020a05600c3d8c00b003974b95d897sm10232152wmb.37.2022.05.30.09.08.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 09:08:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 094/117] target/arm: Use TRANS_FEAT for FRECPE, FRSQRTE Date: Mon, 30 May 2022 17:06:45 +0100 Message-Id: <20220530160708.726466-95-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530160708.726466-1-peter.maydell@linaro.org> References: <20220530160708.726466-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Rename do_zz_fp to gen_gvec_fpst_arg_zz, and move up. Split out gen_gvec_fpst_zz as a helper while we're at it. Signed-off-by: Richard Henderson Message-id: 20220527181907.189259-92-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate-sve.c | 77 ++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 4a9ecd5e72d..2f7651249ad 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -152,6 +152,32 @@ static bool gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn, return true; } +static bool gen_gvec_fpst_zz(DisasContext *s, gen_helper_gvec_2_ptr *fn, + int rd, int rn, int data, + ARMFPStatusFlavour flavour) +{ + if (fn == NULL) { + return false; + } + if (sve_access_check(s)) { + unsigned vsz = vec_full_reg_size(s); + TCGv_ptr status = fpstatus_ptr(flavour); + + tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + status, vsz, vsz, data, fn); + tcg_temp_free_ptr(status); + } + return true; +} + +static bool gen_gvec_fpst_arg_zz(DisasContext *s, gen_helper_gvec_2_ptr *fn, + arg_rr_esz *a, int data) +{ + return gen_gvec_fpst_zz(s, fn, a->rd, a->rn, data, + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); +} + /* Invoke an out-of-line helper on 3 Zregs. */ static bool gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, int rd, int rn, int rm, int data) @@ -3627,48 +3653,17 @@ DO_VPZ(FMAXV, fmaxv) *** SVE Floating Point Unary Operations - Unpredicated Group */ -static void do_zz_fp(DisasContext *s, arg_rr_esz *a, gen_helper_gvec_2_ptr *fn) -{ - unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); +static gen_helper_gvec_2_ptr * const frecpe_fns[] = { + NULL, gen_helper_gvec_frecpe_h, + gen_helper_gvec_frecpe_s, gen_helper_gvec_frecpe_d, +}; +TRANS_FEAT(FRECPE, aa64_sve, gen_gvec_fpst_arg_zz, frecpe_fns[a->esz], a, 0) - tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - status, vsz, vsz, 0, fn); - tcg_temp_free_ptr(status); -} - -static bool trans_FRECPE(DisasContext *s, arg_rr_esz *a) -{ - static gen_helper_gvec_2_ptr * const fns[3] = { - gen_helper_gvec_frecpe_h, - gen_helper_gvec_frecpe_s, - gen_helper_gvec_frecpe_d, - }; - if (a->esz == 0) { - return false; - } - if (sve_access_check(s)) { - do_zz_fp(s, a, fns[a->esz - 1]); - } - return true; -} - -static bool trans_FRSQRTE(DisasContext *s, arg_rr_esz *a) -{ - static gen_helper_gvec_2_ptr * const fns[3] = { - gen_helper_gvec_frsqrte_h, - gen_helper_gvec_frsqrte_s, - gen_helper_gvec_frsqrte_d, - }; - if (a->esz == 0) { - return false; - } - if (sve_access_check(s)) { - do_zz_fp(s, a, fns[a->esz - 1]); - } - return true; -} +static gen_helper_gvec_2_ptr * const frsqrte_fns[] = { + NULL, gen_helper_gvec_frsqrte_h, + gen_helper_gvec_frsqrte_s, gen_helper_gvec_frsqrte_d, +}; +TRANS_FEAT(FRSQRTE, aa64_sve, gen_gvec_fpst_arg_zz, frsqrte_fns[a->esz], a, 0) /* *** SVE Floating Point Compare with Zero Group