From patchwork Mon Jan 28 15:58:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156768 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3597768jaa; Mon, 28 Jan 2019 08:08:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN78m03jQR+bUadcMPGAFXes9qDfdBjeGkxgVqIh1O8wGzrrhjZHarQ8eSBmev9yVtcdRrAf X-Received: by 2002:a1c:1902:: with SMTP id 2mr18225670wmz.150.1548691731373; Mon, 28 Jan 2019 08:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691731; cv=none; d=google.com; s=arc-20160816; b=Cti6J6itKzAuZdls8pCNgM059KL4I5Nc4qdn8CLDriOfJ+t0VBZgc2NU5s7DKD7mPF 2AEpekyOI1sIVENK4Z40Xx7UULPBUbZrVnD4KVTpSYQgTuO7VDTeyryMRrkNkUXajCl9 mle+SIH+9/XqUMpeIBaOQrlqjBrWQsAaVo8b7my/gtQ4Z6AdrPCgiAwSfvoJKIJ8ym8L 6INvm6QxU6GP1q3H0I76N+GTTj7JzCNn0tTxn8XWVraOEfX+3PtFZxLa0SPLqNZWlZLo Vgx3ljZ0ImDOlElGv2MgQRUnbtnO1gfkoYFZGs7Ofz88ehEuj3qkDKV/eVXhaiznzOTg 1TwQ== 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; bh=po3fGKZcEsraXkqBMSX5FPnIKtuOJRDnAJ2/AeZX7VI=; b=Bgko5g8KGJ5b1us9Yxebr9RbGMpaTkSH4YDPqcSp7FQUTeCT+IOFRePb75Guw9Wb/u 6t2g0suX767KitRM/7uMiosFGEFbIHdUGO2iFB0e86T1ZUq6yhF/Vg6L1jjM6ORT4SjW Ton/OxHS85ZaDTs0w5dmZrEK6vA8y3yJcFD5TpzuAjD0xNVlDcGr/hjC2edOiPuc67cQ tTcVInjcF4mMmwkgk7BNEdT7teygxazlVRgDSx3e4J7f7UQUQK7sX9MdRWIPmjpRpbOQ MQmyM8bU52rMLbQpITDxCGKdnCzt5hy+2G5pd3BFgc/IVHVgHBGGxh7RwV5CITCs7g0q zexA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CjassVpi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id h70si84729613wrh.88.2019.01.28.08.08.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 08:08:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CjassVpi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:34265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go9Ss-0002kr-7V for patch@linaro.org; Mon, 28 Jan 2019 11:08:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go9Jc-0004l7-Un for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go9Jb-0007hU-Vw for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:16 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:44105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1go9Jb-0007ga-3x for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:15 -0500 Received: by mail-pl1-x62d.google.com with SMTP id e11so7904565plt.11 for ; Mon, 28 Jan 2019 07:59:13 -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=po3fGKZcEsraXkqBMSX5FPnIKtuOJRDnAJ2/AeZX7VI=; b=CjassVpiSvAdhz+HmuArDM2Ss1pfNvazmr2x0K+2arepsS0fG9/dE9FRCJymAn8+ZP 1MtLwisO68oULAdE5vz84aakOoVqTp4gNGx1FmJuLLic4CF3jM6QHNELJXob/pLch3BH hL903L7NcknKEnAloaVikYfkHqeAYHH8kRZS4= 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=po3fGKZcEsraXkqBMSX5FPnIKtuOJRDnAJ2/AeZX7VI=; b=b+Ec9xchRbcK4jdkPCfBFeZDhpVCelFSukNC8WlJzwTkC6n6ubLgxsnfxJlJI8wswy yVVn1O1bydSDPsgNLwlW1eEtenqlPNKNLXu8eVZ+TnU+rwXdAQodH2dYrvR/8/H1rbB0 kCshqtBLD26Qpn/kLVH1Cn/qDZx+j2gj/6XZarRZPXfazmUt81ZkFet+gV/9wavmsi+I /kaPBDMtznI0HH2FKAhp59wtl0MLUxWXdkiROHXCOyO1OuVjiTm2uoQSCaPQa7PaCSGf OIjJzQ9C4c0jGVd/AfqZjGOdIeDQUCyjThaetF8WlEI3cwQQYWOi4HIzcgevOdcOvP0x imbw== X-Gm-Message-State: AJcUukfOsn46sMybR+L+O2MsJvA2nDZLAu2Eu4xVZGoYokUS7C3EU26P zioHf8JjMtupVQX6phxVs0Ny8NUUHao= X-Received: by 2002:a17:902:8607:: with SMTP id f7mr21746826plo.123.1548691152396; Mon, 28 Jan 2019 07:59:12 -0800 (PST) Received: from cloudburst.twiddle.net (50-233-235-3-static.hfc.comcastbusiness.net. [50.233.235.3]) by smtp.gmail.com with ESMTPSA id p2sm45518687pfp.125.2019.01.28.07.59.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 07:59:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 28 Jan 2019 07:58:45 -0800 Message-Id: <20190128155907.20607-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190128155907.20607-1-richard.henderson@linaro.org> References: <20190128155907.20607-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62d Subject: [Qemu-devel] [PULL 01/23] tcg: Add logical simplifications during gvec expand 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" We handle many of these during integer expansion, and the rest of them during integer optimization. Reviewed-by: David Gibson Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) -- 2.17.2 diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 61c25f5784..ec231b78fb 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -1840,7 +1840,12 @@ void tcg_gen_gvec_and(unsigned vece, uint32_t dofs, uint32_t aofs, .opc = INDEX_op_and_vec, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + + if (aofs == bofs) { + tcg_gen_gvec_mov(vece, dofs, aofs, oprsz, maxsz); + } else { + tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + } } void tcg_gen_gvec_or(unsigned vece, uint32_t dofs, uint32_t aofs, @@ -1853,7 +1858,12 @@ void tcg_gen_gvec_or(unsigned vece, uint32_t dofs, uint32_t aofs, .opc = INDEX_op_or_vec, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + + if (aofs == bofs) { + tcg_gen_gvec_mov(vece, dofs, aofs, oprsz, maxsz); + } else { + tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + } } void tcg_gen_gvec_xor(unsigned vece, uint32_t dofs, uint32_t aofs, @@ -1866,7 +1876,12 @@ void tcg_gen_gvec_xor(unsigned vece, uint32_t dofs, uint32_t aofs, .opc = INDEX_op_xor_vec, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + + if (aofs == bofs) { + tcg_gen_gvec_dup8i(dofs, oprsz, maxsz, 0); + } else { + tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + } } void tcg_gen_gvec_andc(unsigned vece, uint32_t dofs, uint32_t aofs, @@ -1879,7 +1894,12 @@ void tcg_gen_gvec_andc(unsigned vece, uint32_t dofs, uint32_t aofs, .opc = INDEX_op_andc_vec, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + + if (aofs == bofs) { + tcg_gen_gvec_dup8i(dofs, oprsz, maxsz, 0); + } else { + tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + } } void tcg_gen_gvec_orc(unsigned vece, uint32_t dofs, uint32_t aofs, @@ -1892,7 +1912,12 @@ void tcg_gen_gvec_orc(unsigned vece, uint32_t dofs, uint32_t aofs, .opc = INDEX_op_orc_vec, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + + if (aofs == bofs) { + tcg_gen_gvec_dup8i(dofs, oprsz, maxsz, -1); + } else { + tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g); + } } static const GVecGen2s gop_ands = {