From patchwork Tue Mar 9 16:20:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 396048 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2800001jai; Tue, 9 Mar 2021 10:03:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmBhvrWHdN0dmAZ0z+MNpzeuju4mgsOD7Hzj4kqb3jRNiQ1DdY2wrNfpKJ5I8QolhtMrAB X-Received: by 2002:a67:401:: with SMTP id 1mr17246975vse.6.1615312987208; Tue, 09 Mar 2021 10:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615312987; cv=none; d=google.com; s=arc-20160816; b=xhHI7S5r7d8CWNgs/Csr0iiZ8gta6MXoxCY1j/RH+ZNzU/ow/SC4/bxxYZL0ks+lhA rF9BBEwAGmbsNXYoOsX0joF/Ui4y4QDrTza1OxqJNM7bSdL+Bxga4mqMNSWEueGqQaAu gHJVh/QurWLehlNurdu87Xu+YBawbuT+qXJKgdVTatNCOnT/efzuzuBT+pQd8wvIwfoc ccRsSLNNWQXPThXpXfx1/ii7Y04vIwbavzOenP3bb4XWblhi3o0JY2K/87tITmptFiEY nU8pHInYJGqj1YwVdq+i9SllAxye7jnNRVkQFGK4JunEMARYCNfonaCEpVBm1Ibdn6+D b0Dw== 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=Z/S0kD58xUXjkywGS7Cu/nFSr7dKf86ON5tXYzK+tQE=; b=n+JJZm3IxY2n5UuhPu4+YP8/DMTOc1rWjUO5j7eHuxxu4eE+nkIpFNg6HTCF0KJB13 JojFb2jpdbF2r0hNqxxxpsh/mqV/rvgVwkWiOlPnFZeiLjjecsvyuEqVRBgms1TdOHoS Ckmiq7XPEt7olBkQAGunYykuGS04cJNtBhz5H1JBvIC5vliCCoSBLYYZqU5wUBidjyxl dsq5NMrZQLr5Sn5+A3sf38oMmYV+9wdfEK84bIsgoTB+s5VHP+sK+ojbCMDwvdoj3wqu r84ZmkLs+93vhZenpEbblGTJqCBZsK6loBM/JLkEF6asnYEDKolO5UwqfOvdNcMp4BOG t4mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pEXGMtxa; 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 z21si2600531uar.157.2021.03.09.10.03.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Mar 2021 10:03:07 -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=pEXGMtxa; 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]:59188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJghG-0005kG-GQ for patch@linaro.org; Tue, 09 Mar 2021 13:03:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJf7H-0007vQ-Dp for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:21:51 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]:39505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJf6w-0002ZE-Vl for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:21:51 -0500 Received: by mail-oi1-x230.google.com with SMTP id z126so15525466oiz.6 for ; Tue, 09 Mar 2021 08:21:28 -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=Z/S0kD58xUXjkywGS7Cu/nFSr7dKf86ON5tXYzK+tQE=; b=pEXGMtxaFB0INmat8EhJqD9dBV1gQg5n7Ji8nQryvwZHAzIZBw4TZqc8vBDhpJhKMA uneUtcvgQhv3sh3b9ZMYv3OS7CvthkHpKHJCCkDZrkiknrQk6ZpX1JKV6MOPXGLGw85C H4OEnJY6H96NG7MXdqfzEZaB+8s0GKDPcG6lXPnjSFDzdqdu0SilOIqYXEjPZKwQLTgU YGcoPeuvGdG+QddHxOB6upGuwuTCpskBuZwCaOK68UoGTrGCHpjNGaSBeZdd5IWiEAlx gKjbXGCUXHX9UHYJXfYi/cCjelITu7ySvy9QGztkPoBUb+O7HxjX3yRC2Y620HI1QMde /qZA== 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=Z/S0kD58xUXjkywGS7Cu/nFSr7dKf86ON5tXYzK+tQE=; b=icGdAL8jhUBVgC4M15kbYhxT1svIChjG8GLr5y7wO81GILUw2nlFxkR0+GVg/FWveP X83OPxOjH9LgolCxL9xdugYqFfxuM4CpWwLwUD1GpIizlNYQW8k10/XK15Jep+z9kPiY Tj4nW4AdmtoQ/n+K7Hq0Wn7/4MsAtbO6tUiIo9eE3H87qeQyBp8M9bSMKwqNAx7C5o+/ 5C+HSONxJu5gc6FWbkFerRbXIzPd0U0BYcQ/I4JvR45VpOCUDdVhcBlvYFykAxgCZu7t tB4xe4rDcIDMlI8g6/53ZSq9afK08glTLxgBkFGITwGdisypsvpl4JRZssajbumQmgTU Tu7w== X-Gm-Message-State: AOAM532LjC4vBT7HOUtfjgPoyeL/lus8oBdRCGfP9vHN12lIy539r7fV uFMQwsQE8W2wX80cZ3bZIMJ3JLo9uw7FcIv3 X-Received: by 2002:aca:de82:: with SMTP id v124mr3483571oig.125.1615306887676; Tue, 09 Mar 2021 08:21:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 08:21:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 39/78] target/arm: Implement SVE2 RADDHNB, RADDHNT Date: Tue, 9 Mar 2021 08:20:02 -0800 Message-Id: <20210309162041.23124-40-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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, 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 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 2e2ad8fb09..8be0d28a8a 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 931f1177a5..375f75e086 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -7475,6 +7475,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)