From patchwork Fri Jan 26 04:57:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 125898 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp75922ljd; Thu, 25 Jan 2018 21:07:19 -0800 (PST) X-Google-Smtp-Source: AH8x226OpRAKt4oT9jnzcwKL4RA6MwersXK/1QnXNd1LkEgAVVHX74N5G0heAYaatXrAyf+suLPO X-Received: by 10.129.116.196 with SMTP id p187mr9860896ywc.467.1516943239358; Thu, 25 Jan 2018 21:07:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516943239; cv=none; d=google.com; s=arc-20160816; b=JTJAh9/BX15XdHDm9SUVWT1+26ysz9hsA7+0e4bPl10LQWI0CrL5rZp3X0hPWraucW C5n0Wl742TglKHC8MOwqgARDngT7AmNAkIMqEwN4W/dxtDMEBpwwcAXV45bqlwQhibr6 SRULUwLMWPXjlLq1aMmare43Qtv/X7eAjDqYfer3St4TTk0ivxGalC1Zpst2tGTz6tuu sgLhQCk63q+2SGPPK9/Qfx9vjMOTWkYI/N2khLrTuB0g1C+7aIM72sj/UVTI2N4//rvL GltvP9wJ4eT950CU1dVW8bHWBYBiOnCuqhrei4k+6KT1hUNl/K6M7IJc+nxiL1Zj60gX OW+A== 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=XjVnmIXYYCqWv5oZJzuP5GrsrQI8am9qFmO1DlUx/5Y=; b=h/f86eB0SZQZbyBzkPtMBmiCpEX9sBa5FPExupTx5Z3eu3TiyiKi0C2qoUCVXYqc1D vlNFSuhQNRONcf0XeLWH+BEei+HZIb/ur0o17pTcShuMCxpdhKampxVTLO9keCxakeoR 2Q1s+rLrMbNkJUdpcy784V019ingZxxvYV5ZACatIGR3sTVq4D8DuZIOBpa5KWDeSp4d wvhNBkP8RTfTSt54iv+vFy0I3EmxlYbjzBy+N3lNHHL9yFC5JEIdv3pSb03GDZSMSQFB 6Rpy8vr0/omcT2O4o2CHBKXRJVUWtSIRS5kOY6CCk00ZGSkNc4iKVBOR/cMx8pv73Ega UP2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GnbMeTtY; 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 x84si794106ywd.99.2018.01.25.21.07.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jan 2018 21:07:19 -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=GnbMeTtY; 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]:59150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eewEQ-0005xa-Gp for patch@linaro.org; Fri, 26 Jan 2018 00:07:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eewBj-00044j-Ha for qemu-devel@nongnu.org; Fri, 26 Jan 2018 00:04:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eewBf-0000nD-Jg for qemu-devel@nongnu.org; Fri, 26 Jan 2018 00:04:31 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:33071) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eewBf-0000mT-Ek for qemu-devel@nongnu.org; Fri, 26 Jan 2018 00:04:27 -0500 Received: by mail-pf0-x241.google.com with SMTP id t5so7513142pfi.0 for ; Thu, 25 Jan 2018 21:04:27 -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=XjVnmIXYYCqWv5oZJzuP5GrsrQI8am9qFmO1DlUx/5Y=; b=GnbMeTtY9eOBR+Z56Q7yiaYKHRbvEjwodJ3A9dFeez4dt8VNubEzoVKfsDrN8L+9oq 9f9oLB/3bE+nwhKqkgWQ3RBk8vnVzzZ+ZfL9dLOzgG//D5wwhq9Fa248LpRg+cAiNwPo MkTOcpA1YY9iWb/iaUya9mmqmVw2FWciQyMvM= 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=XjVnmIXYYCqWv5oZJzuP5GrsrQI8am9qFmO1DlUx/5Y=; b=lrqEqaRl3p4xG9dGqpbtE/YSXJm/YEPE5xrLpVykTbYN4M4osvZI8twYuWF8CiYHbm n/b0QBsPmF3DRE62hejxGzlMIq5hbOE7l0N1Y8D/hhPVwtFFZowMDB0gkQSa32DWTGCG likZG02XwtYF65rKJzHppXgm3a2qS3LlzgHz0nQXHQOCl5QGag80Aca5PSGAg/EsUDkZ qoGIsoRUlUS/qAkrtnDLNLnsGHBg74QWoX9R3VVMggkbCcjtplMvSRj74g1UPeA4ikpW TlTxzgj/a5u7lCuuzk/4bOm3jtyinRLnSh9BY09zbbGRfkUZzQo7F+cOo5oJ65HuEyDI 6ZHA== X-Gm-Message-State: AKwxytf8toSv5lBQ3FN9Bg3nTO2qrO6H56dkJIK1HUokRh6T7LsxPI4e WeZB4Ukd7udDeJcsxdnqsP/jEkBkSKI= X-Received: by 10.99.152.10 with SMTP id q10mr6014374pgd.212.1516942703585; Thu, 25 Jan 2018 20:58:23 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-6-47.tukw.qwest.net. [174.21.6.47]) by smtp.gmail.com with ESMTPSA id q67sm20460313pfi.164.2018.01.25.20.58.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jan 2018 20:58:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 25 Jan 2018 20:57:40 -0800 Message-Id: <20180126045742.5487-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180126045742.5487-1-richard.henderson@linaro.org> References: <20180126045742.5487-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:c00::241 Subject: [Qemu-devel] [PATCH v11 18/20] target/arm: Use vector infrastructure for aa64 orr/bic 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: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) -- 2.14.3 Reviewed-by: Alex Bennée diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 64a2c2df59..d688a699be 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6180,7 +6180,6 @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn) bool is_neg = extract32(insn, 29, 1); bool is_q = extract32(insn, 30, 1); uint64_t imm = 0; - int i; if (o2 != 0 || ((cmode == 0xf) && is_neg && !is_q)) { unallocated_encoding(s); @@ -6266,29 +6265,12 @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn) tcg_gen_gvec_dup64i(vec_full_reg_offset(s, rd), is_q ? 16 : 8, vec_full_reg_size(s), imm); } else { - TCGv_i64 tcg_imm = tcg_const_i64(imm); - TCGv_i64 tcg_rd = new_tmp_a64(s); - - for (i = 0; i < 2; i++) { - int foffs = vec_reg_offset(s, rd, i, MO_64); - - if (i == 1 && !is_q) { - /* non-quad ops clear high half of vector */ - tcg_gen_movi_i64(tcg_rd, 0); - } else { - tcg_gen_ld_i64(tcg_rd, cpu_env, foffs); - if (is_neg) { - /* AND (BIC) */ - tcg_gen_and_i64(tcg_rd, tcg_rd, tcg_imm); - } else { - /* ORR */ - tcg_gen_or_i64(tcg_rd, tcg_rd, tcg_imm); - } - } - tcg_gen_st_i64(tcg_rd, cpu_env, foffs); + /* ORR or BIC, with BIC negation to AND handled above. */ + if (is_neg) { + gen_gvec_fn2i(s, is_q, rd, rd, imm, tcg_gen_gvec_andi, MO_64); + } else { + gen_gvec_fn2i(s, is_q, rd, rd, imm, tcg_gen_gvec_ori, MO_64); } - - tcg_temp_free_i64(tcg_imm); } }