From patchwork Wed Feb 7 22:55:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 127224 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp934339ljc; Wed, 7 Feb 2018 15:07:50 -0800 (PST) X-Google-Smtp-Source: AH8x226Rrm+w4oofXsTZ3URg9Z3PjbAy+SUUkOInmpKGMnAvY90dLPs1wF7BrN8lNOBXKhABv+iq X-Received: by 10.129.74.134 with SMTP id x128mr5209899ywa.220.1518044870750; Wed, 07 Feb 2018 15:07:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518044870; cv=none; d=google.com; s=arc-20160816; b=VXrWXiQzDyq3JJexg8/iif3/ZA+39CVjzumFHU+RG27vNAuiaBj589L4FZ70ixrNg8 X5dddoYl6ZGWWa0J4UblMhqgN6dvEAo+5R63WHCQbm2SZLCdjH//gAkRtkKno/1XzrKR TpipN98auoDgoyaHAiyfwLIAOstn2AmIEM2LM5vnYAvsoCnS5CRKjQ2iCqgiLbC3rND+ PxgShcdWR+5sHUzQEd2HhMzZt1qu6OrehQbHeR+n2t3/ShFLPXsoR3QYBLeuGdRGuZeJ ru346Db+pbb9oDyfMEuHYFetI8YFvm0+JehqojElMPfm8SxNugeB1c2v26vcWbiYjGRn Da7A== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=jA10FWHsc7R4pQ0BLq51kh64gBjTgIgIpKncpMdkfn0=; b=pfvUJBXqDd1jyStfQuLs2w6LYghvUj/XxcfxNSr9gbvjmiepI7UCKgSb+wamXZ8jUA jTDp0mnu5mb2HiI/t68evVgfiICRf8Wpg3qSPmxMuzT86/qbLTncxTNlflEMJp2B4A8d NbrlbJ0qt2I3pna5TyXJuHqiMOqiNxR7Kzf4VnAKu5hVMnYpyTomlDKQ+wkvgc9E+a9p fS1riG8mbLmMcf885p9mi96B7vkpyUCI1ChapL4ev1Lt+RFCVhbDgqLEzxpW/1fBaEFY GTRlOqV5V8FQ00nq9QBCC13vorHDrCRnTDsvVs3kOjL3u4gvFchgnBUdCVXpBm4uaiqb HX4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NbhORAB9; 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 p190si421390ywd.69.2018.02.07.15.07.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 07 Feb 2018 15:07:50 -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=NbhORAB9; 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]:40588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejYog-0000ZU-41 for patch@linaro.org; Wed, 07 Feb 2018 18:07:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejYdP-0007VK-G6 for qemu-devel@nongnu.org; Wed, 07 Feb 2018 17:56:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejYdO-00058Z-O7 for qemu-devel@nongnu.org; Wed, 07 Feb 2018 17:56:11 -0500 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:38140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejYdO-00058F-HY for qemu-devel@nongnu.org; Wed, 07 Feb 2018 17:56:10 -0500 Received: by mail-pl0-x243.google.com with SMTP id 13-v6so984724plb.5 for ; Wed, 07 Feb 2018 14:56:10 -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 :mime-version:content-transfer-encoding; bh=jA10FWHsc7R4pQ0BLq51kh64gBjTgIgIpKncpMdkfn0=; b=NbhORAB9VjPr+1Y1BIBcv3g6cy4WWA4BOrc3f0Nvg0QYpEPsPc9/eqvQJ7LAWwzirH 8Xexxq5rZ5ge8NrtvuBZYaw/gu0aTRH26b1zhim9HpV/a6CXU03dxToBdkg+lShPm8ee belb5ymZNa1+ta1HrdwNsJKj5H/1l1/NQM/D8= 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=jA10FWHsc7R4pQ0BLq51kh64gBjTgIgIpKncpMdkfn0=; b=P7FqDXD6Wc90i4dR3wL+KW1uj0+FyXLGHCf7TjlWoFsofcf1kSKXkZmPlSsIY9LP07 K58Ckekxa5b0Repx/W8PFmrrQLAFZGD3hzp2a+12Th/Pp6F3VG7Rax4cA9lDd0oMx3bL la9ftbAHRHRYwocTI+LoyjbPo2fFaGlSzkNsFVVZp3ny0s1TfsEKiC7Urj4SigIbITRi 8Lp21BbXbICndZnXotiz7ALjXJ6HAPjFgvorvfCLbOETjNcbG/DgXHTkK8tUmFS1Mdft khrLu7EuspvFVOrYll1nStWowMu09mwNFyRhLV0EczrZyoVWJcbdmFKj7mOaf8cwAluZ FfVQ== X-Gm-Message-State: APf1xPBMc6+S7ecoQlprst1QLj2we2nAonrArpXPjemmRz6Cj5jLOdeC tFqhwm8j3KcfV87pS7teIG56272LRfA= X-Received: by 2002:a17:902:4906:: with SMTP id u6-v6mr7349165pld.92.1518044169119; Wed, 07 Feb 2018 14:56:09 -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 v73sm5874836pfk.84.2018.02.07.14.56.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 14:56:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 7 Feb 2018 14:55:38 -0800 Message-Id: <20180207225540.31698-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180207225540.31698-1-richard.henderson@linaro.org> References: <20180207225540.31698-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:400e:c01::243 Subject: [Qemu-devel] [PULL 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: Alex Bennée 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 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 91f0ab7f12..0830c3f1c8 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); } }