From patchwork Tue Dec 18 06:38:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154113 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3367359ljp; Mon, 17 Dec 2018 23:10:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/WWWXRS9U2IIzIFqSEGlVsvNiKPQZumQa0/w7dH0ZB/bGJnycfePNOSwGiKuL/jjalZG1Eg X-Received: by 2002:a37:b306:: with SMTP id c6mr14625351qkf.265.1545117018496; Mon, 17 Dec 2018 23:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545117018; cv=none; d=google.com; s=arc-20160816; b=WfNiqxbUIo3gMK2l8uPHEeXxcLhq5ANU0/tqVYoJDxdy8CUBlO0fh7Zvs+S0eOAeL8 w/rP6ouAmPotaKav4RmV0nRCaFrxSVYqEtuAXN1zwn/JSh9fkdtfutor3vW5q6lhVXF9 CpbnN7aaQMhIqfchTFydoWMb0RPhpe/b04/NTKhxwBBJU9HEZjjROC7SCZ2GDLYMpW3P UoJyXTF/HySLdVL5AHcKsv0cUiu98og49IR8MOrqmeyTPyMmifJLc6Eo+LjpFW5K6C5V XTp4iFO7MX3ozbTgwjJ/1XBkdY+cuPBsjDl/IUIwZ+Rfu51EeC681imeI5skScT+Y1JU pUYQ== 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=34C0PCPFsQsKd58ay2ar3pj3ly5MXK9b89BvXCPHT7s=; b=oym/iDAzO2q/nvSyJ4O+8JbVZEmT2WMPRb5ITVQ9sax5jCRkqxxS8pzphXjLPEpwuv xIQ5ha3aXRxequwpw1QirAcnycCKps7we7ICR8dm9Qho01hj3fosRKsmCKhpMNxGAdTL kSbasB6jgShrhv0KZcMFBP4iXBex6v4XU880WLm+LU7J6lALux1Gsbx8fPOWT9m7d9Gm 3HC0OhFPYEAS1LlMl7xTvyPzE9nY4r3uRfQhacyMhI8Ov4dC9nZeJuWlTb+vZ8liNXWc pnsVPP3fA8up5mVsGX0YhIKcldM3xLNgd9pH8VTHG9r1H2a0w2oDLyxfAHmebkJeOq4B Q8wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Aeqk64PC; 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 n64si611549qtd.105.2018.12.17.23.10.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Dec 2018 23:10:18 -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=Aeqk64PC; 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]:52208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ9WE-00019b-13 for patch@linaro.org; Tue, 18 Dec 2018 02:10:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ934-0001sC-JD for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ92v-0002xE-0O for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:10 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:45014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZ92u-0001t1-Ni for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:00 -0500 Received: by mail-pf1-x444.google.com with SMTP id u6so7640804pfh.11 for ; Mon, 17 Dec 2018 22:39:16 -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=34C0PCPFsQsKd58ay2ar3pj3ly5MXK9b89BvXCPHT7s=; b=Aeqk64PCALb/k1wdLQa1cKcjjvQkms/RE+QFd4vWPtpqZHUxmaMwDGB1XfMSAiQxG+ SYaWxzBb45hoV0ZQufpYVmT4qtXahP9+Aejnz+9EUkC2ojksuwHOOhKgsSBO8JJARSKS kVchQZp27sxpdqbYYQ3TXKe6sM3fIFgOUvEMs= 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=34C0PCPFsQsKd58ay2ar3pj3ly5MXK9b89BvXCPHT7s=; b=sG6sa/ddNWvfvJuUlxkeY3fgPWId4lKRc56ILqdovqnMclsdM14rTlzQMDhJlzaIBa x3JZiVoNWDch6CZVm81g2qlsPv3r+jIsUVP7qgYSTo1y4azFrzTOsBwTG/VTFTcvJsVS VEG2Cxt3exIPWj2n2SNINlTfHNsvV4OczohDK/N46fDED7qbIExsrgGmnYsS7zdw1akX w5CdBs4ZKTuI3/JI/WojER7hjx/TTfede9fM5jB/+ZYRaheZUKFkf853hjO2wEjTjOAG FXveL3c2206+Y/3ZjGkMSXJByAEon6sccLMnQTXwF2lypoReIWga1tTUKvRSwEN5Dc/u VDFA== X-Gm-Message-State: AA+aEWYXLcgfRTbiOgGLi+JZc5/jR4V5NghjcWUmpochUMmiHDnwfjrK /yWKKOrJqZa4xJcUydiTDS5isE+Eoqc= X-Received: by 2002:a62:de06:: with SMTP id h6mr16054864pfg.158.1545115155036; Mon, 17 Dec 2018 22:39:15 -0800 (PST) Received: from cloudburst.twiddle.net (97-126-115-157.tukw.qwest.net. [97.126.115.157]) by smtp.gmail.com with ESMTPSA id c7sm27072509pfh.18.2018.12.17.22.39.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 22:39:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 22:38:38 -0800 Message-Id: <20181218063911.2112-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181218063911.2112-1-richard.henderson@linaro.org> References: <20181218063911.2112-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::444 Subject: [Qemu-devel] [PATCH 01/34] 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: qemu-ppc@nongnu.org, mark.cave-ayland@ilande.co.uk, david@gibson.dropbear.id.au 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. Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) -- 2.17.2 Reviewed-by: David Gibson 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 = {