From patchwork Fri Apr 30 20:25:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 429873 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp788870jao; Fri, 30 Apr 2021 13:58:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ1RG5aM5r989wFrr5eh0ydMIsobia4ESnjKRjOJG82vK5GE3LZx/fZjpVnHXrFypqI3RD X-Received: by 2002:a5e:8713:: with SMTP id y19mr5144968ioj.62.1619816321998; Fri, 30 Apr 2021 13:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619816321; cv=none; d=google.com; s=arc-20160816; b=ytrvCodbJmaYSoH225PhkJvYKwhy6PoWM3DFneyZoprYSFIF62C0CGr38tdb9I5rL3 3HJX2hHYWLqr2veJqR9ULOv6ytEFZcNTkWeFZzKvv3HWk4ZX97gSoRWV+6aQcrkkr+YQ 1NqwgPcdXp9O7/VbEpTBkbUIOYBuyLj6aLRh7KQXZpiWrvcfpHn6hfyfT9kdTgo1lS3O UZbh+a5vfmURMv+dYv4uCag0PI0oj7q1F1DT17CSAQutpc/X1rdN4l75mUwj1NtWVly5 l802EmS0p7YHRJgOmJIJGghvJfUHfxz4Rahk3dQ5hcGxsgyiR3rmUPr4zU+xQ401EYfO lZJA== 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=JohW9Zep0eTrt4XneckLJzEv6J8bwztIac2YTHSBK88=; b=qzn5m1EcuSNicFyH3V9atGUQ39rpXh9f77VpGgQPKGf/+++DckpEu8PNZrhmiSv6HB CmXMZYQUsWu31xFEihFHzWZyRZmP0QnoqByFYRi2Oukezq0BsO3/W78JwrbtETXf3EIB 9VOhJu752gXJguNUld0MD9VKZGxciwMzVg+TApHKBvp2x/GzYKmaKX8LfrhaClztNuFk VXNVqpvmurhiuSKxXXLQl1EYeEXopg78E26qETcqQ7nuXJdy8H9O9PciYvOYj4Q0JSam A7IcoGzzhGshAyfytnhid7OYx5ocGPEugwBs94geJCUEmnHLJ/zxtjK8mgdlWpe25nv6 mkgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YeG9Jlsd; 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 z21si4380911ioz.31.2021.04.30.13.58.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Apr 2021 13:58:41 -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=YeG9Jlsd; 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]:37156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcaDh-0006ng-Az for patch@linaro.org; Fri, 30 Apr 2021 16:58:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcZjB-0000rJ-Ne for qemu-devel@nongnu.org; Fri, 30 Apr 2021 16:27:10 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:34362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcZie-0006De-LC for qemu-devel@nongnu.org; Fri, 30 Apr 2021 16:27:07 -0400 Received: by mail-pg1-x533.google.com with SMTP id z16so9255386pga.1 for ; Fri, 30 Apr 2021 13:26:36 -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=JohW9Zep0eTrt4XneckLJzEv6J8bwztIac2YTHSBK88=; b=YeG9JlsdzFIzsLM6jc7MewVLnPOg/KnT9WgfR1or9lDQCqx+K2fkBoxkexmVp5LZbz M7zQnGk/VAtcjYmO2VCn9foFOYbjMPndsiLOra6TL6i1FrSIVWNh6u4ib20401DwU89C dfi+ucDe3Xpn8kVagJ4hrfNeOvUfjGx12kD7nKzH57LHRh9VAought6GwflKmWEqJ1ec m20Xc4OXJWwAaMdz3VRKO7WOKhart/HKPY+i28nza6euGs70cp81pgS7tvcRW9pkMcS/ H4URQ8ghPkEO7x/KQVp2Kbx6RPY0gSIhGKkR8ORt4iOIw50Orhrrhwjk4ebC40mFTEBB wQew== 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=JohW9Zep0eTrt4XneckLJzEv6J8bwztIac2YTHSBK88=; b=rpu1qXtaTYaCBDHMFP7C0i0uJAC/pYw5wcFett8ljIJefPeR/rfntkcC4X7nUh4hdk 9g9C9/9gmBmtO503zq2vTOc5MaOuk5/UA575VN6l0l0piGD2+dv4KPac57rqL5dUTvkG 8NJPHrRogUy+yYX4ws9fz/NTrCPxLG6OHKy6dOZGdQRvIv017Tp29eEdauQZl1eT4kgp +EocIn8S++gJSVjlYqTIfVZ3P+eLFa2j7wDRSs/jHVxRYvtDMHbUoaOkCJpJtPLOlN38 npOwrRn0XWOTt0oAl4r87K2i1bKqD46PukARQxZxqAdgwy2ZMePNeEVi03yMiMqvUqQB X9Dg== X-Gm-Message-State: AOAM533jQt+uIcEBY0OwhoNBdbXaWrOvWzlX9wT9ZqSCSggLl/Yku+2v XAKaN2z1umQBRwtt1HgrM99YFWwcjOQRfg== X-Received: by 2002:a63:dc56:: with SMTP id f22mr6275720pgj.287.1619814395359; Fri, 30 Apr 2021 13:26:35 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id e6sm2905257pfd.219.2021.04.30.13.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 13:26:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 39/82] target/arm: Implement SVE2 RADDHNB, RADDHNT Date: Fri, 30 Apr 2021 13:25:27 -0700 Message-Id: <20210430202610.1136687-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430202610.1136687-1-richard.henderson@linaro.org> References: <20210430202610.1136687-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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, 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-3-steplong@quicinc.com> Signed-off-by: Richard Henderson --- v2: Fix round bit type (laurent desnogues) --- target/arm/helper-sve.h | 8 ++++++++ target/arm/sve.decode | 2 ++ target/arm/sve_helper.c | 10 ++++++++++ target/arm/translate-sve.c | 2 ++ 4 files changed, 22 insertions(+) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index a369fd2391..8d95c87694 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -2517,6 +2517,14 @@ DEF_HELPER_FLAGS_4(sve2_addhnt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_addhnt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_addhnt_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_raddhnb_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_raddhnb_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2_raddhnb_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + +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_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 72dd36a5c8..dfcfab4bc0 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1324,6 +1324,8 @@ UQRSHRNT 01000101 .. 1 ..... 00 1111 ..... ..... @rd_rn_tszimm_shr 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 ### SVE2 Character Match diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 2dead1f056..e6f6e3d5fa 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -2135,6 +2135,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) DO_BINOPNB(sve2_addhnb_h, uint16_t, uint8_t, 8, DO_ADDHN) DO_BINOPNB(sve2_addhnb_s, uint32_t, uint16_t, 16, DO_ADDHN) @@ -2144,6 +2145,15 @@ DO_BINOPNT(sve2_addhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_ADDHN) DO_BINOPNT(sve2_addhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_ADDHN) DO_BINOPNT(sve2_addhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_ADDHN) +DO_BINOPNB(sve2_raddhnb_h, uint16_t, uint8_t, 8, DO_RADDHN) +DO_BINOPNB(sve2_raddhnb_s, uint32_t, uint16_t, 16, DO_RADDHN) +DO_BINOPNB(sve2_raddhnb_d, uint64_t, uint32_t, 32, DO_RADDHN) + +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) + +#undef DO_RADDHN #undef DO_ADDHN #undef DO_BINOPNB diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 86f8a24b5b..af0d0ab279 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -7474,6 +7474,8 @@ static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ DO_SVE2_ZZZ_NARROW(ADDHNB, addhnb) DO_SVE2_ZZZ_NARROW(ADDHNT, addhnt) +DO_SVE2_ZZZ_NARROW(RADDHNB, raddhnb) +DO_SVE2_ZZZ_NARROW(RADDHNT, raddhnt) static bool do_sve2_ppzz_flags(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_flags_4 *fn)