From patchwork Wed May 16 22:29:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 136052 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1527034lji; Wed, 16 May 2018 15:34:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq0/nC+8hQ2Frj8MRfQgpL2p0BLkFfLzIXJvN0b8d+rUUCDDTNFqwy4wd9vNlvvYpT5G0X2 X-Received: by 2002:a0c:d442:: with SMTP id r2-v6mr2996259qvh.77.1526510057470; Wed, 16 May 2018 15:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526510057; cv=none; d=google.com; s=arc-20160816; b=t+BdtV4oxPhK7cXTIrmiVSMmEdBsPhipqyrnXApCpGO3dIJB7yNAU8DbdBi1FqzSpj MSDTfbQWsS2y9UVhn+p34AJshdJZZEQ9QEkZbT94Thhz4ba+1KK6OjjwDN1hqfb3Ht7O MiFlWXun2GAMThxsutIlw/H9YERikqpnWFEgRxyQ+TpQ64mYudlv5oToqzFI54UCn+n3 aZFBvzOW9jel8guzZ/bl6xYZIR2oLJRFEd9wtS2V+PXWUmTTiy7QsY2VoBVb6j9shWSe jlsxwvwXTm5Sa+Aorw7srRPWs+hMmS2cOaTMt1zJySaQlXZ63o1ezSHenjqtjIq/5o3p mmlg== 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=6FkDAGxpjtctRPD74Kvsj7pbO4IsIUxfkCQDo+Nmo7Q=; b=gJP6quiGywsx3lxK4NnTTXmkfScmbtlwAZsQiuXULl8ZuqTatJw0oyYZKCW5osXXku tV154xbG6RmXvNs6pxaAcpTi9h1d1irf7MYS8jKtEc0w9pVDoy/YqmWJZsjD7VMWfzOH j0aHXQQcIA5xlLHLrAlW23N52hI7cawWuBxapfkFrEstWIHGczUtH/P1TZjumPuhKwMM PGtaTXtWwGOpi/5+JM4SiPwHRzEzktdLpQ/k2JraGEsJE3B43JdvghUhrxAZw2ilIqD7 +ZZVUXwQ13rHmNbB0Fa/rmE40/DcD36YjGzpoIITjJSTmbN/fOpuvdI7fBM8Na2K3Cv2 W5Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EHdeLlsd; 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 r35-v6si3201493qtr.41.2018.05.16.15.34.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 May 2018 15:34:17 -0700 (PDT) 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=EHdeLlsd; 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]:44766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ4zw-0001ir-8D for patch@linaro.org; Wed, 16 May 2018 18:34:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ4w5-0007Rm-1w for qemu-devel@nongnu.org; Wed, 16 May 2018 18:30:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ4w3-0007Ka-QJ for qemu-devel@nongnu.org; Wed, 16 May 2018 18:30:17 -0400 Received: from mail-pl0-x229.google.com ([2607:f8b0:400e:c01::229]:43851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJ4w3-0007Jr-JS for qemu-devel@nongnu.org; Wed, 16 May 2018 18:30:15 -0400 Received: by mail-pl0-x229.google.com with SMTP id c41-v6so1239758plj.10 for ; Wed, 16 May 2018 15:30:15 -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; bh=6FkDAGxpjtctRPD74Kvsj7pbO4IsIUxfkCQDo+Nmo7Q=; b=EHdeLlsd8AY3TQ0HLEU47faoNa6YDQzmrrI8zSz3SRNbbpz7Zdd5F4Y4qG7jTsvDFf llJ4sdtdZw0/KHKl1Ij6/l6+ZdHixWOfhKha4gbQDV/fCIdFCmhnwy8cx7JsasgEgqXU JBzTzIADCwHnpUnmmArQ83wd4aq17CYSmbMlI= 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=6FkDAGxpjtctRPD74Kvsj7pbO4IsIUxfkCQDo+Nmo7Q=; b=ndxA1PgIdQwuFZ3Jgp0HBz/TGVQWy4NNH8NZYI/Tc6ItCufb8qlgQ6Rux1h2QWzpy7 8t7n7L25bXG5WdlzkM8rYqOIhHWjMFJU5C32EkfVWA7LIgjlAGCs/KUATGBl8F4nIqt3 B1mcKN5i44q0iLlIzxA8o/RLUffDwiP5cGdGZMjmN4FC2XKjBarmvvCKbmYUhKI2E6R9 c05+8BlfUQYe8QpCKLbyqeLcBJKCjr4QXjHpLhTpZ7ztP5DeLzUom2wwgpMdG5yfjTg+ 5pFVKrmD5impb4imF5/mWyPWyPqBEvrryWOc4ZPNZshmfkSdMmkPqOnc4N7OzgvdqbcU KRQw== X-Gm-Message-State: ALKqPwdLYViDAKpfNHr4g74kTQYDWUd4zlmgQbr1xujRc2XXjb9SxLzU vo9hNz8IUf63nOJ4jlCa1OKJzvOjd0Q= X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr2715823plc.146.1526509814365; Wed, 16 May 2018 15:30:14 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id j1-v6sm6640418pfc.159.2018.05.16.15.30.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 15:30:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 15:29:43 -0700 Message-Id: <20180516223007.10256-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516223007.10256-1-richard.henderson@linaro.org> References: <20180516223007.10256-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::229 Subject: [Qemu-devel] [PATCH v3-a 03/27] target/arm: Implement SVE Bitwise Logical - 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These were the instructions that were stubbed out when introducing the decode skeleton. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v3: Remove typedefs now present in translate-a64.h. --- target/arm/translate-sve.c | 55 ++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 8 deletions(-) -- 2.17.0 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index d323bd0b67..67d6db313e 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -42,22 +42,61 @@ * Implement all of the translator functions referenced by the decoder. */ -static bool trans_AND_zzz(DisasContext *s, arg_AND_zzz *a, uint32_t insn) +/* Invoke a vector expander on two Zregs. */ +static bool do_vector2_z(DisasContext *s, GVecGen2Fn *gvec_fn, + int esz, int rd, int rn) { - return false; + if (sve_access_check(s)) { + unsigned vsz = vec_full_reg_size(s); + gvec_fn(esz, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), vsz, vsz); + } + return true; } -static bool trans_ORR_zzz(DisasContext *s, arg_ORR_zzz *a, uint32_t insn) +/* Invoke a vector expander on three Zregs. */ +static bool do_vector3_z(DisasContext *s, GVecGen3Fn *gvec_fn, + int esz, int rd, int rn, int rm) { - return false; + if (sve_access_check(s)) { + unsigned vsz = vec_full_reg_size(s); + gvec_fn(esz, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), vsz, vsz); + } + return true; } -static bool trans_EOR_zzz(DisasContext *s, arg_EOR_zzz *a, uint32_t insn) +/* Invoke a vector move on two Zregs. */ +static bool do_mov_z(DisasContext *s, int rd, int rn) { - return false; + return do_vector2_z(s, tcg_gen_gvec_mov, 0, rd, rn); } -static bool trans_BIC_zzz(DisasContext *s, arg_BIC_zzz *a, uint32_t insn) +/* + *** SVE Logical - Unpredicated Group + */ + +static bool trans_AND_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) { - return false; + return do_vector3_z(s, tcg_gen_gvec_and, 0, a->rd, a->rn, a->rm); +} + +static bool trans_ORR_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + if (a->rn == a->rm) { /* MOV */ + return do_mov_z(s, a->rd, a->rn); + } else { + return do_vector3_z(s, tcg_gen_gvec_or, 0, a->rd, a->rn, a->rm); + } +} + +static bool trans_EOR_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + return do_vector3_z(s, tcg_gen_gvec_xor, 0, a->rd, a->rn, a->rm); +} + +static bool trans_BIC_zzz(DisasContext *s, arg_rrr_esz *a, uint32_t insn) +{ + return do_vector3_z(s, tcg_gen_gvec_andc, 0, a->rd, a->rn, a->rm); }