From patchwork Mon May 30 16:05:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 577213 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp392948mag; Mon, 30 May 2022 09:33:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy03t9vHmuFk522RQSHiheec3UR0TpI/18C6lr3o2gWR9+CVG9zTILJec+MsEemOgWRZUfx X-Received: by 2002:a05:6214:da3:b0:464:36d1:501b with SMTP id h3-20020a0562140da300b0046436d1501bmr11172604qvh.102.1653928411354; Mon, 30 May 2022 09:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653928411; cv=none; d=google.com; s=arc-20160816; b=te/Y0WU1OgdWtXGhF08cPHYKD4f9hUXY8jblv+pjX7mBp8L9J/mfD1uZ5Cm7jogIG8 dqvI5mHAJAO5zgI0VHFELozR1BSLhC8vMmiR0vi0v9e4KqFoBcjtHxE/Xdima8htMB3T gJpMJGTjiTMiiwoeLXV+MDEdn2M7XqhMQCGG8tnpkNBZHdrS2v11aGhWCXtaeNiOLAz9 LgDIY1LA9leaeH7uTPDF9f4gUZ6jZrtQTybTiLG7C6++rHkQu/7I/7iDs2tXJQaw0D6U ADmzh4HOKwIbWrzZDB68PokORV83V+oMF0vFjWxNLDMEv11XpU6/EPrj0vjIUS23VQFm guDA== 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=to1P/F8jtgSpqEU9S2Gk4KaraD3n0l9S4bHiRVQ6FPc=; b=vTumb1+ctzlNN66HYKpEEYRd8/g2l7orv7BDFJMpMU+1FXlcH4+ZTQGy9MnvrBcp5T ctTop06rnrnXfR0R12nOncEMzRhxIh9PgpiNwpwKl2Goe+eGVvURNJ0QAqcBB+gKlJqZ s1bEaEq5F5FAaY1Zr/nqQxfQq/osmwgsNG//xIYnKzvzuWumlybHw4rUzbjZFiQIkUoH 1+bvE0FIUPg2X99CjYzdO/Y4Mr8/Ts+fyFAfI4HR9jkQowJLvXxiuWO/Ft40Ebx9AyWC OmazbmTAAHiynyCRf2bcDDRXYuIMCeH+tpo0ZnX/WiIpursffVQrMSsvis+lKY+c4Vng MKjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tSGu7/Uw"; 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 b12-20020ac85bcc000000b002fb0eace504si8170147qtb.544.2022.05.30.09.33.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 May 2022 09:33:31 -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="tSGu7/Uw"; 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]:36022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nviKg-0005dG-Tm for patch@linaro.org; Mon, 30 May 2022 12:33:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhvZ-0002zB-Nc for qemu-devel@nongnu.org; Mon, 30 May 2022 12:07:33 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:34549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvhvX-0007BE-Cr for qemu-devel@nongnu.org; Mon, 30 May 2022 12:07:33 -0400 Received: by mail-wr1-x436.google.com with SMTP id e2so15314806wrc.1 for ; Mon, 30 May 2022 09:07:30 -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=to1P/F8jtgSpqEU9S2Gk4KaraD3n0l9S4bHiRVQ6FPc=; b=tSGu7/Uwpbvbv1eEAZC1fkRivle4/davDH6s5FKDoa9GcezM7M0WOm0jt+dNO4ElLv 1D8zTqDUWrMTMtOYumS3S80PXqLAqdHzWo6BUH/fOw3Ivjgp5b2jm2mPV3qwIyImc6Fv NgDBS0d+0xPfrI76kHWtxLROvUol5Uhm2+A8cfwWw0i9Kv1/KyiQuysl0ojPI9DvtlDT wK6IiL0sSjaPEBVA9UKP1naTnVLuFOUAKpbmcZWbHEsg9696P5E2aAbrq+wsUWFSGs41 lEoyWVevzFskO9TzD2d5HOrqtzWdBCQdh94TvRIKkd51dg0Gn87Z7wlMUhbrZOWnz5ae QYUQ== 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=to1P/F8jtgSpqEU9S2Gk4KaraD3n0l9S4bHiRVQ6FPc=; b=jZsJwFiZfVD4BGJgAD5jfhY7nVYxRNL4Wwntv2mBBJInI6PbN6AytixkdkQNsOiOha qoECWDnbBfBzEvlqRKR4qWcNAIpIqw9Cm3BRjQxuPG3Z5RC5RUvn3PHsgKbE/l7jisOf U/HX32nKkCX3lwS0ckYs8cdIiQoUhJm+CKYDuPg7+f5hMx+ob9wWbXckLH2OuoMLaG9e WojKvu2mJVxVhL47065Udye8xz+EEUcEitFj4JuU/CpAbJeRo7nGlperpGfkj9hwUDtC OYENkIWW9Colht5qaJ9iWkExLPX+r6J1zkUNiPmpqGZUF8YiHxuS6jVoEEfRnGprj43C GMzQ== X-Gm-Message-State: AOAM530m7gUGA+IbALaBLDvKDCesngTnMC8IMR3LWOER/iz6NnKmjR6r GMeD4eUrh3VgrjtLzYqCnBlL/YXm49CVbQ== X-Received: by 2002:a5d:58c2:0:b0:210:2baa:52b8 with SMTP id o2-20020a5d58c2000000b002102baa52b8mr8196482wrf.20.1653926850408; Mon, 30 May 2022 09:07:30 -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.07.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 09:07:30 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 025/117] target/arm: Use TRANS_FEAT for do_sve2_zpz_data Date: Mon, 30 May 2022 17:05:36 +0100 Message-Id: <20220530160708.726466-26-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::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.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 Convert SVE translation functions using do_sve2_zpz_data to use TRANS_FEAT and gen_gvec_ool_arg_zpz. Signed-off-by: Richard Henderson Message-id: 20220527181907.189259-23-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate-sve.c | 53 ++++++++++---------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index d5a09a60af4..fe11cfed6bb 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -6554,48 +6554,23 @@ static bool trans_UADALP_zpzz(DisasContext *s, arg_rprr_esz *a) * SVE2 integer unary operations (predicated) */ -static bool do_sve2_zpz_ool(DisasContext *s, arg_rpr_esz *a, - gen_helper_gvec_3 *fn) -{ - if (!dc_isar_feature(aa64_sve2, s)) { - return false; - } - return gen_gvec_ool_arg_zpz(s, fn, a, 0); -} +TRANS_FEAT(URECPE, aa64_sve2, gen_gvec_ool_arg_zpz, + a->esz == 2 ? gen_helper_sve2_urecpe_s : NULL, a, 0) -static bool trans_URECPE(DisasContext *s, arg_rpr_esz *a) -{ - if (a->esz != 2) { - return false; - } - return do_sve2_zpz_ool(s, a, gen_helper_sve2_urecpe_s); -} +TRANS_FEAT(URSQRTE, aa64_sve2, gen_gvec_ool_arg_zpz, + a->esz == 2 ? gen_helper_sve2_ursqrte_s : NULL, a, 0) -static bool trans_URSQRTE(DisasContext *s, arg_rpr_esz *a) -{ - if (a->esz != 2) { - return false; - } - return do_sve2_zpz_ool(s, a, gen_helper_sve2_ursqrte_s); -} +static gen_helper_gvec_3 * const sqabs_fns[4] = { + gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h, + gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d, +}; +TRANS_FEAT(SQABS, aa64_sve2, gen_gvec_ool_arg_zpz, sqabs_fns[a->esz], a, 0) -static bool trans_SQABS(DisasContext *s, arg_rpr_esz *a) -{ - static gen_helper_gvec_3 * const fns[4] = { - gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h, - gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d, - }; - return do_sve2_zpz_ool(s, a, fns[a->esz]); -} - -static bool trans_SQNEG(DisasContext *s, arg_rpr_esz *a) -{ - static gen_helper_gvec_3 * const fns[4] = { - gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h, - gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d, - }; - return do_sve2_zpz_ool(s, a, fns[a->esz]); -} +static gen_helper_gvec_3 * const sqneg_fns[4] = { + gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h, + gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d, +}; +TRANS_FEAT(SQNEG, aa64_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0) #define DO_SVE2_ZPZZ(NAME, name) \ static bool trans_##NAME(DisasContext *s, arg_rprr_esz *a) \