From patchwork Tue Jan 16 03:34:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 124601 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp878860lje; Mon, 15 Jan 2018 19:52:36 -0800 (PST) X-Google-Smtp-Source: ACJfBosOnTkB6ibLfVMS9yHFimLvKH2k+eGQaif+yY2zhmzryNkRPusHgttiAL6LgphbJZjlWAdE X-Received: by 10.13.250.3 with SMTP id k3mr16231410ywf.21.1516074756543; Mon, 15 Jan 2018 19:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516074756; cv=none; d=google.com; s=arc-20160816; b=gGF0TECv/NOxkYuYIDSWPFf9frE3+LZ5jThQRJMrCrHDqXto5la2ELKQX2BNnKgM0+ K/Fi8vAONAWC8U8ee54mr4d4ITmeev9hcMOq/d18/pNIphl/DFCTgZVd3I8Jbd3JMDoo 1fP7z1QuOqkg71wa+vtS9HV1PybXYSQID+YghaVrpu/qBN55bqo4d/3t915ExXcfQwY9 Rp2jXUlm4CE5Yw7hhwgbbJkRWkHUItKEITUXmUgb5GuNO2fMs3hIAKBkMaEKdYIOKe9t xuW2VTpFi9NNpf9xb5TIrQj5EUzy1grCatvZRJVH8vgVO5Zch6murAfr92u7g+DITZ3k p/9A== 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=7JeGEyJk3nvjPxacG2wgQtB6Jf/c44XFTKdgknI54YI=; b=DZL/AfViFtX7tUmotSiFSF6VgyhntLzP2y09xcAdP0/Egdsp+b0yLanHs8ybsptn+G YFBlDtUZ4OXT8YhVLfEUOatPTPGY58Q4OjBS2etoaykwkH2kB7C2eMmUwLtXdDodogzl CnKyFprWojBwDCMPVZuh7XlB5qjT2khVWgy0kRGaBIxfxkr5lMScU1/WCHeBn8QWHpbN Xgrh+TwS3+0rS3D4SoAerc+26zqxUwGVzNcTgydxChqBuMU8mTgOcnPcOS3As/DHZqsl iWsyYJnLnPlQplrfl+YHzIc1ddxC+Hfa3+t2EF6w+gDnQ+6yrK2Pqs7IYF3O3KsxD+3h Qj0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K4cKNPI5; 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 w124si274231ywf.780.2018.01.15.19.52.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 15 Jan 2018 19:52:36 -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=K4cKNPI5; 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]:59240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebIIc-0002y0-Rp for patch@linaro.org; Mon, 15 Jan 2018 22:52:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebI1m-0005a0-8J for qemu-devel@nongnu.org; Mon, 15 Jan 2018 22:35:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebI1l-0003Tr-G9 for qemu-devel@nongnu.org; Mon, 15 Jan 2018 22:35:10 -0500 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:38285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebI1l-0003TM-A3 for qemu-devel@nongnu.org; Mon, 15 Jan 2018 22:35:09 -0500 Received: by mail-pg0-x244.google.com with SMTP id y27so2834775pgc.5 for ; Mon, 15 Jan 2018 19:35:09 -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=7JeGEyJk3nvjPxacG2wgQtB6Jf/c44XFTKdgknI54YI=; b=K4cKNPI51r+7F+mDYEFwiQ5MnCVYuy0ULzxvn7RYHso3did9ZZGsa6LjvXC++MLKlb 4jYwsUQerPT8ZdDhHUyPkMPw+20MYnqKHWlg4JELe72fqYvjwqs3wCfJP567nTtWZ/Uj uKsZh6sKQ6N8jIazZYP0oUpA7PpNrofzGahIs= 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=7JeGEyJk3nvjPxacG2wgQtB6Jf/c44XFTKdgknI54YI=; b=iF4Yb2ZFs2ko22fmpz2bsLgRbQ5IBdfGUQ3i8B07LjWi5SSj00aYaxe69P0MC8F7Qv eH/ab9WB73mDjW/eBpxF395p3FToSd9LrHorGQBBpPIefOcmqNdy10zpui1zj1dE04mW fOI76dlaJHtLo3p6Y717ngxqMJxqCyZCVU1+cZ33XsoeH6jYt90leYuNQQ7f/4qpoPVW FuWEOyNeLpIwZMepVC8Ekcv2kGDYhQk5DeuZeQntGvYJexao5nY+umqkZBdYVb5im3KB 0Nj3DLN2PvorwHAR3UzKH8npaKq6+62hnW1MJMHKzag8MmC6uZJsIHA0Dcd9ofO66C98 vXiQ== X-Gm-Message-State: AKGB3mJcrO3rQL1LfbjHpyAPYljjBBi83KMDImrcqBXVukOAPymOeboN WckZjpU1SvgVnkmZlCdSo9AvBEnyl/s= X-Received: by 10.98.103.83 with SMTP id b80mr23721455pfc.223.1516073708061; Mon, 15 Jan 2018 19:35:08 -0800 (PST) Received: from cloudburst.twiddle.net.com (24-181-135-57.dhcp.knwc.wa.charter.com. [24.181.135.57]) by smtp.gmail.com with ESMTPSA id c83sm1281024pfk.8.2018.01.15.19.35.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Jan 2018 19:35:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 15 Jan 2018 19:34:02 -0800 Message-Id: <20180116033404.31532-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180116033404.31532-1-richard.henderson@linaro.org> References: <20180116033404.31532-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:c05::244 Subject: [Qemu-devel] [PATCH v9 24/26] 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" Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) -- 2.14.3 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 4f15e58556..5963eedd41 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6078,7 +6078,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); @@ -6164,28 +6163,25 @@ 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 { + /* ORR or BIC, with BIC negation to AND handled above. */ + static const GVecGen2s ops[2] = { + { .fni8 = tcg_gen_or_i64, + .fniv = tcg_gen_or_vec, + .opc = INDEX_op_or_vec, + .vece = MO_64, + .prefer_i64 = TCG_TARGET_REG_BITS == 64 }, + { .fni8 = tcg_gen_and_i64, + .fniv = tcg_gen_and_vec, + .opc = INDEX_op_and_vec, + .vece = MO_64, + .prefer_i64 = TCG_TARGET_REG_BITS == 64 } + }; 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); - } + tcg_gen_gvec_2s(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rd), + is_q ? 16 : 8, vec_full_reg_size(s), + tcg_imm, &ops[is_neg]); tcg_temp_free_i64(tcg_imm); } }