From patchwork Thu Oct 21 21:05:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516099 Delivered-To: patch@linaro.org Received: by 2002:ac0:bf50:0:0:0:0:0 with SMTP id o16csp346569imj; Thu, 21 Oct 2021 14:33:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBDNWH8MtalFSgwwWnm2wGmhJ1edvlauTdIZ1+fUo1FbmTrnYFPdNstoevgA9PJVfo+Uoq X-Received: by 2002:a9d:4b95:: with SMTP id k21mr6798170otf.345.1634852012105; Thu, 21 Oct 2021 14:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634852012; cv=none; d=google.com; s=arc-20160816; b=QMUaglXRlay+ea4aI+iaslEp6tm5NMu4r8XlwRs+t5HIVjJRfH4Vcr21PoDVNGpSQu fujO4GHqp4blvTpQVqlLdW4KpwLB1+HCiuMY9P0OE5fDNXQrTBgo8p3By/+4G5gxtmtb Uqqm2LuD2I9o1E/DEW2MwZgdgaz2pcJKj4wIghQyOmBODyZcWN02zpfJZN9JzVR7BTF4 s2pfLOaSsJ8IHVvNT0DShRiXvJiHO4gfD6vzISCpxBJxCxyNmrweqNIABmEh4VYdbqim NOIPwnt9jJRaGf+41NO7DmViX47/eojyT4N2hiw9JVua4tMIbAV0LJA5L3iuB7Fkvzw0 N87Q== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5OACwzIys5FSfqLiabf12PLbwCKC1OcUot8fvYXFvzw=; b=FxvDMzq7Ix61VNOorsEDx6UBa/IhNwFvyd2q2DraH4y9T3JLPonU76mlMQ+b8aJVeX r07jds/0cMvzRhrhD+mmxaaqh9thu1FUIn7+U2Oi+o7upCwv+vYrnXpCDbgWwZXbc2ix hhg7XGQCai/hGIScaLXRSLGjkrdpHCVv8SRwI6B14DjZIVh5ZAMleFvisvKyhO80oXiA fMy/GlCymbQVSHYKJhQIxlcbCZQYSctdZ/BYdYPD1sqkzmVy8bYdSebeVulssyiCtG0i ffNKHWxDReVjZK2D6NNRmuLFJiH4cSIfgCzwKogTOI/A9BhRMIu6OkuAXKAthBZTwPMo +LiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Af6vtGcu; 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 y1si4657449otu.170.2021.10.21.14.33.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Oct 2021 14:33:32 -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=fail header.i=@linaro.org header.s=google header.b=Af6vtGcu; 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 ([::1]:56402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdfgp-0003Rj-F5 for patch@linaro.org; Thu, 21 Oct 2021 17:33:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdfGJ-0007eI-R0 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 17:06:09 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:46019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdfGF-0004TX-Mh for qemu-devel@nongnu.org; Thu, 21 Oct 2021 17:06:07 -0400 Received: by mail-pl1-x62b.google.com with SMTP id s1so1262642plg.12 for ; Thu, 21 Oct 2021 14:06:02 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=5OACwzIys5FSfqLiabf12PLbwCKC1OcUot8fvYXFvzw=; b=Af6vtGcu8BkQW8Vjw4XX3q0Lv8BmqmRa9T1WbJxVEBKefMyk9M8VJfAGzVUXJOU/id qoCEjMecYb/sTWiPB6TjIQlUpZ7x+P4fSKtWtSLylf2Nhd2Qb5ozfvsvMpiQzFsj57sP A72t8TEFoLlvMP2pLe76AFIfa8Xy8jaGOnM4bwXJ6jsKRCQvGQV2E9VWx/241C0/PT0R xuR2Ym8ZGAaQKWj7VygVOZTRAQmZb1BOip4ytd0KwLEp8c3b1TWERMccaVMMaIqwO6Yr ty/plZ8MIDhc5ORSZDsqqrhQuehunCmXUHTgRPAm64peCOhQOcRbzYUwJoFjcpHohyf/ ix2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5OACwzIys5FSfqLiabf12PLbwCKC1OcUot8fvYXFvzw=; b=N9O4Y3UNLtMPSVgOr8hXBz5WBMajbtji6iLb548ILuZPOB+zPwr+j+xvHcdHzT5cj0 F0dH+flk+r/zYdM2QGxofYCechHGAkoAGCW3K8oCuNl/BjsAT0Blk+D6e+1/HdWgP+YN sZ1ojQVoxo+B949+M7Vo6dQqbZXI3KA2aKJLlvdu0ivkHr9sLSyyjEzVwSxi/5PiVUaP hd4NXXGLqLUhb7micn4r7cs57aRfpv4tb7jkoi7NnIHbKsjdr2aJY8SFhyQ4sLHWEXls nt6m1Gtirj1byv5Y6+sXN07YAnK5at6bWeqJrpqtA9nQMeYeV/SQUbADyL1YgwcF+Lgi vteg== X-Gm-Message-State: AOAM530xAMWqOdBhVjts8GalDIQmELRPtSHcXkYA6etKI+YP79jI9mf6 6+1MmE3NWmvrWNnJzc3RbwfTXRC2lG5lDQ== X-Received: by 2002:a17:902:d501:b0:13f:f3c0:20a1 with SMTP id b1-20020a170902d50100b0013ff3c020a1mr6644163plg.39.1634850361916; Thu, 21 Oct 2021 14:06:01 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id g7sm5981670pgp.17.2021.10.21.14.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 14:06:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 29/48] tcg/optimize: Split out fold_mov Date: Thu, 21 Oct 2021 14:05:20 -0700 Message-Id: <20211021210539.825582-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021210539.825582-1-richard.henderson@linaro.org> References: <20211021210539.825582-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com 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: , Cc: luis.pires@eldorado.org.br, alex.bennee@linaro.org, =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is the final entry in the main switch that was in a different form. After this, we have the option to convert the switch into a function dispatch table. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) -- 2.25.1 Reviewed-by: Luis Pires diff --git a/tcg/optimize.c b/tcg/optimize.c index 2d626c604a..af055f05d3 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1010,6 +1010,11 @@ static bool fold_mb(OptContext *ctx, TCGOp *op) return true; } +static bool fold_mov(OptContext *ctx, TCGOp *op) +{ + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); +} + static bool fold_movcond(OptContext *ctx, TCGOp *op) { TCGOpcode opc = op->opc; @@ -1733,20 +1738,11 @@ void tcg_optimize(TCGContext *s) break; } - /* Propagate constants through copy operations and do constant - folding. Constants will be substituted to arguments by register - allocator where needed and possible. Also detect copies. */ + /* + * Process each opcode. + * Sorted alphabetically by opcode as much as possible. + */ switch (opc) { - CASE_OP_32_64_VEC(mov): - done = tcg_opt_gen_mov(&ctx, op, op->args[0], op->args[1]); - break; - - default: - break; - - /* ---------------------------------------------------------- */ - /* Sorted alphabetically by opcode as much as possible. */ - CASE_OP_32_64_VEC(add): done = fold_add(&ctx, op); break; @@ -1816,6 +1812,9 @@ void tcg_optimize(TCGContext *s) case INDEX_op_mb: done = fold_mb(&ctx, op); break; + CASE_OP_32_64_VEC(mov): + done = fold_mov(&ctx, op); + break; CASE_OP_32_64(movcond): done = fold_movcond(&ctx, op); break; @@ -1883,6 +1882,8 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64_VEC(xor): done = fold_xor(&ctx, op); break; + default: + break; } if (!done) {