From patchwork Fri May 27 18:17:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 576579 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8607:0:0:0:0 with SMTP id bb7csp907448mab; Fri, 27 May 2022 12:09:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUM68mIchwdcgjYRV4mfnjNR+z3r3CFRAXA0io/R5g4PCe5mp1YjBflIGQsA8BIdJG/h8I X-Received: by 2002:ac8:5e54:0:b0:2f3:f4ee:efbd with SMTP id i20-20020ac85e54000000b002f3f4eeefbdmr34004334qtx.295.1653678582559; Fri, 27 May 2022 12:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653678582; cv=none; d=google.com; s=arc-20160816; b=StYDX8kNHft7tX282uo97QeIiuBrZaBh33FWrYP1zDfJvrq5Z9yidag1/3ugAtMqzR SnR/ectjtVladQ6Spd6pe4KCCm7D++jSpBedG2p2J2B7iyZc498quLUJ5CAAacvPa77A WHxlcBWoABK9IRf/DH6xOp/KHG5N0vLuH5beeh1ZZjBDbnftePiIUIOzI1KnkaLf+fDH I6WcW0U+LoBm4/ACNy2iCm8ZeyS2Q5yneGsY9oHS9frQ/k+FwRqSNA5HYdjI1g3AayFy MgBO+KzgT4AIEFzFV0CVaUN3ekX/qr00Mcc87xaBl6UCQU3F76qK7s3tUYk7VShpUcAP GNxA== 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:cc:to :from:dkim-signature; bh=BHNpAw9EjAAEi6vEkKb3dOiSHgbppKaP06mHfmvGup8=; b=DkittqQuv4wJwicPziYfjA+cuP4oh21O+i4DyPo7Wc02sLR7IvReBSA1062Kln1ord Z/6eejDp4bi+T38572Loq2IktWFlO85pAEvnm6XYPG1Dtgo8j64++hrqfbqNSJR0PYr1 diR0ApYRLQ3++QvMUwOYNmDPxFic+aOip0F3DzE3QZ3BL6WhZutMv0oDMer11Q+ZSnl/ N6zOQknXj/tP1XgUj/fjB4Ij7fwpskTrGGFikJgRCuSXZTMtQJxL+XF+w6zE8/OiKGqo ux0MJIRl2DDPv7gD14A/EnhbXa+1kRFMYorjZiVmUv2IjiR4Uk4QY/FmwRvSI7Jd2xqL x1ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=srjFzTpT; 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 v9-20020a05620a440900b006a355aa7c86si3795568qkp.173.2022.05.27.12.09.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 May 2022 12:09:42 -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=srjFzTpT; 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]:39168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nufLC-0005Uz-4R for patch@linaro.org; Fri, 27 May 2022 15:09:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nueYn-0007aX-43 for qemu-devel@nongnu.org; Fri, 27 May 2022 14:19:41 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:37504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nueYh-0003eW-DR for qemu-devel@nongnu.org; Fri, 27 May 2022 14:19:40 -0400 Received: by mail-pf1-x42a.google.com with SMTP id bo5so4993072pfb.4 for ; Fri, 27 May 2022 11:19:34 -0700 (PDT) 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=BHNpAw9EjAAEi6vEkKb3dOiSHgbppKaP06mHfmvGup8=; b=srjFzTpTZZTc9FLhIJhFO2xDvNLjWqskWVoKz1P47MJ1AvIO0bpOrTvPzQ382ylyRV dRFuMKdEW1+FClEVlcBVx97F9S+PwBWJcx81ODI2kxstc6/o4u+UIG4J+284cL8Wp9WQ Y2qCTlsQfNWII7XfShp8P7Gm/Df6VU6nuDhfYaczojnxwozj6TllofD7k7unGIMzlSpE AJ7JLwxLMVYAi3mGyTCvui1CU63Czjdq9Jhj6DJxtOjjj0s42vtoUFz5XGvO9wGz7DFw hDUFSMFhJtrgL2TkPXLvTCdOJhiXHpYLSwfOc5VE6xq/Ueve7ZhP4tWHm9CWPEiVZNUm dHWA== 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=BHNpAw9EjAAEi6vEkKb3dOiSHgbppKaP06mHfmvGup8=; b=Cp1pqv+o7AOVYpwKqVeIYswn4EeBIcW5C1sfkJcj2GQ3BTXTTfTaRjlSOeg2CAeAnS p2SU7+jQrJWA6Y7DUGQlCD5ycMMyDE+NanGg4vgHuW8fRmQvoal4TWi4haqk/yd52JCS wDXs/jTs0h/RtBDAAf1iwhdIWFhIKiZIOmf9VNCJPue3fc/dLNEPOPjYXby6DosFvbel IHOyo/nv7LJViH9g+A94HaPmip+RwBJrCApoVbZSgoRTUMHM27WDl3UZdJtBecRN9FCK zb9hicBGaaYCk/+1qKII/WVb0XZdQZOgsYxkO+Tp2h7GrED5kNDmbFVCoGRCNC/McHae qDJg== X-Gm-Message-State: AOAM533CdwDdREv9Ujx4nK8jp1stGiQCTyrgJ4BOxaZi1vRYiHmaipyO zmzK6uH3jYuJLzpKN4ZgmPeAEmE4dURCXg== X-Received: by 2002:a63:1163:0:b0:3fa:5e1c:f86f with SMTP id 35-20020a631163000000b003fa5e1cf86fmr21997725pgr.543.1653675574164; Fri, 27 May 2022 11:19:34 -0700 (PDT) Received: from stoup.. (174-21-71-225.tukw.qwest.net. [174.21.71.225]) by smtp.gmail.com with ESMTPSA id t5-20020a17090ae50500b001deb3cbd8f1sm1911612pjy.27.2022.05.27.11.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 11:19:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 027/114] target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zpzz Date: Fri, 27 May 2022 11:17:40 -0700 Message-Id: <20220527181907.189259-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220527181907.189259-1-richard.henderson@linaro.org> References: <20220527181907.189259-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-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=unavailable 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" Convert SVE translation functions directly using gen_gvec_ool_arg_zpzz to TRANS_FEAT. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 85 ++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index d63099c5b7..f8277eeb7c 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -755,54 +755,46 @@ static void do_sel_z(DisasContext *s, int rd, int rn, int rm, int pg, int esz) gen_gvec_ool_zzzp(s, fns[esz], rd, rn, rm, pg, 0); } -#define DO_ZPZZ(NAME, name) \ -static bool trans_##NAME##_zpzz(DisasContext *s, arg_rprr_esz *a) \ -{ \ - static gen_helper_gvec_4 * const fns[4] = { \ - gen_helper_sve_##name##_zpzz_b, gen_helper_sve_##name##_zpzz_h, \ - gen_helper_sve_##name##_zpzz_s, gen_helper_sve_##name##_zpzz_d, \ +#define DO_ZPZZ(NAME, FEAT, name) \ + static gen_helper_gvec_4 * const name##_zpzz_fns[4] = { \ + gen_helper_##name##_zpzz_b, gen_helper_##name##_zpzz_h, \ + gen_helper_##name##_zpzz_s, gen_helper_##name##_zpzz_d, \ }; \ - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); \ -} + TRANS_FEAT(NAME, FEAT, gen_gvec_ool_arg_zpzz, \ + name##_zpzz_fns[a->esz], a, 0) -DO_ZPZZ(AND, and) -DO_ZPZZ(EOR, eor) -DO_ZPZZ(ORR, orr) -DO_ZPZZ(BIC, bic) +DO_ZPZZ(AND_zpzz, aa64_sve, sve_and) +DO_ZPZZ(EOR_zpzz, aa64_sve, sve_eor) +DO_ZPZZ(ORR_zpzz, aa64_sve, sve_orr) +DO_ZPZZ(BIC_zpzz, aa64_sve, sve_bic) -DO_ZPZZ(ADD, add) -DO_ZPZZ(SUB, sub) +DO_ZPZZ(ADD_zpzz, aa64_sve, sve_add) +DO_ZPZZ(SUB_zpzz, aa64_sve, sve_sub) -DO_ZPZZ(SMAX, smax) -DO_ZPZZ(UMAX, umax) -DO_ZPZZ(SMIN, smin) -DO_ZPZZ(UMIN, umin) -DO_ZPZZ(SABD, sabd) -DO_ZPZZ(UABD, uabd) +DO_ZPZZ(SMAX_zpzz, aa64_sve, sve_smax) +DO_ZPZZ(UMAX_zpzz, aa64_sve, sve_umax) +DO_ZPZZ(SMIN_zpzz, aa64_sve, sve_smin) +DO_ZPZZ(UMIN_zpzz, aa64_sve, sve_umin) +DO_ZPZZ(SABD_zpzz, aa64_sve, sve_sabd) +DO_ZPZZ(UABD_zpzz, aa64_sve, sve_uabd) -DO_ZPZZ(MUL, mul) -DO_ZPZZ(SMULH, smulh) -DO_ZPZZ(UMULH, umulh) +DO_ZPZZ(MUL_zpzz, aa64_sve, sve_mul) +DO_ZPZZ(SMULH_zpzz, aa64_sve, sve_smulh) +DO_ZPZZ(UMULH_zpzz, aa64_sve, sve_umulh) -DO_ZPZZ(ASR, asr) -DO_ZPZZ(LSR, lsr) -DO_ZPZZ(LSL, lsl) +DO_ZPZZ(ASR_zpzz, aa64_sve, sve_asr) +DO_ZPZZ(LSR_zpzz, aa64_sve, sve_lsr) +DO_ZPZZ(LSL_zpzz, aa64_sve, sve_lsl) -static bool trans_SDIV_zpzz(DisasContext *s, arg_rprr_esz *a) -{ - static gen_helper_gvec_4 * const fns[4] = { - NULL, NULL, gen_helper_sve_sdiv_zpzz_s, gen_helper_sve_sdiv_zpzz_d - }; - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); -} +static gen_helper_gvec_4 * const sdiv_fns[4] = { + NULL, NULL, gen_helper_sve_sdiv_zpzz_s, gen_helper_sve_sdiv_zpzz_d +}; +TRANS_FEAT(SDIV_zpzz, aa64_sve, gen_gvec_ool_arg_zpzz, sdiv_fns[a->esz], a, 0) -static bool trans_UDIV_zpzz(DisasContext *s, arg_rprr_esz *a) -{ - static gen_helper_gvec_4 * const fns[4] = { - NULL, NULL, gen_helper_sve_udiv_zpzz_s, gen_helper_sve_udiv_zpzz_d - }; - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); -} +static gen_helper_gvec_4 * const udiv_fns[4] = { + NULL, NULL, gen_helper_sve_udiv_zpzz_s, gen_helper_sve_udiv_zpzz_d +}; +TRANS_FEAT(UDIV_zpzz, aa64_sve, gen_gvec_ool_arg_zpzz, udiv_fns[a->esz], a, 0) static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) { @@ -1068,17 +1060,12 @@ TRANS_FEAT(SQSHLU, aa64_sve2, gen_gvec_ool_arg_zpzi, */ #define DO_ZPZW(NAME, name) \ -static bool trans_##NAME##_zpzw(DisasContext *s, arg_rprr_esz *a) \ -{ \ - static gen_helper_gvec_4 * const fns[3] = { \ + static gen_helper_gvec_4 * const name##_zpzw_fns[4] = { \ gen_helper_sve_##name##_zpzw_b, gen_helper_sve_##name##_zpzw_h, \ - gen_helper_sve_##name##_zpzw_s, \ + gen_helper_sve_##name##_zpzw_s, NULL \ }; \ - if (a->esz < 0 || a->esz >= 3) { \ - return false; \ - } \ - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); \ -} + TRANS_FEAT(NAME##_zpzw, aa64_sve, gen_gvec_ool_arg_zpzz, \ + a->esz < 0 ? NULL : name##_zpzw_fns[a->esz], a, 0) DO_ZPZW(ASR, asr) DO_ZPZW(LSR, lsr)