From patchwork Fri Jul 8 15:15:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 588548 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:bb16:0:0:0:0 with SMTP id jd22csp780927mab; Fri, 8 Jul 2022 08:51:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ts1IRv4UbEmWeNo2o4C3LTH9+ENICr5I3SoMorns7WyJF/2AwbL9gnrA8k+27enaXbxNTc X-Received: by 2002:a37:a254:0:b0:6b5:5007:dc8c with SMTP id l81-20020a37a254000000b006b55007dc8cmr2836499qke.712.1657295471649; Fri, 08 Jul 2022 08:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657295471; cv=none; d=google.com; s=arc-20160816; b=qbcu/i2NTIzej8mOqKA22oPlsXGZj31BWVWQLXcJGN3CvDcma4JZ2n3ONR8ZYcNJ9P xsC1Mq2J/yywe93c1jq6ktYztsGQvcd1Ut0Vs10bdtyJij+3inTS8gxfBca+NXSxVK/n tJpcYjqT64yb/AqgDfSD/nYt8y0eogGM813IBfgluiCrBkmjbKoq29OZwhhqtD/zBjST Z+yDfh93/icPOS4fy9rHbcFvFvOKZ7ftLQ4IXI/YQa1HFppQRK3j6WsGxzsQb+kNZlaI 6fkfM1cVvmTadvrFeRZBYK2rwNwJmO3i9yq1w2QUMYS1wP2VLiAWGfLEiaTIKO/4McEr 0JRw== 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=yhKgrJaomw461n0G8r0qwjF4jfQCq4qrekPPxrMl0oY=; b=khd6jsCKlj7pbMm718Wkty9BJ3hlsonclDQdA9kRFaGPP/+7RYdnaUa2prMXlmQf4X CXd4nu5S011pbaTvLsEm7TX48W06KzEW8lR05HLNPLSb5lI62Hxca3nlWtlZeReSbDvq SSuyVIIipq1FFKNEzlKAFkrRIls1/zavCOq56vyvDB92jR0SggFWVsxTg+8R0F+g7wgr ONmBw6CtEuSvGOf9AWlSSF96X17y+zypO6NZKl/ErzyJCp46oiw3ZcuIwiGkxgrl0Qtl BWYQRute5Am3JLgeBfflR+vrsX5HZ19HHe4+6z2YQYzT46823tZRo09lA4uDL0YK7ssU gQiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K50VoL0X; 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 e3-20020ac84e43000000b0031ea94759c1si633956qtw.33.2022.07.08.08.51.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Jul 2022 08:51:11 -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=K50VoL0X; 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]:53452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9qG7-0000x7-8L for patch@linaro.org; Fri, 08 Jul 2022 11:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9pjK-0004Gg-KS for qemu-devel@nongnu.org; Fri, 08 Jul 2022 11:17:18 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:39595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9pjI-0002Py-Qs for qemu-devel@nongnu.org; Fri, 08 Jul 2022 11:17:18 -0400 Received: by mail-pg1-x536.google.com with SMTP id q82so15439009pgq.6 for ; Fri, 08 Jul 2022 08:17:15 -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=yhKgrJaomw461n0G8r0qwjF4jfQCq4qrekPPxrMl0oY=; b=K50VoL0XGnWjHINp1/GMgweMk7v3hcTWzlYN9ePN/rOZYoZDHkLL+iMI0QMVl7BzFx dK+YlgZk8Vqcb3oE2WdGh5CiT6Ep809TFJJlXIoGXIA8g3jpXFAFQk9vWL57r2Zw+Fp4 6X9BJA9rKpdO2446fu6E43C1nPRb9OZV2SMnDLe0FO7qnxfmZ72LszJEVRojO4b4bZVM uVGDJScATeE9sfHkxahRBXtIqs/vxfJ5X4YfGEUjc6v+biHvKXAzTAH3uamkxtomdu/n FENOKy+BN/eY58pVgkLmQottUMme4hl3I4hWov7QIYToxuiuuz/+fgsEVQeMV4SZzQLc TrFg== 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=yhKgrJaomw461n0G8r0qwjF4jfQCq4qrekPPxrMl0oY=; b=k34xAKkilUpJWfp68W4aC4uIjiAL4gGonibraiqJAHuaKzwmbg46WPZhQlJM8JWeB6 jcUUQhVy4ThZYHq52WXwnIJSEa6SdWph0EroxMCvlxcFgQEypC8Ceku3E7r7vwL+IiDB Xc8WUrS6dc1qYLfr8eSQ8uUjbeoJCIyR10zTervOXXfHollESaYPiBW6AhulkvQem+T1 dZsQjbET2pR9PgM72Sy+tkcEIuiVZ7ae5avJN1hB8BVux+MXGEeS6iVyyjjqxKaLXfmr hcwCkMCPOeUpl0u3FqC8phOturBBazO+pmoxqUDFRgrONbXcxbuPSt7F6OAOFgvSsvI4 w/Og== X-Gm-Message-State: AJIora/7xG6P+bdf7KpTSdbu+qpyOY0IF1y+xMY8G6Roov0nusqkhgO4 wNxw/BI89VS1c6Z5utEy5K0QDYV/V/b9xZQV X-Received: by 2002:a63:f415:0:b0:408:808b:238f with SMTP id g21-20020a63f415000000b00408808b238fmr3660350pgi.469.1657293434384; Fri, 08 Jul 2022 08:17:14 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id n17-20020a056a0007d100b0051bada81bc7sm29085774pfu.161.2022.07.08.08.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 08:17:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v6 29/45] target/arm: Implement REVD Date: Fri, 8 Jul 2022 20:45:24 +0530 Message-Id: <20220708151540.18136-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220708151540.18136-1-richard.henderson@linaro.org> References: <20220708151540.18136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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" This is an SVE instruction that operates using the SVE vector length but that it is present only if SME is implemented. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper-sve.h | 2 ++ target/arm/sve.decode | 1 + target/arm/sve_helper.c | 16 ++++++++++++++++ target/arm/translate-sve.c | 2 ++ 4 files changed, 21 insertions(+) diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index ab0333400f..cc4e1d8948 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -719,6 +719,8 @@ DEF_HELPER_FLAGS_4(sve_revh_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_revw_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sme_revd_q, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + DEF_HELPER_FLAGS_4(sve_rbit_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_rbit_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_rbit_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/sve.decode b/target/arm/sve.decode index 966803cbb7..a9e48f07b4 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -652,6 +652,7 @@ REVB 00000101 .. 1001 00 100 ... ..... ..... @rd_pg_rn REVH 00000101 .. 1001 01 100 ... ..... ..... @rd_pg_rn REVW 00000101 .. 1001 10 100 ... ..... ..... @rd_pg_rn RBIT 00000101 .. 1001 11 100 ... ..... ..... @rd_pg_rn +REVD 00000101 00 1011 10 100 ... ..... ..... @rd_pg_rn_e0 # SVE vector splice (predicated, destructive) SPLICE 00000101 .. 101 100 100 ... ..... ..... @rdn_pg_rm diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index df16170469..d6f7ef94fe 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -931,6 +931,22 @@ DO_ZPZ_D(sve_revh_d, uint64_t, hswap64) DO_ZPZ_D(sve_revw_d, uint64_t, wswap64) +void HELPER(sme_revd_q)(void *vd, void *vn, void *vg, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc) / 8; + uint64_t *d = vd, *n = vn; + uint8_t *pg = vg; + + for (i = 0; i < opr_sz; i += 2) { + if (pg[H1(i)] & 1) { + uint64_t n0 = n[i + 0]; + uint64_t n1 = n[i + 1]; + d[i + 0] = n1; + d[i + 1] = n0; + } + } +} + DO_ZPZ(sve_rbit_b, uint8_t, H1, revbit8) DO_ZPZ(sve_rbit_h, uint16_t, H1_2, revbit16) DO_ZPZ(sve_rbit_s, uint32_t, H1_4, revbit32) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 24ffb69a2a..9ed3b267fd 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -2901,6 +2901,8 @@ TRANS_FEAT(REVH, aa64_sve, gen_gvec_ool_arg_zpz, revh_fns[a->esz], a, 0) TRANS_FEAT(REVW, aa64_sve, gen_gvec_ool_arg_zpz, a->esz == 3 ? gen_helper_sve_revw_d : NULL, a, 0) +TRANS_FEAT(REVD, aa64_sme, gen_gvec_ool_arg_zpz, gen_helper_sme_revd_q, a, 0) + TRANS_FEAT(SPLICE, aa64_sve, gen_gvec_ool_arg_zpzz, gen_helper_sve_splice, a, a->esz)