From patchwork Fri Oct 19 16:57:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 149322 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3581654lji; Fri, 19 Oct 2018 10:31:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV62lqnD1KMH8z0Uaz/AkKOB4YANuj5RlP7Zt65hnVPI5s997s5FktRIVyftU6N4usZFTJ6OP X-Received: by 2002:a37:a3cd:: with SMTP id m196-v6mr6961526qke.138.1539970297486; Fri, 19 Oct 2018 10:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539970297; cv=none; d=google.com; s=arc-20160816; b=XmrLJJp6xIPbx06mqCF0artKd/7HIGc4QhwFziue3cwwv9/nfhUCYRd5eUTCrLZW6q salUaXnaiVOjPrXHoZAvuOx4B1uj5xCf/RNNY9V7YaAXiMHQovNgB9ZnjBgzuwbVr5Of 658noUfWREHdBISFBRd0mAMU2AmzUi7wpJH+OaKm3MB2ZEhD8WCKMMtGTb7gAPlgoqX3 M/wnCuiIjkw1xZ3lSVaxdfXA3ZdGkUw9kMeinY2dwwsy2ZvPlS4L4qe4cI7XQsegXfy4 IFCT+6vzjXzaBynFAmeJMqTYW6FNteRkMELj8TicFbJN9V/4L7hDTxqU64tNuhjX0mKa ZOYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=h9lGgWdSto7RhsvqQN/VFvmVmfoHvfE987evZTsUQdo=; b=uz268Z3ZrJ1XknchPRgQajRn7ZKTl/vsFd1VSLbJYdTXa5k80S/89nbpogdq5pMtQZ UwckufUgbehESyF7QFlvkQSAE+IQGXErMiNHuq4JxjOigk9sZz9JuuQI/pT39uPKD8EX 6GnzZLJxvpdnT7CFlTULLw4u/TVt4RjrNlD2OC6sddT0CsAI/khPbQEsy0hHjovUdqit rsnIHMpVqin5PmRBCmm5c8G9B6lmv3i3S+pxCI48S00c1xbKbOOq8VouxmzmEzBZRswl MPgFmh1XzbMPKKWqVr72Mu91jKRvO6NDGibN+d4hZNO6hHy1UVdglLNZFiQlsOBA6Hy+ b56w== ARC-Authentication-Results: i=1; mx.google.com; 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 m58-v6si693708qtm.216.2018.10.19.10.31.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 19 Oct 2018 10:31:37 -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; 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]:51887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDYca-0008VI-Vq for patch@linaro.org; Fri, 19 Oct 2018 13:31:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDY7q-0003DA-Gm for qemu-devel@nongnu.org; Fri, 19 Oct 2018 12:59:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDY7p-0004hp-AL for qemu-devel@nongnu.org; Fri, 19 Oct 2018 12:59:50 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:51984) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDY7o-0002bn-T6 for qemu-devel@nongnu.org; Fri, 19 Oct 2018 12:59:49 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gDY69-0006ls-FK for qemu-devel@nongnu.org; Fri, 19 Oct 2018 17:58:05 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 19 Oct 2018 17:57:18 +0100 Message-Id: <20181019165735.22511-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181019165735.22511-1-peter.maydell@linaro.org> References: <20181019165735.22511-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 28/45] target/arm: Use gvec for NEON VMOV, VMVN, VBIC & VORR (immediate) 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Message-id: 20181011205206.3552-8-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate.c | 67 ++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 28 deletions(-) -- 2.19.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 6fcc43f25c7..7cc0c76420f 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -6641,7 +6641,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) return 1; } } else { /* (insn & 0x00380080) == 0 */ - int invert; + int invert, reg_ofs, vec_size; + if (q && (rd & 1)) { return 1; } @@ -6681,8 +6682,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) break; case 14: imm |= (imm << 8) | (imm << 16) | (imm << 24); - if (invert) + if (invert) { imm = ~imm; + } break; case 15: if (invert) { @@ -6692,36 +6694,45 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ((imm & 0x40) ? (0x1f << 25) : (1 << 30)); break; } - if (invert) + if (invert) { imm = ~imm; + } - for (pass = 0; pass < (q ? 4 : 2); pass++) { - if (op & 1 && op < 12) { - tmp = neon_load_reg(rd, pass); - if (invert) { - /* The immediate value has already been inverted, so - BIC becomes AND. */ - tcg_gen_andi_i32(tmp, tmp, imm); - } else { - tcg_gen_ori_i32(tmp, tmp, imm); - } + reg_ofs = neon_reg_offset(rd, 0); + vec_size = q ? 16 : 8; + + if (op & 1 && op < 12) { + if (invert) { + /* The immediate value has already been inverted, + * so BIC becomes AND. + */ + tcg_gen_gvec_andi(MO_32, reg_ofs, reg_ofs, imm, + vec_size, vec_size); } else { - /* VMOV, VMVN. */ - tmp = tcg_temp_new_i32(); - if (op == 14 && invert) { - int n; - uint32_t val; - val = 0; - for (n = 0; n < 4; n++) { - if (imm & (1 << (n + (pass & 1) * 4))) - val |= 0xff << (n * 8); - } - tcg_gen_movi_i32(tmp, val); - } else { - tcg_gen_movi_i32(tmp, imm); - } + tcg_gen_gvec_ori(MO_32, reg_ofs, reg_ofs, imm, + vec_size, vec_size); + } + } else { + /* VMOV, VMVN. */ + if (op == 14 && invert) { + TCGv_i64 t64 = tcg_temp_new_i64(); + + for (pass = 0; pass <= q; ++pass) { + uint64_t val = 0; + int n; + + for (n = 0; n < 8; n++) { + if (imm & (1 << (n + pass * 8))) { + val |= 0xffull << (n * 8); + } + } + tcg_gen_movi_i64(t64, val); + neon_store_reg64(t64, rd + pass); + } + tcg_temp_free_i64(t64); + } else { + tcg_gen_gvec_dup32i(reg_ofs, vec_size, vec_size, imm); } - neon_store_reg(rd, pass, tmp); } } } else { /* (insn & 0x00800010 == 0x00800000) */