From patchwork Fri May 27 18:17:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 576562 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8607:0:0:0:0 with SMTP id bb7csp894465mab; Fri, 27 May 2022 11:51:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys3HpvIWp//2ag+t5i5Eb6n7t5O4QRL4aypPBwLyTmjQGcIEMS+5zUHm75IIloYFkf/apJ X-Received: by 2002:a05:622a:1ca:b0:2f3:e805:5c36 with SMTP id t10-20020a05622a01ca00b002f3e8055c36mr34734537qtw.394.1653677479961; Fri, 27 May 2022 11:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653677479; cv=none; d=google.com; s=arc-20160816; b=wpEP2xV6JPvV6i66JEMGNEL3ryXFcOUfrPd/KRF2x2OSTsQiO59Jk5N8GWbUswJgTf yVnPWz8MGGFDbYfzaxq6lVD8aK08uPujC9X0/gQiPo1IA6Kv1GT1kCzHAIA62Sy7HU/n 2+P1Jjgmf/qTWVhkO9aRwYkPMz8FXF1QMCjnxim6z1mTFbMyuYkqQXxD6+zeQCEDLJ3O hsv7F5fsBkyyXISKZnPALAfF18X1h2qDStn+EC7th/79bevKHWYT28CROfg2cXAg+QB7 E9glpVlAVI57PGKaAmXv6MjEZcyTvyvAJB16GsiGxyi6416cNv6b8U6LYur7GAE6qBPa Z3cQ== 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=BISgCZ5si8nkaQwz0BiOtyVorklPvI5PGitAoXiYROQ=; b=lwRmsEvKjdVZXCTkVi/NFlqVTObNBO6F6MB/JUblHfUFF+loJs3kpYb/V1WV91Q9it 4qSPsxD2faq7PCZujtT3XfKwSDan/bpkh4CYaqiFARJRlxtoWrSD18X9/Wb9KzfLq4xG 2H6rJeLjoHHQH78xM6bHEqqv+8IpQZLlOAfWUsmY/1FlzLY4lDOTKNV+xJz1uyYZ0VW2 VtIYWx1Mv9+LZCNKKBkyKKGcZXH5gYmgIYhz/O2QTIk2VDUzBt+KxiRfDeUUE5A7XmZt +9V0b+FOnhiOfFZz/RgwU8GCVo91uxmxI/ZpxO3ADJW95v3RUWeCxbg7Zc7aTYZ8BO5b hqbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lB395Xve; 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 bj11-20020a05620a190b00b006a0ac86b3besi4077468qkb.719.2022.05.27.11.51.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 May 2022 11:51:19 -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=lB395Xve; 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]:52770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuf3P-0007sV-1F for patch@linaro.org; Fri, 27 May 2022 14:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nueYT-0006UP-U9 for qemu-devel@nongnu.org; Fri, 27 May 2022 14:19:21 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:35644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nueYR-0003Xc-4g for qemu-devel@nongnu.org; Fri, 27 May 2022 14:19:21 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 129so289650pgc.2 for ; Fri, 27 May 2022 11:19:18 -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=BISgCZ5si8nkaQwz0BiOtyVorklPvI5PGitAoXiYROQ=; b=lB395XvePLmEZQaY4+sFEz7f2BN0kZNwbEu+kTaptiTXPtICisy5lFtkB4/mztk5ap nDrQytIQCJdzoaCgVhLA4e6LV65WCAvt8w7+fdP0CI6f5jrwgzlPXf0UquDDh7i/OU5V 5jZ4g8x7cZvG7C0tQqwCnBiMJ8mncu7+OBAz6qAA2OoJ61zplWTk9NzC5R9bjgJwkScF MrY1NCM+Eg4okHQbAG68L1fY6x2ijWW3UqTASb+apL/AZNi9bmHses1NwV0pUraYUmVg tASLnL3DUJxrYdpC+5Kgytq5drts3yPFF3+svUuD2wsvO8d/rfmdTay+F88n5aqg4NTv xilw== 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=BISgCZ5si8nkaQwz0BiOtyVorklPvI5PGitAoXiYROQ=; b=mGS631zk8g0DDxXGKuw/sQuBCXWgyzZpzE/2cGSQNjWjsGbF3a+AA2aGhL2iqv6a/0 g8g7N67r8r3lHcVvsH/tmTBxBJy5cfe9/wAWKlnYjkrpQffo1U9cPb04+urrlYSr9jtm vYIZmssU1EX5yfScqLzDuYf2LfhjT80l0SjbiNRJqIk4vJyz+QEdAO5bH2aX4zvMEpwv RcvYaNwIOruyPV+Ch+bAbrpajOJr7SsUQbE6HyDKYV9uc/yMs0hxKOrLM7+28iuzGdve I13z4iuXTmtexCekHxxMCZB+ugoia044zJ8vo+N5YVoAbp4cm3p3RFuSXRUunZwTVqGJ HTDg== X-Gm-Message-State: AOAM531B0Q2SommZZpiup7Uq+4yse3QZFmNh/5i95uh+KnHui4XJ6Xq5 Tuw7+8od7zR1Iu+INDWnhns89n2l/L7Fvg== X-Received: by 2002:a05:6a00:a85:b0:4e0:57a7:2d5d with SMTP id b5-20020a056a000a8500b004e057a72d5dmr45178072pfl.81.1653675557802; Fri, 27 May 2022 11:19:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 11:19:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 009/114] target/arm: Use TRANS_FEAT for gen_gvec_ool_zzzz Date: Fri, 27 May 2022 11:17:22 -0700 Message-Id: <20220527181907.189259-10-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::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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" Convert SVE translation functions directly using gen_gvec_ool_zzzz to TRANS_FEAT. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 89 +++++++++++++------------------------- 1 file changed, 29 insertions(+), 60 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 5aaef5b18f..823c1d0ae3 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -2417,19 +2417,12 @@ static gen_helper_gvec_3 * const sve_tbl_fns[4] = { }; TRANS_FEAT(TBL, aa64_sve, gen_gvec_ool_arg_zzz, sve_tbl_fns[a->esz], a, 0) -static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) -{ - static gen_helper_gvec_4 * const fns[4] = { - gen_helper_sve2_tbl_b, gen_helper_sve2_tbl_h, - gen_helper_sve2_tbl_s, gen_helper_sve2_tbl_d - }; - - if (!dc_isar_feature(aa64_sve2, s)) { - return false; - } - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, - (a->rn + 1) % 32, a->rm, 0); -} +static gen_helper_gvec_4 * const sve2_tbl_fns[4] = { + gen_helper_sve2_tbl_b, gen_helper_sve2_tbl_h, + gen_helper_sve2_tbl_s, gen_helper_sve2_tbl_d +}; +TRANS_FEAT(TBL_sve2, aa64_sve2, gen_gvec_ool_zzzz, sve2_tbl_fns[a->esz], + a->rd, a->rn, (a->rn + 1) % 32, a->rm, 0) static gen_helper_gvec_3 * const tbx_fns[4] = { gen_helper_sve2_tbx_b, gen_helper_sve2_tbx_h, @@ -3810,15 +3803,12 @@ DO_ZZI(UMIN, umin) #undef DO_ZZI -static bool trans_DOT_zzzz(DisasContext *s, arg_DOT_zzzz *a) -{ - static gen_helper_gvec_4 * const fns[2][2] = { - { gen_helper_gvec_sdot_b, gen_helper_gvec_sdot_h }, - { gen_helper_gvec_udot_b, gen_helper_gvec_udot_h } - }; - return gen_gvec_ool_zzzz(s, fns[a->u][a->sz], - a->rd, a->rn, a->rm, a->ra, 0); -} +static gen_helper_gvec_4 * const dot_fns[2][2] = { + { gen_helper_gvec_sdot_b, gen_helper_gvec_sdot_h }, + { gen_helper_gvec_udot_b, gen_helper_gvec_udot_h } +}; +TRANS_FEAT(DOT_zzzz, aa64_sve, gen_gvec_ool_zzzz, + dot_fns[a->u][a->sz], a->rd, a->rn, a->rm, a->ra, 0) /* * SVE Multiply - Indexed @@ -8196,46 +8186,25 @@ static bool trans_UMLSLT_zzzw(DisasContext *s, arg_rrrr_esz *a) return do_umlsl_zzzw(s, a, true); } -static bool trans_CMLA_zzzz(DisasContext *s, arg_CMLA_zzzz *a) -{ - static gen_helper_gvec_4 * const fns[] = { - gen_helper_sve2_cmla_zzzz_b, gen_helper_sve2_cmla_zzzz_h, - gen_helper_sve2_cmla_zzzz_s, gen_helper_sve2_cmla_zzzz_d, - }; +static gen_helper_gvec_4 * const cmla_fns[] = { + gen_helper_sve2_cmla_zzzz_b, gen_helper_sve2_cmla_zzzz_h, + gen_helper_sve2_cmla_zzzz_s, gen_helper_sve2_cmla_zzzz_d, +}; +TRANS_FEAT(CMLA_zzzz, aa64_sve2, gen_gvec_ool_zzzz, + cmla_fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot) - if (!dc_isar_feature(aa64_sve2, s)) { - return false; - } - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, - a->rm, a->ra, a->rot); -} +static gen_helper_gvec_4 * const cdot_fns[] = { + NULL, NULL, gen_helper_sve2_cdot_zzzz_s, gen_helper_sve2_cdot_zzzz_d +}; +TRANS_FEAT(CDOT_zzzz, aa64_sve2, gen_gvec_ool_zzzz, + cdot_fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot) -static bool trans_CDOT_zzzz(DisasContext *s, arg_CMLA_zzzz *a) -{ - static gen_helper_gvec_4 * const fns[] = { - NULL, NULL, gen_helper_sve2_cdot_zzzz_s, gen_helper_sve2_cdot_zzzz_d - }; - - if (!dc_isar_feature(aa64_sve2, s)) { - return false; - } - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, - a->rm, a->ra, a->rot); -} - -static bool trans_SQRDCMLAH_zzzz(DisasContext *s, arg_SQRDCMLAH_zzzz *a) -{ - static gen_helper_gvec_4 * const fns[] = { - gen_helper_sve2_sqrdcmlah_zzzz_b, gen_helper_sve2_sqrdcmlah_zzzz_h, - gen_helper_sve2_sqrdcmlah_zzzz_s, gen_helper_sve2_sqrdcmlah_zzzz_d, - }; - - if (!dc_isar_feature(aa64_sve2, s)) { - return false; - } - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, - a->rm, a->ra, a->rot); -} +static gen_helper_gvec_4 * const sqrdcmlah_fns[] = { + gen_helper_sve2_sqrdcmlah_zzzz_b, gen_helper_sve2_sqrdcmlah_zzzz_h, + gen_helper_sve2_sqrdcmlah_zzzz_s, gen_helper_sve2_sqrdcmlah_zzzz_d, +}; +TRANS_FEAT(SQRDCMLAH_zzzz, aa64_sve2, gen_gvec_ool_zzzz, + sqrdcmlah_fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot) static bool trans_USDOT_zzzz(DisasContext *s, arg_USDOT_zzzz *a) {