From patchwork Thu Mar 26 23:08:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184966 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp652011ilr; Thu, 26 Mar 2020 16:26:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs8ZJOkGJunJebcUeuPppHpyK+e++6v0i7i6qNZHWFzE9GBnfXMu1Wl+B4HT5L+oUCFxkcZ X-Received: by 2002:a37:6616:: with SMTP id a22mr11371678qkc.391.1585265211476; Thu, 26 Mar 2020 16:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585265211; cv=none; d=google.com; s=arc-20160816; b=CTVs0vFIUe+u0H4pxlFIiZDanJfz9NRE67JGpmkch0aHFESz7o1oQvviHe6qGuW7P1 xztITPHK1lxQFxTUxY28f5Y/Zi7n/DVygREDHxasElM0cElI3kLHjPfPkdHgwDeCTouE XPbVFQIllIZBxY+vFltocUzADl+bFf8RJdWbR0zT5jY70z69A6Md1qpd87OoT1ZaVlL1 5Gm1a0W+6RR4ZIlVXMk7xx08+zyhhqkJMYdJDSweoBhI5Avkuk73692v4ilAxTFzHe7r x3PDD6BG5YXemKlodhbtulV701fI3hKqvFkW/sNQXLwIghOWY9fsqei6WIlgLs0Gla40 zbfw== 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=wrW/Tw+fzY4lh5Sk9yEJSGX1ZVgOSoYBH6s+EdHCLNI=; b=tCJQmmi0a5JgMj0kZAenR3o9ML6kMchiUnfaQIVXX7yUEL9ADZ6MwUiJ+RllOhXGgP ur2u0BrZ7QhSK1X2dqQy0HRmAzWSxdfhmLr4WF3m4pj9VBeOBMpKIn82bf+x81xAAQrv xt0TI8XFPxrA7WiryjPfGp0wrvWbmMutxj6Fq6banJmTMw/JpcxnNaeL75Atg6CdOpEI 3xjwd3SiVuJqzDSTPTwJV4ksRH4aIdi2TLPFsHjeyeU7ksSZMYAc1d08ULu+I7DNpmTN GlWOUaBJpBLhgekEJ/wZ4Zv5s+NB0G6MXIm7yT1/hJznGCcsA7LIaSmQyFBfPEt5m5FD rmdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BrEbMv9x; 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=fail (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 18si2476997qkk.210.2020.03.26.16.26.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 16:26:51 -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=fail header.i=@linaro.org header.s=google header.b=BrEbMv9x; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHbti-0005C3-UT for patch@linaro.org; Thu, 26 Mar 2020 19:26:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58819) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHbcY-0002gA-HA for qemu-devel@nongnu.org; Thu, 26 Mar 2020 19:09:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHbcW-0001gc-Uf for qemu-devel@nongnu.org; Thu, 26 Mar 2020 19:09:06 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:33342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHbcW-0001f9-OI for qemu-devel@nongnu.org; Thu, 26 Mar 2020 19:09:04 -0400 Received: by mail-pf1-x42b.google.com with SMTP id j1so3565885pfe.0 for ; Thu, 26 Mar 2020 16:09:04 -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=wrW/Tw+fzY4lh5Sk9yEJSGX1ZVgOSoYBH6s+EdHCLNI=; b=BrEbMv9x6I4UYjjt578PfVTp5NTnY4KulJP7eMueszsSXLHs4JDW+q4ZAyAKMqjTvF puiyrdvzPlBAiwdmNIIW1JgZLQmwqpf1HQKpYe4XIxCo3h9yH+fI7WwaV+24LQbbvXKC Cf5caroStFOxthkkauY/DLdJ8IMtUoSB5P6dBHYvMcLzDBtEiNN2lmQLmLRgNHnZDPF4 pUrvZXk3D9HSnOqtg2j8GE6Tay3hCT9rwg++eGWXhJvY+mPa8diiJOPxO7ndFZY8E4HX FOT4oD8TMq52Ue57ktHpOuzDAYRTLU1prnFWQ80j78ucP0Sz1Anr6S18LF5vQSXNtL/2 Qgng== 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=wrW/Tw+fzY4lh5Sk9yEJSGX1ZVgOSoYBH6s+EdHCLNI=; b=rSdPbr7VZ6IQJmG+Y5Vvr6cKzBxYxtx1gV7GG+H1/z1owLV7EJNt5mFXwW8oNN6p09 X0UWFdh308weFUqGW6pAVRo5DfvVEXI/AOKRJENwZ+cTaAS/km0WRGvKwRm8HvIiJXat jkinAPpRW8olzqOxMutjo6flmvBpmyA+ga0qGurI6vwy4gbALL1oKbw34oY4Bp/emHNo RQp+7XD8lftfmLiiNer+lvhBHxQxfmdVixojoIph8mVKDDk5KQKflh90yDcSXiD1krpV Fnyvh/AKG/wVCwzaD81wN52tyE1DMJukxOkB0p+85oFp0gwoVb1f55cNauEDvZnKeS0P w9sQ== X-Gm-Message-State: ANhLgQ0xh8miLRqarlJKmc3m3IdJZP7VengMUQE3tRkmjOd/1p90+8uc Jmq92qy4RxZnapSnB4Kw4UZ1jJAFTv4= X-Received: by 2002:a62:3305:: with SMTP id z5mr11968336pfz.297.1585264143340; Thu, 26 Mar 2020 16:09:03 -0700 (PDT) Received: from localhost.localdomain (174-21-138-234.tukw.qwest.net. [174.21.138.234]) by smtp.gmail.com with ESMTPSA id i187sm2530037pfg.33.2020.03.26.16.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 16:09:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/31] target/arm: Implement SVE2 bitwise exclusive-or interleaved Date: Thu, 26 Mar 2020 16:08:25 -0700 Message-Id: <20200326230838.31112-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200326230838.31112-1-richard.henderson@linaro.org> References: <20200326230838.31112-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42b 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: rajav@quicinc.com, qemu-arm@nongnu.org, apazos@quicinc.com 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.20.1 diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index 9c0c41ba80..9e894a2b55 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -2380,3 +2380,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 36ef9de563..8af35e48a5 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 e0a701c446..15ea1fd524 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -1196,6 +1196,26 @@ DO_ZZZ_WTB(sve2_usubw_d, uint64_t, uint32_t, 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, TYPE, TYPEN, OP) \ 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 9873b83feb..3eaf9cbe51 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -6064,6 +6064,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] = {