From patchwork Fri Apr 16 21:01:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 422607 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp725540jaf; Fri, 16 Apr 2021 14:16:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi7fZXHQMyjLsPXnbonskBGcznxLJ0JyXf+PvKGXJcOCNFpOIe01lBdZLnXFKgIT/Wsbv0 X-Received: by 2002:a05:6102:358:: with SMTP id e24mr8960295vsa.53.1618607772012; Fri, 16 Apr 2021 14:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618607772; cv=none; d=google.com; s=arc-20160816; b=AHhkNJIA61I55duWeA0Ajyi+WGKZAPQb2e9Ji/8YsGrRrnJnKS7EUcGqTVK5ELkiwT wHo06cV3vh3RAiII/daMni55RRn3C6Y2JlPBH/KvCXuePyEJ0ZgK4lYNTNGRtCpTSOYV 9aqo9gh1hxa8kRT5u4jjdMTxwvarpDtH509a62n//uCW52fotjCiwzEwPgBx14ZVrjbE a0URRvwblc9KqolLMwRKVzbQjMCJa90R7g/t8J6HHdnuVk1xQDtoAoGxJzt2TKg4qNvY w/P4kksmmJTiuXsCmIquOgopHTA+czGzmGUo0ymIF3ClTp60vrP4ZtSrL3oozUf9gTwO pLrQ== 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=iA5YdMPlGGiyhjKxfBQbY6+WZzBPtERwoPFsnw8+g+g=; b=HO2Eupls0sxdejIV2Os20Bn3EeZGwgJTiWnd/sY25pjHtZsqafhgGV5IJ+BWKaEjLT pWjF1CTtVw2OpNDBKW7WoBJGtky54mZMume+isBMW1metbsKN6uhh5U6xIQ3iGs/wNkI j+PYtAPzahcRFDEmyJ5TNwZzuLV4f/FWeydye7QTzhtLMNkk0rVxyH8b9zqO/Lwk2l+l hOR3xC9g55++WevID/NEhwUknyBAsZp3oYaPt4TRdRpx4esb1+d5wwoeBr839HCxKg0j F/MquwVhwGTCGrRH1BM1fgTs8Zm+iHYgXhTJa0Owv8f1xw0kucj7OJgiycob2nd0rtcs 8e+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qVtSCigk; 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 126si1218414vkt.78.2021.04.16.14.16.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 14:16: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=qVtSCigk; 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]:54634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXVox-0004vV-AM for patch@linaro.org; Fri, 16 Apr 2021 17:16:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXVcG-0004Fi-Ok for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:03:05 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:46910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXVcC-00017v-TU for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:03:04 -0400 Received: by mail-pl1-x635.google.com with SMTP id m18so12422458plc.13 for ; Fri, 16 Apr 2021 14:02:59 -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=iA5YdMPlGGiyhjKxfBQbY6+WZzBPtERwoPFsnw8+g+g=; b=qVtSCigkmfUUIWMlUv/xWy5wyGybOVkvin/qQGn0C+X/33q0Q6GBZVT3AINiixpkpj 3ad5VSuUdR/1Xm5iZPfOJu5D3kfcwkSeniXut+iBwuSzLT2JeUOyjP0/DvSaDzkzUu8r hfeeDalO5Qtoj5fxf2Ny9WEunql/l01BI0gphd+1LO26RZ48ff7NtPVAgYc5w3CEqFlr aCngRWOYJzaUUVbLDC9T3r5uiLPv6F2Tpk8IBtsXMWYBbxI7MKJODouponvlyebIh8KV 5+WDsrdzbl/9hJs1Y7oWd++hXxubdZefH8D2l0ZJFVlWlrD/CJf8eUtq6qPpABq1EXQC Rbqw== 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=iA5YdMPlGGiyhjKxfBQbY6+WZzBPtERwoPFsnw8+g+g=; b=fFe9fiSs2ZSrLTszGYmftTDMABN4lguicf/AJFTh1+sLfJedM/8r2rN4n+Mv0IVEzk BqvzG9sGuZrb90GjWgEZGfuBNKea3nepBQf6kpH7oLXgiQhcC0w33o2+zbRGT8ye+Myv FqOJnFW+Y0onppI0Y2r+WHrlZoc555GhFBoHsW4bzU2ECun8DX+NKVlUyGvCgQ7PDy8G 8xzDWmVezv02Lv0I7BkFAncZtEgw0s19z5nsJtP4NQSvvLSwvdboHRiH3bPjkbazZOaU 1BVpoBWUYqDmf5UhVHI+Xbj0tGh0v5rcJkyrms0GHcU3MJ+7rM7N07TVUAViPoAWk8I8 642w== X-Gm-Message-State: AOAM530YrHW25pjWnkUsYc/zM/+8njoCn8FnngFDFzPP+Jg13ndpnGGB m81kRsJwP8KRcVPxqLgfK3dls1KDb5zh1g== X-Received: by 2002:a17:90a:ec03:: with SMTP id l3mr11261635pjy.61.1618606979004; Fri, 16 Apr 2021 14:02:59 -0700 (PDT) Received: from localhost.localdomain ([71.212.131.83]) by smtp.gmail.com with ESMTPSA id m15sm5920640pjz.36.2021.04.16.14.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 14:02:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 16/81] target/arm: Implement SVE2 bitwise exclusive-or interleaved Date: Fri, 16 Apr 2021 14:01:35 -0700 Message-Id: <20210416210240.1591291-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416210240.1591291-1-richard.henderson@linaro.org> References: <20210416210240.1591291-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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=ham 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: qemu-arm@nongnu.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 73aa670a77..1de0a9bdc3 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 afd208212b..509b3bc68c 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -6030,6 +6030,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] = {