From patchwork Mon Jun 20 17:52:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 583211 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp958714mab; Mon, 20 Jun 2022 11:58:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v0N7V/hbs3nBiRvFTIEXWOJLonp8i6L6ZVjD3onfL2z0u+Q59Z/RZAdzLUMAfBL1ptBtKm X-Received: by 2002:a37:6d0:0:b0:6a6:8485:ddb0 with SMTP id 199-20020a3706d0000000b006a68485ddb0mr16517314qkg.301.1655751534088; Mon, 20 Jun 2022 11:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655751534; cv=none; d=google.com; s=arc-20160816; b=Lu3VcX4nOWg/iwlHrOrbMAYBIjw0LpqsawfgyWVi9tmNxYOroXPPLPNpTloN3uIHOH vSBquOfClLv5Ar6i2WHqwx0ZzOSdFGe6Q6OIbLpHa54fOA7ePC3ckZj/c7B+e/eHvHty IurbGJ2u2JhoDfo130UMSQ0QruiKUMfLGPC4Er7+fJDO8AHg7pzv72bw77XR69RyAGqx 0G8cDF6GLoub7/SxYWgtTyfptFK9Sn2s+me8XrdPrPN3iV+wuzt5R6wLcX3TZZCmjnvu kX7oYhCc71NW3xwdelgdZIpOpKjPAnkccZaWBTy5w23yrX8pKR8SdmQE1Z1En6UhWFxZ USQw== 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=cId+jl3LafbTbLYlOOg+jSuzH9qsoTjBGOokKriD7lU=; b=QxQ+X2qcnsfxWyEmy+AsWpnlReeIR9moVmnvF3gSFocWzPFSQunzzyNBrE7a+Yli1d WhKO0V3uBm9bVf35SCx/3lgBB5KP+tZ07qJKjzusTShvwJkikByLBWSSeRrz+kRNXkZi c0GTkmdiS3qCtWtTYDrzd0E4ZsJmsyo2IO3wdZnKxZ42bvYylt2pgRw5fIVexIJa/NGS YBeU5gz9fOrxR7IstY90mowA+e+Qrfk3tlS5AqPI03LYSpCjlMp8jM57Cws7ZrWCu9eQ slG8HOqeab1tbIeqiHM1nt+bfIE3jjnidm24lc/Aqi6iyDspKm9zxnsT1VGj2syxFn5b 6wRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vZr5D/Us"; 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 r4-20020a0cb284000000b004564637ef37si7809477qve.562.2022.06.20.11.58.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jun 2022 11:58:54 -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="vZr5D/Us"; 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]:52940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3Mbt-0006fU-J5 for patch@linaro.org; Mon, 20 Jun 2022 14:58:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3LaN-0006OL-Pm for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:53:18 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:35413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3LaF-0001OY-EJ for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:53:11 -0400 Received: by mail-pl1-x632.google.com with SMTP id o18so3325702plg.2 for ; Mon, 20 Jun 2022 10:53:06 -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=cId+jl3LafbTbLYlOOg+jSuzH9qsoTjBGOokKriD7lU=; b=vZr5D/Usa00YbQTltq5JGlPpX+tklLQsTbKZuClm0IWZaATS+6CgqsHQNbIqL++XZT PCyEt+shitVZjWtzRbBp+/TXDI/dGaGu+9KpLe7/BMygGn1a096nezym32//3+fF6BLV djFHcyYYnWrBgR/nKlE/h1jLLi2plDqYpFUQ88Ksss0o055qTGlvbgiuAICj9JaFk35V rrhVj/j3JHtK1f4BjOy/Pdi+E4ZdW+tvZBC9B9LCUXj8GfeVmHd1QC2vTWLhxfeceGv8 jHgOOxzTpEL7O6gm1ObzAKpJSzA1P0RelxBp5a150/dFHHO97nnOQ6W16bhss/GqQYAg VhvQ== 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=cId+jl3LafbTbLYlOOg+jSuzH9qsoTjBGOokKriD7lU=; b=eyJSBZVbAmaMzMWoDeMFOgEW5V87rTX0FOO4P98fQHM4pJn93voFI83+UrFhZ8Ax0b otAWr9ugYeIYHrTn4edvaYnq6mQtrAJj+bn3513SJEX4O3GMv4ABS2koXLrpJV7rENFn VlhCx8RQpg2g1Nf1VGQhoePTKUf+AKRIrrf5cG7okXEhI/sv3mUE1uY8ZPu1a+vA6ERM GDdH1TOsg8q4BfE+8usSIxc0DMxhs0Bvp8QpcuilaNBj8Dff2HNRqnhfNSqvl5yaLkuh KKsKJHJ8ZXN9YmqCDHLmXbwcW5y0UE5UIGMaOm1uIDOmVEEJ5RCfnr/C7KyWkUZROqfF Cvrw== X-Gm-Message-State: AJIora+Fg1ccNLMTH4CwW74TS6Naoecob6Lh3YwBKPsOS7hnzkO95ANq S9EOu0eYF2ROY+++zo8juBDtYXbV2Uvycw== X-Received: by 2002:a17:90b:1c02:b0:1e3:4b6d:4269 with SMTP id oc2-20020a17090b1c0200b001e34b6d4269mr38626265pjb.57.1655747586594; Mon, 20 Jun 2022 10:53:06 -0700 (PDT) Received: from stoup.. ([2602:47:d49e:3c01:a3e0:8a80:7b85:aea6]) by smtp.gmail.com with ESMTPSA id j14-20020aa7928e000000b00525133f98adsm5138138pfa.146.2022.06.20.10.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 10:53:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v3 35/51] target/arm: Implement REVD Date: Mon, 20 Jun 2022 10:52:19 -0700 Message-Id: <20220620175235.60881-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220620175235.60881-1-richard.henderson@linaro.org> References: <20220620175235.60881-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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 bf561c270a..d1e229fd6e 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 9a26f253e0..5de82696b5 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 58d0894e15..1129f1fc56 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -2896,6 +2896,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)