From patchwork Tue Mar 9 16:19:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 396031 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2784222jai; Tue, 9 Mar 2021 09:41:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuFZvw2/p52zWj7/8YY8AxH108YKzGSaIcglugbCKYn2YXw1twnq9vApLbwe67EBFVxEq5 X-Received: by 2002:a02:c894:: with SMTP id m20mr30272290jao.80.1615311688869; Tue, 09 Mar 2021 09:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615311688; cv=none; d=google.com; s=arc-20160816; b=py0pxE2WRQ2jXfhr6P+0SykYjGBres7pIiv5Pbhc3sfOJxUxD8AabsAnd42XSc4FNv KcFfBVT4xyQUrNj7TIgmQl5YXyBK0c3M0OxwrEt/jTUjt3d89heQc1Z5duXBymxvZ+KT SXTVzVyrrnjCQMy41iLKKtOy6D6OPPg35ZgsEZXR7UsOFIKJySkcHjzncvxHJwnhbcho MlI4TMFUsEP/r15PTZ5bhvTj81KjwvlrOhoFrYNGb93RLAivQlMAkXqaeXUqhIXh1AlW HRE1FYIqu3Gwur7FSLvYpi5GMqMQOCZYwRSBFLKPv2VAfH0mdn3qstHKBM1w9XtZYgWh bDlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=1ZQl5tAHE23Q9wb6v8En0geqPTjfeiUtEihoaGG8gow=; b=J2fQNfwtXwpGIj9ix0P/UR3VVvOMuwXnKNd5tdTa9S87l+XkqNFRkepxpKZ8SOINGa VDvA8jxOwXExRqUoF/HP3CK9BbTivO8AmBujaaoriY5bscc4R3elagrA64vVdo0Fz6ub q2pZQXrdjiW+T4wscKIenaTKqOI51pfc7tNJnBPILBH2SxGE09E+GLYuOXYi1CpJhF/C gxU4PJzy9IpvOvEZO5KCL4HyuaVpOVidjCwP1VQmXPB9Tz8tPSkQ8dvgwHtUcwfMOTBR OWTQEKkD983yuj9JA3uCS19UsZsPZdsVL2fLSUAt+mf5dErCHuprd5P0TLU2H7hrj0Ct um3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IkrZQtGS; 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 j12si13182305ila.38.2021.03.09.09.41.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Mar 2021 09:41:28 -0800 (PST) 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=IkrZQtGS; 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]:40488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJgMK-0002HW-7w for patch@linaro.org; Tue, 09 Mar 2021 12:41:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJf6h-0007JH-Ne for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:21:15 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:44661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJf6X-0002Sf-DF for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:21:15 -0500 Received: by mail-oi1-x22a.google.com with SMTP id w195so8891023oif.11 for ; Tue, 09 Mar 2021 08:21:01 -0800 (PST) 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=1ZQl5tAHE23Q9wb6v8En0geqPTjfeiUtEihoaGG8gow=; b=IkrZQtGSZl0n9+EqICXW9HCsxrQ7gUaoQVgPHWvhphUYvWbXf6vyA+z3v1m+TnmfJT 06+v1Aphui73fWutYl4yrRyddhs+06mtKYtU62ZAcCaqL1+29lGmgub+Mux6f3PKEEGQ Enb0cmOmO6Fuc54YFdKiS8597c/yI/50fSpPt7ocqz/epOPnT5WM7S0uMHM9nIQEqnMd xxHg389+aO9MV3Gt74BIfZBIHHU8VbMStz8HgY8gwSObubkSdVmRcPEonmskYlMl5HED NuHJ4dGFhBGcs+Qq5mKJj1PartIR2/I1KJLCvQsj3AGiGBy1JgJrA+pS3r5cPuaw9pia oiSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1ZQl5tAHE23Q9wb6v8En0geqPTjfeiUtEihoaGG8gow=; b=W+7fXJw/SoUKINZJlm2zR0Aj8PQZFdMBfIYAFD387Xboem2dbItYg1PGL1xCzjSa3V g+cFSJZA5wGkmMkDRwts9sTspBSUF38xFt1vPy6ad1DU89xS/InEhRQCpwX1SOPjkSrQ OUiEEL8MC+/Usw5ESw8xyA1q0861f7e1DKnr1dg9qLocduORMnX/0pj9Q9esVdBhRlgT Y6GZ3gSbTlV4wicRy1VpL6sR7VxzJArCx4UDus1XCYP40Fbm6NADjdHDvuuMY9+WcFbl WalqRGcyp+Giz60xsUchSSbKRN/D5iyJwmYpydykJTcpMe/EHWH+FfxvU3JHHHk57ygX Zx0A== X-Gm-Message-State: AOAM533YRCXWHLIxtB8jyDj3JPl1jcdea5s2LeMDjigLdPSsnf2Xu/PR SrPvIMocQR/gXi936pQd66+zXnN0YOJ+oNrz X-Received: by 2002:a54:488b:: with SMTP id r11mr3635864oic.166.1615306861043; Tue, 09 Mar 2021 08:21:01 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id v23sm2516474ots.63.2021.03.09.08.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 08:21:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 16/78] target/arm: Implement SVE2 bitwise exclusive-or interleaved Date: Tue, 9 Mar 2021 08:19:39 -0800 Message-Id: <20210309162041.23124-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210309162041.23124-1-richard.henderson@linaro.org> References: <20210309162041.23124-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22a; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22a.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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/helper-sve.h | 5 +++++ target/arm/sve.decode | 5 +++++ target/arm/sve_helper.c | 20 ++++++++++++++++++++ target/arm/translate-sve.c | 19 +++++++++++++++++++ 4 files changed, 49 insertions(+) -- 2.25.1 diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index 740939e7a8..f65818da05 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -2372,3 +2372,8 @@ DEF_HELPER_FLAGS_3(sve2_sshll_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) DEF_HELPER_FLAGS_3(sve2_ushll_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) DEF_HELPER_FLAGS_3(sve2_ushll_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) DEF_HELPER_FLAGS_3(sve2_ushll_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) + +DEF_HELPER_FLAGS_4(sve2_eoril_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_eoril_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_eoril_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_eoril_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/sve.decode b/target/arm/sve.decode index a3191eba7b..0922a44829 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1215,3 +1215,8 @@ SSHLLB 01000101 .. 0 ..... 1010 00 ..... ..... @rd_rn_tszimm_shl SSHLLT 01000101 .. 0 ..... 1010 01 ..... ..... @rd_rn_tszimm_shl USHLLB 01000101 .. 0 ..... 1010 10 ..... ..... @rd_rn_tszimm_shl USHLLT 01000101 .. 0 ..... 1010 11 ..... ..... @rd_rn_tszimm_shl + +## SVE2 bitwise exclusive-or interleaved + +EORBT 01000101 .. 0 ..... 10010 0 ..... ..... @rd_rn_rm +EORTB 01000101 .. 0 ..... 10010 1 ..... ..... @rd_rn_rm diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 3e80b612ea..9f5d143348 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -1221,6 +1221,26 @@ DO_ZZZ_WTB(sve2_usubw_d, uint64_t, uint32_t, , H1_4, DO_SUB) #undef DO_ZZZ_WTB +#define DO_ZZZ_NTB(NAME, TYPE, H, OP) \ +void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ +{ \ + intptr_t i, opr_sz = simd_oprsz(desc); \ + intptr_t sel1 = extract32(desc, SIMD_DATA_SHIFT, 1) * sizeof(TYPE); \ + intptr_t sel2 = extract32(desc, SIMD_DATA_SHIFT + 1, 1) * sizeof(TYPE); \ + for (i = 0; i < opr_sz; i += 2 * sizeof(TYPE)) { \ + TYPE nn = *(TYPE *)(vn + H(i + sel1)); \ + TYPE mm = *(TYPE *)(vm + H(i + sel2)); \ + *(TYPE *)(vd + H(i + sel1)) = OP(nn, mm); \ + } \ +} + +DO_ZZZ_NTB(sve2_eoril_b, uint8_t, H1, DO_EOR) +DO_ZZZ_NTB(sve2_eoril_h, uint16_t, H1_2, DO_EOR) +DO_ZZZ_NTB(sve2_eoril_s, uint32_t, H1_4, DO_EOR) +DO_ZZZ_NTB(sve2_eoril_d, uint64_t, , DO_EOR) + +#undef DO_ZZZ_NTB + #define DO_ZZI_SHLL(NAME, TYPEW, TYPEN, HW, HN) \ void HELPER(NAME)(void *vd, void *vn, uint32_t desc) \ { \ diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 0f8686d47e..ea03bf6609 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -6031,6 +6031,25 @@ DO_SVE2_ZZZ_TB(SMULLT_zzz, smull_zzz, true, true) DO_SVE2_ZZZ_TB(UMULLB_zzz, umull_zzz, false, false) DO_SVE2_ZZZ_TB(UMULLT_zzz, umull_zzz, true, true) +static bool do_eor_tb(DisasContext *s, arg_rrr_esz *a, bool sel1) +{ + static gen_helper_gvec_3 * const fns[4] = { + gen_helper_sve2_eoril_b, gen_helper_sve2_eoril_h, + gen_helper_sve2_eoril_s, gen_helper_sve2_eoril_d, + }; + return do_sve2_zzw_ool(s, a, fns[a->esz], (!sel1 << 1) | sel1); +} + +static bool trans_EORBT(DisasContext *s, arg_rrr_esz *a) +{ + return do_eor_tb(s, a, false); +} + +static bool trans_EORTB(DisasContext *s, arg_rrr_esz *a) +{ + return do_eor_tb(s, a, true); +} + static bool do_trans_pmull(DisasContext *s, arg_rrr_esz *a, bool sel) { static gen_helper_gvec_3 * const fns[4] = {