From patchwork Mon Aug 30 06:24:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 504321 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp1524437jai; Sun, 29 Aug 2021 23:54:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7Ohueh8oDjmIFRUgmo/pRlIZ6hjlKCSCUgpYcVeQmIW1/pQ6y2bqPTcq6993M9D0V1+jv X-Received: by 2002:a92:c846:: with SMTP id b6mr1762847ilq.84.1630306450869; Sun, 29 Aug 2021 23:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630306450; cv=none; d=google.com; s=arc-20160816; b=duq4QwaZ5dllLGC3I5quRfeK9+C8lH1AioR5QJ6Dq12Or4VKOOy+oCuMVoQdUXAveh aXcLJUx70Hg1bF4Un7NkB47evKMq3xH157ZlB5VDqV70BsguL/TGGot1QrWUVm0eWrg4 ghgkv8vpOInlUDuS2ZsQj8vNbF1of/ASYDq9uCvVDMTttn8P2JQj+kAgnKbLJIlVvVyj 0vLCdVTyxEuowQ70oz1rxRmXV4WQL4uvIi64CkR1ggfjrjPHWmFLCvJSpVyvxC47ctys b4TBHHReYMY3pXXp8Whn6apyl5IEGLzMkR0eYY5CSyZN62PX3JgrtY5kNnmw5uTFqRgn u9TQ== 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=nbGo5fQpM+/mWg/WVsbE+2YrmGc9JnbK/yBEl1yT4PI=; b=uY/VflmVMy4rFNy7kefGEdx3LGICUV51AMpRhjzyOIRVNeYA/Lu0IVhC2+5BsXraOr W53B/H6h30aFju0sbds7wpa4zahIW1llfU5+HirhnAfS1GCDqhwTT6XmCnnaCq76WTGt QrXUJzUfZs56+8WScdIvi6B7It9nB9dt0tkUKcYMvXZIbBQ4nV/rfSpYkEDLiXngz1mE t1Lqls2FfAgTMQm9puiBUYb6HzokGScGW5dCYW7OxnHD2mlZJDBABsJAluLrbsr/KW8f aBFKQRe4ZsGQvExwcXH3spgVd7clnXxTJb6uvKpcpUCd6l1U/FrEY/5puTQ8eNbKIW5y A+zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d7LVAVsG; 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 j19si15932541jat.113.2021.08.29.23.54.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Aug 2021 23:54:10 -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=d7LVAVsG; 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]:50582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKbBK-0005Mp-9h for patch@linaro.org; Mon, 30 Aug 2021 02:54:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKajH-0004Cj-WE for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:25:12 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:37727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKajG-0007bE-EU for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:25:11 -0400 Received: by mail-pl1-x634.google.com with SMTP id q3so7935943plx.4 for ; Sun, 29 Aug 2021 23:25:10 -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=nbGo5fQpM+/mWg/WVsbE+2YrmGc9JnbK/yBEl1yT4PI=; b=d7LVAVsGk88ARxIKMmA3Tn9PjVcfK9ON2wVZ/pmwAnaBaa4v8WKlJMr9POFRm0X75H XJTrKD3lBUoM5DeV5JW7xHtrs62F83KJjrrUxywYkeUkGOpaJkOprhApQe4lCo594q/O shJDyuewaFCcuEGVmU9ielS2ps3kmGo0hmi2k5NclceVJo+tGOF942CtEQalXVIlKSXL 2Ztq9bFshzS4tym328epbQZp7NSiLLhzk5unBw1lOTLdhMpWLARgFQ6r/oecafxDSPpa HlzrRT19juZzljN4agxjLuHwPvqpcG7D+lKOza34Y9yInGqG9BFbq4opTuChud8T/hmV YgUw== 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=nbGo5fQpM+/mWg/WVsbE+2YrmGc9JnbK/yBEl1yT4PI=; b=lXhFGBl++dILWrWpBpSPiiYjZsq18cL93zXHz3qsAaTcBnOrzkr05BVXw0FAGF6i4L KWAljWE+3skLt5PV8v3nQS7lBqLBtVE8hdJFv4cOMzYnA12U13+D8RQFQv8cM3bd/fDZ uB0ti04gdEFn3DE+g3zEVVb+hTHtegrOmvTQMdtK6eVTtBTguoIv4u07z/PqnuiD7zVO hcL5AGsOEfKgogcRO6EGxJss6CCtzd2crTh5tWth1oLGoeyAsiPzc4hfpc/DcxfFT4rG PJDRVzrtuCj8FBbx+eV/a0Ldgl8Zkh2+PeJEvTDVVkxNBFsztpLXmhaEFAql386Y65BY BF7A== X-Gm-Message-State: AOAM530dP0kAMKtqMsFzCoKa7IhdqPciyq0JHmvnNFILQIdDihiOVRQ6 UhzrKVYqx1zQndW5fE068AzOgx58Um72Vg== X-Received: by 2002:a17:90a:9292:: with SMTP id n18mr37531807pjo.120.1630304709121; Sun, 29 Aug 2021 23:25:09 -0700 (PDT) Received: from localhost.localdomain (174-21-72-39.tukw.qwest.net. [174.21.72.39]) by smtp.gmail.com with ESMTPSA id b12sm13942084pff.63.2021.08.29.23.25.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 23:25:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 25/48] tcg/optimize: Split out fold_deposit Date: Sun, 29 Aug 2021 23:24:28 -0700 Message-Id: <20210830062451.639572-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830062451.639572-1-richard.henderson@linaro.org> References: <20210830062451.639572-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/optimize.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index c3c66a949e..74c307951d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -880,6 +880,18 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) return fold_const1(ctx, op); } +static bool fold_deposit(OptContext *ctx, TCGOp *op) +{ + if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { + uint64_t t1 = arg_info(op->args[1])->val; + uint64_t t2 = arg_info(op->args[2])->val; + + t1 = deposit64(t1, op->args[3], op->args[4], t2); + return tcg_opt_gen_movi(ctx, op, op->args[0], t1); + } + return false; +} + static bool fold_eqv(OptContext *ctx, TCGOp *op) { return fold_const2(ctx, op); @@ -1728,16 +1740,6 @@ void tcg_optimize(TCGContext *s) } break; - CASE_OP_32_64(deposit): - if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { - tmp = deposit64(arg_info(op->args[1])->val, - op->args[3], op->args[4], - arg_info(op->args[2])->val); - tcg_opt_gen_movi(&ctx, op, op->args[0], tmp); - continue; - } - break; - default: break; @@ -1765,6 +1767,9 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(ctpop): done = fold_ctpop(&ctx, op); break; + CASE_OP_32_64(deposit): + done = fold_deposit(&ctx, op); + break; CASE_OP_32_64(div): CASE_OP_32_64(divu): done = fold_const2(&ctx, op);