From patchwork Thu Mar 26 23:08:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184965 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp651385ilr; Thu, 26 Mar 2020 16:26:08 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtlQVOQM5jZzizjaY/iO1g0rGcIHSTnS+ebRdeY99i41eimDzWm8brhNeq2vuVjaMsd8UMw X-Received: by 2002:aed:2207:: with SMTP id n7mr4797566qtc.132.1585265168154; Thu, 26 Mar 2020 16:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585265168; cv=none; d=google.com; s=arc-20160816; b=rafDVIKSnY4KA6kKlMe8FVMuhNXy+89qpKxL91uZOjXbGvXHnb3nKloFUZEFSdCM9+ 0BtIIBn4zxFKdviEQMStETVdih/XBeJZ4BmvSGXb3Vu/doXTks2HPJPe9LI6BN+LKdb3 8HQf19fSBdBUQXFsYBoucng8m2caLa8lJG+MrmWYqibO8pdSPJmT6b6mSLt7lLb4ffkc FFa2WecUWbQc43wcC9DtN+2F0hsJYrwshI50g74CzSTJHHps56i172S9UWITwCqkszOY 0N1gZsxX1JaKJ+0lMcyQ7712OGg0hBY74Tyv5DcS4us8vS0oDBXX+4zaVFH+2Z0vIa20 JCLQ== 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=OdjaC+2trQ9ceTWGUWGj5oLcK8x+CzwmCibMzIBPms4=; b=C+BDD8F5RdJCMzfA/tT7X8SAZ9QddbNBKCzCfAKIQ4KDNGyw8jxYsPzNSqs+pDEyrD TGPuQeEa5NmJMn3j5ieZ00ShKg4TBfjgJWIBvTfDGNsQX0SENrCCbExzD4mbhycFrpz7 nE1UA0GObtOYrr8IjvMrwzhBfqIIwxfwEPutxymHzLgqwAr4gKOCF9L5Btfn3vYdkqrx F9cE0rTtHqxbZtciZyveOmJbWwjNlmDtzWrPZhclcPsTPnOOKTpKtH4vaQGK2MUUt9M+ w6No59mk9TfIiSgUR2SGPJfKwNKGJ2P6u72fNkso/pV7OcHVi6DS0/3DSyMX2nW3MWlr 16pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aD2zgnrz; 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 o14si2485868qto.287.2020.03.26.16.26.08 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 16:26:08 -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=aD2zgnrz; 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]:34958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHbt1-00044a-MW for patch@linaro.org; Thu, 26 Mar 2020 19:26:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59253) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHbcf-0002xc-TU for qemu-devel@nongnu.org; Thu, 26 Mar 2020 19:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHbce-0001tV-Oo for qemu-devel@nongnu.org; Thu, 26 Mar 2020 19:09:13 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:44774) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHbce-0001sI-Iu for qemu-devel@nongnu.org; Thu, 26 Mar 2020 19:09:12 -0400 Received: by mail-pg1-x541.google.com with SMTP id 142so3639946pgf.11 for ; Thu, 26 Mar 2020 16:09:12 -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=OdjaC+2trQ9ceTWGUWGj5oLcK8x+CzwmCibMzIBPms4=; b=aD2zgnrzX/IkgZWK1ZnF0cSKeiEAY8SMYX1u7WTSWJknIg6OOX4PVlZUgaR9pG6qy0 ZyNsuIILpcGidy1iqB9znjowkFRlTsfrtbdhGh89GR3i6GYamkAbiwTcpzkLXE6xgjH6 rqZXAq1FtARKFrJJCEnb7fJj667c3OWzmk1DpklnL5hbGvD2UitAmC6dMKTtDO5v0WKQ dauE7kIRDOJbpqXICicQuE4vJq8D3Io5DA1LGYWP2H6f8fIDtXbSot69QxJ7+Bdap39S z4+qhQj92FpCiV+YtMEILq/0xLm7s2omjTpRDQwGNn+7B4sxmzkMbPUJPtcUaPAdac+v wWCg== 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=OdjaC+2trQ9ceTWGUWGj5oLcK8x+CzwmCibMzIBPms4=; b=dR5DzU2qZj/RTIcNyknibI4jP7ZP5tWxrzfelz6P4dkPv5R83TMw9+IhKT4pMom9Rg 6WljhppKIMDZozQnEvDqrivhK/Riu2NOqMfJ/G9XwGrOEMgODdE/c65V48Dvx9Pj0GyT XqT831VjLbE7W+X56p/qWh980iZmF7gd4F+jS46VbgajRgOjaevSyPS8Obqz+Oj3Lfi3 bHvVQruTC6U4KG42OIRIvmbnBUm92jf5sVTZB0IJ2reBjvReYhZaopfRaRjdhhVQfKBx sNp4Z3o96CVXOhJwrHjsvVG5g+C0MF2v3ywxA0a4zMIEOj5O2WBqykcpAmOj63J6CvQL FTbQ== X-Gm-Message-State: ANhLgQ10YtX0jYjE2PfBa8nuM5JEbbxghdcohPjNuir0qj2l9fKsGuu0 1/4YpEu8xGEfi7OOiNlDN8DPnLPWD8M= X-Received: by 2002:a63:2cc3:: with SMTP id s186mr10720238pgs.71.1585264151297; Thu, 26 Mar 2020 16:09:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 16:09:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 25/31] target/arm: Implement SVE2 bitwise shift right and accumulate Date: Thu, 26 Mar 2020 16:08:32 -0700 Message-Id: <20200326230838.31112-26-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::541 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/sve.decode | 8 ++++++++ target/arm/translate-sve.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) -- 2.20.1 diff --git a/target/arm/sve.decode b/target/arm/sve.decode index 5d46e3ab45..756f939df1 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1253,3 +1253,11 @@ UABALT 01000101 .. 0 ..... 1100 11 ..... ..... @rda_rn_rm # ADC and SBC decoded via size in helper dispatch. ADCLB 01000101 .. 0 ..... 11010 0 ..... ..... @rda_rn_rm ADCLT 01000101 .. 0 ..... 11010 1 ..... ..... @rda_rn_rm + +## SVE2 bitwise shift right and accumulate + +# TODO: Use @rda and %reg_movprfx here. +SSRA 01000101 .. 0 ..... 1110 00 ..... ..... @rd_rn_tszimm_shr +USRA 01000101 .. 0 ..... 1110 01 ..... ..... @rd_rn_tszimm_shr +SRSRA 01000101 .. 0 ..... 1110 10 ..... ..... @rd_rn_tszimm_shr +URSRA 01000101 .. 0 ..... 1110 11 ..... ..... @rd_rn_tszimm_shr diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index a80765a978..1d1f55dfdd 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -6317,3 +6317,37 @@ static bool trans_ADCLT(DisasContext *s, arg_rrrr_esz *a) { return do_adcl(s, a, true); } + +static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn) +{ + if (!dc_isar_feature(aa64_sve2, s)) { + return false; + } + if (sve_access_check(s)) { + unsigned vsz = vec_full_reg_size(s); + unsigned rd_ofs = vec_full_reg_offset(s, a->rd); + unsigned rn_ofs = vec_full_reg_offset(s, a->rn); + fn(a->esz, rd_ofs, rn_ofs, a->imm, vsz, vsz); + } + return true; +} + +static bool trans_SSRA(DisasContext *s, arg_rri_esz *a) +{ + return do_sve2_fn2i(s, a, arm_gen_gvec_ssra); +} + +static bool trans_USRA(DisasContext *s, arg_rri_esz *a) +{ + return do_sve2_fn2i(s, a, arm_gen_gvec_usra); +} + +static bool trans_SRSRA(DisasContext *s, arg_rri_esz *a) +{ + return do_sve2_fn2i(s, a, arm_gen_gvec_srsra); +} + +static bool trans_URSRA(DisasContext *s, arg_rri_esz *a) +{ + return do_sve2_fn2i(s, a, arm_gen_gvec_ursra); +}