From patchwork Wed Sep 9 00:16:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 249406 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp5016320ilg; Tue, 8 Sep 2020 17:24:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySVhTzawnw5frNGWItsa/lSeWNooYWyeTO5r8UaeeUA4TQ6qlh2I8y1FDofnS6/Xh+mpCT X-Received: by 2002:a25:2d59:: with SMTP id s25mr2357120ybe.86.1599611077942; Tue, 08 Sep 2020 17:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599611077; cv=none; d=google.com; s=arc-20160816; b=Qa7P4RnZOBc3LXBuVIxHVPanlgSIKXE3LSFEHJezTlyVbizuSuwiOlrxixUEoXwPOk +iMNm2Ow+ksOBXDq3H2qTVc2YowTrBPw6/lPEirBfZf1zSNqAh8u1FrW5cD44m06SW4A pJjKDACJeuWjmXtb/l1/tJg/JNFuN+dZUGvy8t/CcxRXshrbtOJ5Z03HMQQ79uhhUq6v F91qWB8FFng9fm3kgqNtQRjZ4leDhe7pI61ulRCfy4oeZW1rpyVROn+nM8jWUwa69y6h 8LqxcgcdEb9a2DTnPwym0FN79bmiTMBqCoVqhKaHAvVojvT13mthJurJ4D08ReFfzeDF JNmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=WANLQRCpycKiqrfSXuwWnjHW6iUlbU2o8NExmAhiBGo=; b=O+qH6P+GhEelbIhBsZnUs64T+8NQ57Bc7iWdBN3yZoyLqOogv3+lF9cnoaM4JZBP3I ajNLNhJ+2u9unvCDqnq4f7NCubkDJ1KNPRY8/hiZQzZfJi0OZ3VBnHq+3IL7S8Mqatwk kSG5xteppSYsqxVG+wTijx84JHooftq/1sMoLNXgr6eWaa4YQ9cso6ThnFV8eMSC2UpC rafUVUoUScUNW/FXbSdSnDZTTZMke84wF7lsudTNEdSdM8CmMABtj3/dyE6QQrq9FCEm WtCdszvLWyt7BdegkBf/uiHqhdZ5alw2bv6ao4yz6TS3j+rSQ2FjeDcGtX2STvWOoqHX fglg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zFHxOBUA; 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=pass (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 e8si945697ybb.412.2020.09.08.17.24.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Sep 2020 17:24:37 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=zFHxOBUA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFnuf-000804-Cd for patch@linaro.org; Tue, 08 Sep 2020 20:24:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFnnL-0007qE-TS for qemu-devel@nongnu.org; Tue, 08 Sep 2020 20:17:03 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:33741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFnnK-0002Cg-7f for qemu-devel@nongnu.org; Tue, 08 Sep 2020 20:17:03 -0400 Received: by mail-pg1-x542.google.com with SMTP id e33so752995pgm.0 for ; Tue, 08 Sep 2020 17:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WANLQRCpycKiqrfSXuwWnjHW6iUlbU2o8NExmAhiBGo=; b=zFHxOBUA4THZW2VM6gUFeAzETtdF+vMSsfacwfh/LzcRiMNc29ttwk42Zr6h8l5NdI 6ZcpPAd//DiOvCVR9KFR9P0A1i1kBNykb6sEDJrifpKPLUPx5SPkKCqFjyplQJkENL8Y hG0qp1MQRpynDkWfFTG0NlFEYiwkFwjtrplx/e7x6PArWQxvUSASrETx9UxGVkXtfrAO OY+0yFQYN7eQE/p3/Ft0lBkQgxu2fP7H5JCoWRLakpacRlgmbuSmBmW2TKwRWfWojZ4+ Va5mJRnyjeOu4SJU6aInmE1QfiGF5WddstnhLdRLdWQKR+U2p40JYJ2YoFi6tvDZCATb x3KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WANLQRCpycKiqrfSXuwWnjHW6iUlbU2o8NExmAhiBGo=; b=W4M1wugTtiKWhI/+jefe/epPat92dL3h8/WeQW/FEFBby5+zbYoUNd368nUw4zKpaB vebzxAsjoB54FHttU5tGfOwbMEIL/oYEs5Hygc+Vfy0UofDCAuQfjRHmBkpQkqCu6u2f Jc5tqxLNOea7SRcYzMMu9kh3tRGPQgaUkyWbOsI3lrdEEHWG8U1wToGWKJNTKDvnloGJ DKJcbhhbn3ZCntel5+Uk1dOdUrTSQsQmQ1grR5oFpJb027x/R/960eDqC9HG8rUpuRaH Pk9I45J9gMWg8EyVH2mVIx+Nz+0qsYAQvL2b7YuZelMqvQUwiCo2sXrn9u3PkhbRVitL svQA== X-Gm-Message-State: AOAM533baiw65+ZKGJLCJ1eQzIOQlanNLwjTrUgLViyGQFOg4E+NkJ+k NVxDmnlnMPSKF2CUSdEEZt+rTzVgwH5m/w== X-Received: by 2002:a63:5d66:: with SMTP id o38mr949965pgm.366.1599610620688; Tue, 08 Sep 2020 17:17:00 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id 137sm505437pfu.149.2020.09.08.17.16.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 17:17:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/43] tcg/optimize: Fold dup2_vec Date: Tue, 8 Sep 2020 17:16:13 -0700 Message-Id: <20200909001647.532249-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909001647.532249-1-richard.henderson@linaro.org> References: <20200909001647.532249-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When the two arguments are identical, this can be reduced to dup_vec or to mov_vec from a tcg_constant_vec. Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 53aa8e5329..220f4601d5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1109,6 +1109,21 @@ void tcg_optimize(TCGContext *s) } goto do_default; + case INDEX_op_dup2_vec: + assert(TCG_TARGET_REG_BITS == 32); + if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { + tmp = arg_info(op->args[1])->val; + if (tmp == arg_info(op->args[2])->val) { + tcg_opt_gen_movi(s, op, op->args[0], tmp); + break; + } + } else if (args_are_copies(op->args[1], op->args[2])) { + op->opc = INDEX_op_dup_vec; + TCGOP_VECE(op) = MO_32; + nb_iargs = 1; + } + goto do_default; + CASE_OP_32_64(not): CASE_OP_32_64(neg): CASE_OP_32_64(ext8s):