From patchwork Sat Feb 17 18:22:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 128679 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1820949ljc; Sat, 17 Feb 2018 10:32:31 -0800 (PST) X-Google-Smtp-Source: AH8x226GU+VYoPChCq1saGW3R/OztUhlMu4xZPicGk76kq8N6V9VdUc7JqzMJtvBXt5bDSvN6sU/ X-Received: by 10.37.153.137 with SMTP id p9mr7195475ybo.12.1518892351825; Sat, 17 Feb 2018 10:32:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518892351; cv=none; d=google.com; s=arc-20160816; b=nJGAYa7+UmqELuLr65lVmpFv/99APnWv4WMW2raIs/aY5Y0tPTCE+npxSVn3OhViAe h88VEPcYPOyB/80FVszQhW9u6680mceGimdkuN2LTLFvQZAuwEK7ZvFzrQlbM3qvi797 pSbBCz/pIbphpRrgT7fKEKknKmd3wTfATm4JBJ/vfCOhVSuaKskYsekFbjTZb9bvOiZF RCWGRO12B1RBPiMbhW4a9LVJj1aWOEdhds3QcCb/ApH57DjNJH7PGpKw/t65ziFMFRfj ww6ZbTcwGuJ9RvLTfcIC//58U636K6rH3SoaNYe6d+8tjKcOvQMcEoMdmg+ZE7SU/qBN fkGQ== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=p2OJeeH3GeRDZFkskP3/uYl1RujJsL25/T8puntaOkM=; b=ZQxYq2brLZuJvUSuCPquO54ld78Z123NCONbstaFxjO4ZOTRaFxEqrBc1HzdkZQTVB KoT4EToylHPR69Na3nFcW1TPiEjYZoE9WNt0JhlYwpM2iaEPFWLMHcfiznIvKVHXzDxH HPX18gM9Dmh4oSOZYnPiG2OXMFRbMU4xJWBsIKsK+ZTj/U1ARu9s4pBWoLUZ5hTFlqeK rq4aS1xB3lWtsOI7WOS/bAp+LJOHW2AXLdVK1rYpD9PUBAqYIdjCNiBpmNyNo58LeMB3 GFgMXBkHZkDr7nZQoUbYhEKkped6W/y3rVDlEzJn9GuiKb3nIKR+yVXHuWoo97IzVenZ 0tzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZTtPAfCm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l19si146273ywk.530.2018.02.17.10.32.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 17 Feb 2018 10:32:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZTtPAfCm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:48103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en7Hj-0006oF-2m for patch@linaro.org; Sat, 17 Feb 2018 13:32:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en79P-0000Ws-Jx for qemu-devel@nongnu.org; Sat, 17 Feb 2018 13:23:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en79O-0001eU-EZ for qemu-devel@nongnu.org; Sat, 17 Feb 2018 13:23:55 -0500 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:45434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en79O-0001eA-AO for qemu-devel@nongnu.org; Sat, 17 Feb 2018 13:23:54 -0500 Received: by mail-pl0-x243.google.com with SMTP id p5so3428335plo.12 for ; Sat, 17 Feb 2018 10:23:54 -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; bh=p2OJeeH3GeRDZFkskP3/uYl1RujJsL25/T8puntaOkM=; b=ZTtPAfCmp4AENayfBA1q3SlbKh7Qlc+yadSVWnyaqj3P2yqCTtBS+Xh5SduMTIlvgs fmU8vd3dH/idKnbBAPdQVwV43wAICu+no7J+z+Wa37RajwsatY8KFafyIFg+tYWabHQk X4iHsfoRGQvsjyqrMLmD9KM/0COyQvuN16/m8= 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; bh=p2OJeeH3GeRDZFkskP3/uYl1RujJsL25/T8puntaOkM=; b=ftjpcoPfgH8k7SjK+GzrDniyU70sjKImCtb0ue+syu+Uq9Ea4RpMWT4usIgB2KpjJf fHCKG3R9Giaki3r/sbtEQMvUSHlKxIZbq96+th7m/Nnxcs8y4Wj8G/MXqZoYkq/lS4QH VU2cwvBglE4bwYvnDntP0thrLxxihq3No15facNyhS7SIShp/ROjYic4yRjXuPS2mdWd 1nxsr1smFsGvgXkQ48++JJWK/FSa6IfY2KGMfKche7wQYZDtjl6M2henb/iSns4doMAy svjiSQmmRIBzkgKJgZ0PvsgRAwamZekiytrZZdr8pcjHmN2qOioHexSj8P8Ae4mCII6T EuKg== X-Gm-Message-State: APf1xPBo6M/SPVP9a7Vy6s3MpOXWAj3aSiaSZRrwkkWbxcWdwvcoPk8E knjPz9tdoYEczImuEwpOHgKuXlcTLAQ= X-Received: by 2002:a17:902:9686:: with SMTP id n6-v6mr9302113plp.333.1518891833069; Sat, 17 Feb 2018 10:23:53 -0800 (PST) Received: from cloudburst.twiddle.net ([50.0.192.64]) by smtp.gmail.com with ESMTPSA id h15sm13466712pfi.56.2018.02.17.10.23.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 10:23:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 17 Feb 2018 10:22:32 -0800 Message-Id: <20180217182323.25885-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180217182323.25885-1-richard.henderson@linaro.org> References: <20180217182323.25885-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::243 Subject: [Qemu-devel] [PATCH v2 16/67] target/arm: Implement SVE Integer Arithmetic - Unpredicated Group X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 41 ++++++++++++++++++++++++++++++++++++++--- target/arm/sve.decode | 13 +++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) -- 2.14.3 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index b956d87636..8baec6c674 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -235,6 +235,40 @@ static void trans_BIC_zzz(DisasContext *s, arg_BIC_zzz *a, uint32_t insn) do_vector3_z(s, tcg_gen_gvec_andc, 0, a->rd, a->rn, a->rm); } +/* + *** SVE Integer Arithmetic - Unpredicated Group + */ + +static void trans_ADD_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + do_vector3_z(s, tcg_gen_gvec_add, a->esz, a->rd, a->rn, a->rm); +} + +static void trans_SUB_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + do_vector3_z(s, tcg_gen_gvec_sub, a->esz, a->rd, a->rn, a->rm); +} + +static void trans_SQADD_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + do_vector3_z(s, tcg_gen_gvec_ssadd, a->esz, a->rd, a->rn, a->rm); +} + +static void trans_SQSUB_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + do_vector3_z(s, tcg_gen_gvec_sssub, a->esz, a->rd, a->rn, a->rm); +} + +static void trans_UQADD_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + do_vector3_z(s, tcg_gen_gvec_usadd, a->esz, a->rd, a->rn, a->rm); +} + +static void trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + do_vector3_z(s, tcg_gen_gvec_ussub, a->esz, a->rd, a->rn, a->rm); +} + /* *** SVE Integer Arithmetic - Binary Predicated Group */ @@ -254,7 +288,8 @@ static void do_zpzz_ool(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_4 *fn) } #define DO_ZPZZ(NAME, name) \ -void trans_##NAME##_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) \ +static void trans_##NAME##_zpzz(DisasContext *s, arg_rprr_esz *a, \ + uint32_t insn) \ { \ static gen_helper_gvec_4 * const fns[4] = { \ gen_helper_sve_##name##_zpzz_b, gen_helper_sve_##name##_zpzz_h, \ @@ -286,7 +321,7 @@ DO_ZPZZ(ASR, asr) DO_ZPZZ(LSR, lsr) DO_ZPZZ(LSL, lsl) -void trans_SDIV_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) +static void trans_SDIV_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) { static gen_helper_gvec_4 * const fns[4] = { NULL, NULL, gen_helper_sve_sdiv_zpzz_s, gen_helper_sve_sdiv_zpzz_d @@ -294,7 +329,7 @@ void trans_SDIV_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) do_zpzz_ool(s, a, fns[a->esz]); } -void trans_UDIV_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) +static void trans_UDIV_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) { static gen_helper_gvec_4 * const fns[4] = { NULL, NULL, gen_helper_sve_udiv_zpzz_s, gen_helper_sve_udiv_zpzz_d diff --git a/target/arm/sve.decode b/target/arm/sve.decode index 68a1823b72..b40d7dc9a2 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -68,6 +68,9 @@ # Three prediate operand, with governing predicate, flag setting @pd_pg_pn_pm_s ........ . s:1 .. rm:4 .. pg:4 . rn:4 . rd:4 &rprr_s +# Three operand, vector element size +@rd_rn_rm ........ esz:2 . rm:5 ... ... rn:5 rd:5 &rrr_esz + # Two register operand, with governing predicate, vector element size @rdn_pg_rm ........ esz:2 ... ... ... pg:3 rm:5 rd:5 \ &rprr_esz rn=%reg_movprfx @@ -205,6 +208,16 @@ MLS 00000100 .. 0 ..... 011 ... ..... ..... @rda_pg_rn_rm MLA 00000100 .. 0 ..... 110 ... ..... ..... @rdn_pg_ra_rm # MAD MLS 00000100 .. 0 ..... 111 ... ..... ..... @rdn_pg_ra_rm # MSB +### SVE Integer Arithmetic - Unpredicated Group + +# SVE integer add/subtract vectors (unpredicated) +ADD_zzz 00000100 .. 1 ..... 000 000 ..... ..... @rd_rn_rm +SUB_zzz 00000100 .. 1 ..... 000 001 ..... ..... @rd_rn_rm +SQADD_zzz 00000100 .. 1 ..... 000 100 ..... ..... @rd_rn_rm +UQADD_zzz 00000100 .. 1 ..... 000 101 ..... ..... @rd_rn_rm +SQSUB_zzz 00000100 .. 1 ..... 000 110 ..... ..... @rd_rn_rm +UQSUB_zzz 00000100 .. 1 ..... 000 111 ..... ..... @rd_rn_rm + ### SVE Logical - Unpredicated Group # SVE bitwise logical operations (unpredicated)