From patchwork Tue Mar 9 16:20:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 396069 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2817580jai; Tue, 9 Mar 2021 10:25:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkOOm2jv729MMbh2ThxPV84ACV+s8k5JeA8S/5CaMqsPmSaMH9Vqoh2JWq4iQSNsYia3NA X-Received: by 2002:a02:77d0:: with SMTP id g199mr29171265jac.118.1615314339009; Tue, 09 Mar 2021 10:25:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615314339; cv=none; d=google.com; s=arc-20160816; b=DKxaj1CAG7xe3JsXv/XXmMg3SxUdswhhm+Kem3z4lOwSvcAF1N0IEa/w4/LMyWbyxn 3Eb5shBvZPKCpIkRW4PovqzsODGOhFjw4FAN7yKwO+5y7p5EG2yi8aJZg4lyidUB2+MK i0hCmJ9zq5avIqVMi66F2ZDhqLcLHDgfOBi2Ev1xkGJ6Gcg0w5s8dJUvZwjYWBnC1dUZ l+8vlUt0ZKO/kZQZ9ODXuBTFiyrTBDHE4FjlES87uUg66lss5vYTJVvG9zAbGMg66LHe q4sL73vC6sBimhQtijd+hQ1xAdiTnRyfxKM5sKqnodBXavDASrA2xnhuiZnrZxzjCzFf t7hQ== 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=dmOaMq0cyoTud0OTLwGo1bmU+yPSQ++q9U9cjzeKa4M=; b=F/0/O9Od8pGKxr2zV78lUgr407v1rXU+f2W169SHahi4JkJvTIABs08o+tDrmXyhQM 4DdDvo7rh7ki4CGgORXYDrHstokq0DGFhxNYDwPk9zydASdgHtzXXZLnm5rYPtLmdkWD E3zEFifuFT8M3ShyzWWyZ/F9iJkTx44yZ0dvyecr4To3LsFbXERpwGXgNze447CqynKi 6/IGwwBqtkezz+xCwxNLjW9nWFiFMsFmmrXdNGGLfTs8QxgUAo1Xc1CWauZAOYjmIeiN 7m5skn2j07jQWOIAut61lMyGagU5w0jynczt1HugY8MdTc4jyB5E8ywe6WFhGzSSWit5 trVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u0x80t9C; 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 t14si17333418iov.85.2021.03.09.10.25.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Mar 2021 10:25:39 -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=u0x80t9C; 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]:52460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJh34-0004Q1-Ay for patch@linaro.org; Tue, 09 Mar 2021 13:25:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJf7S-0008P1-EC for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:22:02 -0500 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]:38389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJf7Q-0002jd-MQ for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:22:02 -0500 Received: by mail-ot1-x32d.google.com with SMTP id a17so13373028oto.5 for ; Tue, 09 Mar 2021 08:22:00 -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=dmOaMq0cyoTud0OTLwGo1bmU+yPSQ++q9U9cjzeKa4M=; b=u0x80t9C7FpPKMWMeYbn9liCw4tnVADINA+wbbvfWzhNdoP1sjDVexwTtt+SniWWl0 FKwM3cJ23RbR8/p0Qh1Qojuk0e6UOtDXGaamO67omqeXV++A1LurS2w5DjRwMsiKaJiH D725oJbMT9nBw7US8I3nyat+e95bKQdGqKUP8fOSCOMvN5buwxH0dMXEdy9nMelWORp0 5UJRT0VlHYP34mGHGbnTRh4OmF655jiGcv+MqD9JlSjqTEljzOFnrGwE8GXzQwAZVUsn zB8wjE4v2DMXrw4zWPxLOoeDklztLKcDzhzjQGR6chAh7jB4Pxd4691GofbTrwHk4+Eb iBjw== 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=dmOaMq0cyoTud0OTLwGo1bmU+yPSQ++q9U9cjzeKa4M=; b=J3Y3ZVis083RJ0cerH6WguMr5GHIYXGq9GGm1rTABrC9bq5a09Ba3MdqM7rLVoWxRC Xdq+8H+53/f5jBEoglHsnWHnEdiMZ5pikzmsbR7s/ybVkZwKpjulbwORs4Fs8jqj2r5i Qi+IZF03pqjajhKs7a8G3hMVv9UfZkPnm8Q5YGnTHaIxbReJR+bUnTqPOsSsZJ9A4PL8 NWlTpEoCX3Qq+aRwOPmQ3MjhLXp1MZeRbCSnNPEJfFQd/HGnvHrFArTDyEFdMexXSnTo F3vkLOOgRDWBtLW8d8MgiwPi7UmdyAOLeMQyzkzkKvYeRL6flf8bQcYN/tQbuCNlRt/u lHow== X-Gm-Message-State: AOAM531MlaorEprprbgEtDgmowujxPmd+DS0WYY1XysO5UN1K1ET2GW/ NRyPlMlkiGJO2RO8TcUETFhFi/vBpeflW5n5 X-Received: by 2002:a9d:750c:: with SMTP id r12mr9669622otk.322.1615306919692; Tue, 09 Mar 2021 08:21:59 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id u19sm3470898ote.15.2021.03.09.08.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 08:21:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 40/78] target/arm: Implement SVE2 SUBHNB, SUBHNT Date: Tue, 9 Mar 2021 08:20:03 -0800 Message-Id: <20210309162041.23124-41-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::32d; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32d.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: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org, Stephen Long Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Stephen Long Signed-off-by: Stephen Long Message-Id: <20200417162231.10374-4-steplong@quicinc.com> Signed-off-by: Richard Henderson --- target/arm/helper-sve.h | 8 ++++++++ target/arm/sve.decode | 2 ++ target/arm/sve_helper.c | 10 ++++++++++ target/arm/translate-sve.c | 3 +++ 4 files changed, 23 insertions(+) -- 2.25.1 diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index 8d95c87694..3642e7c820 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -2525,6 +2525,14 @@ DEF_HELPER_FLAGS_4(sve2_raddhnt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_raddhnt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_raddhnt_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_subhnb_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_subhnb_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_subhnb_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + +DEF_HELPER_FLAGS_4(sve2_subhnt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_subhnt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_subhnt_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + DEF_HELPER_FLAGS_5(sve2_match_ppzz_b, TCG_CALL_NO_RWG, i32, ptr, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(sve2_match_ppzz_h, TCG_CALL_NO_RWG, diff --git a/target/arm/sve.decode b/target/arm/sve.decode index dfcfab4bc0..c68bfcf6ed 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1326,6 +1326,8 @@ ADDHNB 01000101 .. 1 ..... 011 000 ..... ..... @rd_rn_rm ADDHNT 01000101 .. 1 ..... 011 001 ..... ..... @rd_rn_rm RADDHNB 01000101 .. 1 ..... 011 010 ..... ..... @rd_rn_rm RADDHNT 01000101 .. 1 ..... 011 011 ..... ..... @rd_rn_rm +SUBHNB 01000101 .. 1 ..... 011 100 ..... ..... @rd_rn_rm +SUBHNT 01000101 .. 1 ..... 011 101 ..... ..... @rd_rn_rm ### SVE2 Character Match diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 8be0d28a8a..229dde282e 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -2136,6 +2136,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ #define DO_ADDHN(N, M, SH) ((N + M) >> SH) #define DO_RADDHN(N, M, SH) ((N + M + ((__typeof(N))1 << (SH - 1))) >> SH) +#define DO_SUBHN(N, M, SH) ((N - M) >> SH) DO_BINOPNB(sve2_addhnb_h, uint16_t, uint8_t, 8, DO_ADDHN) DO_BINOPNB(sve2_addhnb_s, uint32_t, uint16_t, 16, DO_ADDHN) @@ -2153,6 +2154,15 @@ DO_BINOPNT(sve2_raddhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_RADDHN) DO_BINOPNT(sve2_raddhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_RADDHN) DO_BINOPNT(sve2_raddhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_RADDHN) +DO_BINOPNB(sve2_subhnb_h, uint16_t, uint8_t, 8, DO_SUBHN) +DO_BINOPNB(sve2_subhnb_s, uint32_t, uint16_t, 16, DO_SUBHN) +DO_BINOPNB(sve2_subhnb_d, uint64_t, uint32_t, 32, DO_SUBHN) + +DO_BINOPNT(sve2_subhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_SUBHN) +DO_BINOPNT(sve2_subhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_SUBHN) +DO_BINOPNT(sve2_subhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_SUBHN) + +#undef DO_SUBHN #undef DO_RADDHN #undef DO_ADDHN diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 375f75e086..792ec38cb0 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -7478,6 +7478,9 @@ DO_SVE2_ZZZ_NARROW(ADDHNT, addhnt) DO_SVE2_ZZZ_NARROW(RADDHNB, raddhnb) DO_SVE2_ZZZ_NARROW(RADDHNT, raddhnt) +DO_SVE2_ZZZ_NARROW(SUBHNB, subhnb) +DO_SVE2_ZZZ_NARROW(SUBHNT, subhnt) + static bool do_sve2_ppzz_flags(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_flags_4 *fn) {