From nobody Tue Oct 28 01:57:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516207236445937.5052504858468; Wed, 17 Jan 2018 08:40:36 -0800 (PST) Received: from localhost ([::1]:46010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqlP-00049v-EM for importer@patchew.org; Wed, 17 Jan 2018 11:40:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqNP-00079l-RV for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:15:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebqNO-0003yq-Rf for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:15:47 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:43830) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebqNO-0003yT-MA for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:15:46 -0500 Received: by mail-pf0-x241.google.com with SMTP id y26so4226397pfi.10 for ; Wed, 17 Jan 2018 08:15:46 -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 l10sm1099311pff.64.2018.01.17.08.15.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jan 2018 08:15:44 -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=M4Ji+TK2HkN5YPMOvRApwDxjNYtpigzTuKh2ZYNdxYQ=; b=BbNN2xpsbl/tR5zJS1cDNXxHJE7r1RQYtI4UYb+sTkydtrTJDou1Ue6DpeMW0Jm2WY nwqriNvG17ZbmGiyh2YQj8zKcYUESo/WyENXyJ7qL/LA1j6cRBcI8SfcvtGanEzHDm4i b/eSeUMzUCCzDFxf9VweBI+RIJb8rM8yEAQNc= 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=M4Ji+TK2HkN5YPMOvRApwDxjNYtpigzTuKh2ZYNdxYQ=; b=G6800QKLtMk3SgfUoSSEhbt2jQz8iK56zif1eJ/0Z2V7fvdTaPBs1cyDzhhGcaJvvB ZDGgw6YdeVEo7Lpc6pM8BVylcM4s8jBD9lDfU6PMQj+95qRl3Mk1tJKhm9Ew4GXqBIae ZCfXmTLtNxXEAvSYKAVRSJX2ZubKsMMsb0JHrySmYve94QLPSDGKcaRxMJVDjx8fJjkX qecHU73/DcBja6qFvOTjufqDhxGKoFOYwCXi+yudIBHaB+ZhbynQNSyd+svB8v7gPmSE nbw1OsvBDRbRh5OTr3wjYRSIk9gYjAVyjHhwqoLL14ac4QLACXcWwCOXDqUC82PBu5/n al6w== X-Gm-Message-State: AKwxytfAVjDFBgvhhZ3FMloHjMDJyLRs8pJmt/LBOU/W+Qo14cy8W6VJ 2rdVBf1nZpPRyL50V0MmtKKTMCulHsA= X-Google-Smtp-Source: ACJfBosMI6hFQsm9M6hCL1wxwCQ6GusFMqTUPr9LaqlvuoteyWfL8MfCjb2HAmkU4n34ipW7AffFSw== X-Received: by 10.99.110.205 with SMTP id j196mr7308174pgc.54.1516205745464; Wed, 17 Jan 2018 08:15:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 17 Jan 2018 08:14:33 -0800 Message-Id: <20180117161435.28981-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180117161435.28981-1-richard.henderson@linaro.org> References: <20180117161435.28981-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 v10.5 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/translate-a64.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index e8fc4bc27e..3b113f6b7c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6135,7 +6135,6 @@ static void disas_simd_mod_imm(DisasContext *s, uint3= 2_t insn) bool is_neg =3D extract32(insn, 29, 1); bool is_q =3D extract32(insn, 30, 1); uint64_t imm =3D 0; - int i; =20 if (o2 !=3D 0 || ((cmode =3D=3D 0xf) && is_neg && !is_q)) { unallocated_encoding(s); @@ -6221,28 +6220,25 @@ static void disas_simd_mod_imm(DisasContext *s, uin= t32_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] =3D { + { .fni8 =3D tcg_gen_or_i64, + .fniv =3D tcg_gen_or_vec, + .opc =3D INDEX_op_or_vec, + .vece =3D MO_64, + .prefer_i64 =3D TCG_TARGET_REG_BITS =3D=3D 64 }, + { .fni8 =3D tcg_gen_and_i64, + .fniv =3D tcg_gen_and_vec, + .opc =3D INDEX_op_and_vec, + .vece =3D MO_64, + .prefer_i64 =3D TCG_TARGET_REG_BITS =3D=3D 64 } + }; TCGv_i64 tcg_imm =3D tcg_const_i64(imm); - TCGv_i64 tcg_rd =3D new_tmp_a64(s); - - for (i =3D 0; i < 2; i++) { - int foffs =3D vec_reg_offset(s, rd, i, MO_64); - - if (i =3D=3D 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); - } =20 + 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); } } --=20 2.14.3