Message ID | 20211029043329.1518029-24-richard.henderson@linaro.org |
---|---|
State | Accepted |
Commit | 079b08040e0c4eed96b3c19fe37cf17a46294d2b |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp412481iml; Thu, 28 Oct 2021 22:09:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA8+rmWxCf/VCtNivsvqH8scbiBvDBsMpZT/0EC4XLpdInRYsOTUVAI26/3f3cPLhvjxBY X-Received: by 2002:a05:6830:2462:: with SMTP id x34mr6737839otr.31.1635484164037; Thu, 28 Oct 2021 22:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635484164; cv=none; d=google.com; s=arc-20160816; b=cePZpzPvzCmBxw17ROIb2aayWfS4wLFVli+opX/DCFgxzDmlgYpVfI0t804sUBpUKL ImWBmUq0zWfuCpCj0oRmpjYLnDJANxXJGMhmr+E77qlihuVELjOlx/OTW5+lUhUzgBn3 m56oNFe1u4xbmvTH4CtCJqgHUofgbWv/Wy++305ybwzUeiEzjsobGqrI95UQ0aNGGNgc R32LQavDVcNlCKy/7kI90DfVkVDp5MSyhWF6Ir2lyyV5ny2Sf9fOetUAR/MrTwjuefgb Gss7HpeaAQqt4dQA0F4PloNUvSHkAp76p7oIiHJLFSIAB+mtPqRnG5aDPknAGlEnOp7n djGg== 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=CFsfCOujg6xp28y0o9M8YysK5F5Ff4YXOa1Luu+j29I=; b=IeiCGGzNPWS3kIQSe1hNhijHC06FBBPjiDxGW4O9l3FxAnCjgsKeDNCbShvCigoXSq l1Eh4eR/zrg8gewFAWjvOOjmMBayf8YljZ3n5YGC8Gto/tdbXVXb9fOShgHvawKbnkff rYWPFT5HY20JF6OaGci8t8Y13IS7+9zFcn8pLXm5C99oOJ0HktnYhsmER+BmSm++70VQ gA9kO8bzsLQDGk5+DtAwmqnK4B9TZ/1uRAcoxChcIL5J2equMDNlftm/6QB1MO1mziFH K439bxHYQVc+cij/VXLS+4hr2gLEfemZL3YRFWlof9zJxYUIoB8mZABDvVf5SBbfcYZv CWYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LoCd2Smi; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m20si8000458ooj.0.2021.10.28.22.09.24 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 22:09:24 -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=LoCd2Smi; 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]:34126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1mgK8n-0005ZT-Mc for patch@linaro.org; Fri, 29 Oct 2021 01:09:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1mgJac-0004jk-Px for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:34:02 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:40858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1mgJaR-0007y3-F2 for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:34:02 -0400 Received: by mail-pl1-x633.google.com with SMTP id v20so5988929plo.7 for <qemu-devel@nongnu.org>; Thu, 28 Oct 2021 21:33:51 -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=CFsfCOujg6xp28y0o9M8YysK5F5Ff4YXOa1Luu+j29I=; b=LoCd2Smiga09ZF/ko5VfSorUw71pWb0TdTeqB/Q8dix3Blx2yv3vxSI/bZ1saeymup pT9KUKeFgLIqOzc0zUDIPj1WOUBI+geeowPgPupE+dIH1+8SOwqBNthclmkkYHwocNTj hIbM2rD3Elgoesbb5q1+yCa0vVeKkDwxunphJOARnT4zNLn2ZdDeyTCYYw1vGzy1h1oF oYWXtolGWtiCIPunNpYEFV6Yr+iQzEqY5kCMoEtFHdPBiOO9ruHBitOiGSFrR0wPoTY5 nhXPlzVS+t5zNvx8NSKPMUOA7wavibk/QgxTN0JTMWdP8a99iZGSHso3+9RowtgHBM7s O4jQ== 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=CFsfCOujg6xp28y0o9M8YysK5F5Ff4YXOa1Luu+j29I=; b=EcimCtMmQ+3zvH9PGhXzBSymi2ojIfaq4qUfWFU70kFa4MoGfZ5LWsbG7zD7a4+EKS YkB4UPoHD6/WllYlHFFImKADK/5E5c4FrRyEWH9o1QokURPNxbYYvqUANj5reT+48eBB nOmXaaKSQAUv/5IrigywgqzzuASkCP57/x1Bao6fdcHmnESJuJpJIK+Za47XRkjbTULA EEznIFmS415Ngpm4EPKAP5fHD9btEe18kfoPY1Ur8hNx2+9lk0DkUDAu0Zf2+ARZAMzM i678bZP3EjYxW8hs/zm/QUYUh/XFnOWDL2kLnFOvcZm/e8RNIIpH+No6VfXtIacnyEOC 5hqA== X-Gm-Message-State: AOAM530xVN7NO8EH9b5z2CGn62TmBbauuvVfDP2JGRv66WhrH8xI+hIE 9uN5NAXuT5gy6XfHQvzvircgDtG4+n/o5A== X-Received: by 2002:a17:902:b583:b0:13d:e495:187a with SMTP id a3-20020a170902b58300b0013de495187amr7711538pls.9.1635482030148; Thu, 28 Oct 2021 21:33:50 -0700 (PDT) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id i11sm4120257pgp.18.2021.10.28.21.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:33:49 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PULL v2 23/60] tcg/optimize: Split out fold_brcond Date: Thu, 28 Oct 2021 21:32:52 -0700 Message-Id: <20211029043329.1518029-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211029043329.1518029-1-richard.henderson@linaro.org> References: <20211029043329.1518029-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Luis Pires <luis.pires@eldorado.org.br>, =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= <f4bug@amsat.org> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
tcg patch queue
|
expand
|
diff --git a/tcg/optimize.c b/tcg/optimize.c index c9db14f1d0..24ba6d2830 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -714,6 +714,22 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return fold_const2(ctx, op); } +static bool fold_brcond(OptContext *ctx, TCGOp *op) +{ + TCGCond cond = op->args[2]; + int i = do_constant_folding_cond(op->opc, op->args[0], op->args[1], cond); + + if (i == 0) { + tcg_op_remove(ctx->tcg, op); + return true; + } + if (i > 0) { + op->opc = INDEX_op_br; + op->args[0] = op->args[3]; + } + return false; +} + static bool fold_brcond2(OptContext *ctx, TCGOp *op) { TCGCond cond = op->args[4]; @@ -1641,20 +1657,6 @@ void tcg_optimize(TCGContext *s) } break; - CASE_OP_32_64(brcond): - i = do_constant_folding_cond(opc, op->args[0], - op->args[1], op->args[2]); - if (i == 0) { - tcg_op_remove(s, op); - continue; - } else if (i > 0) { - memset(&ctx.temps_used, 0, sizeof(ctx.temps_used)); - op->opc = opc = INDEX_op_br; - op->args[0] = op->args[3]; - break; - } - break; - CASE_OP_32_64(movcond): i = do_constant_folding_cond(opc, op->args[1], op->args[2], op->args[5]); @@ -1737,6 +1739,9 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64_VEC(andc): done = fold_andc(&ctx, op); break; + CASE_OP_32_64(brcond): + done = fold_brcond(&ctx, op); + break; case INDEX_op_brcond2_i32: done = fold_brcond2(&ctx, op); break;