From patchwork Tue Mar 12 14:38:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 779755 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2057469wrt; Tue, 12 Mar 2024 07:43:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUQwou0PfuqehvoNz9Tb5mnQqG9iVnEdK7ijLogGWHJB+vcGY0krzgawnPbvhKTlvmadKHkSMOPyvHVJ75jrE8P X-Google-Smtp-Source: AGHT+IFISzsmRvzgkr3JIN1wu2euxHlmKNhfTDS1ViGer/54qkJuHygCGyfnZPbCbOLDWY7gpQC4 X-Received: by 2002:a05:6870:b14a:b0:221:6840:d131 with SMTP id a10-20020a056870b14a00b002216840d131mr1951498oal.58.1710254611315; Tue, 12 Mar 2024 07:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710254611; cv=none; d=google.com; s=arc-20160816; b=pDYCpCOB6PuHCe+Yo5DxtdJBXf/iI9hAht6FM4P7693eq5Jf97ihC1AP1nNGGzcZeI hVwBWbfl1rtV99LBuJN1UBtGlZfmse/av+TIRVYCdR2kf9+0k3AXaKYfnU3oA0/lf96k 6JRXQLz/B0rW4o5S/fdiyoSXyPScLYkqpysxOvfpGsRGHY4hy5YaXJ6FzeXPqpAIdsrN RnG/h96tarKeFfCocHV5OaeesGhJXuKpDgwfcEOfoDtvKqqQQ3aJyS7iReXB9DYNphPK +EloxWshcULMfse53Um0kUCUyG27yLfyUmoUAm8GqnkJGZxx9Ikv4QYN+hPrSRcK8wkc DtOw== 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=RnJQyEnXrtZcjBCHyJq+5yv9WO+0xDyYir75PeP3MhY=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=wIbeMRkUc7qUn9Z4hb8jmA90uMySZpNE5TjSVGz6AbLdyTfnNMfrajMLtA9WR6il/8 7fu3ekPryhE9siNMWIkGY7DrxudmBVPYPtE53p/U9dJKriX4wi3r93sKoF2zJxqIePBt LYjbq1heTjhaUnc7/C+kJMknIZJV3fx/MgZmO/c1ItOmTQAYivL1369lnzqBUp7uKbuz jwmPCEIxpaLHNqsiEr1LVzUaMyreUILIvjEmjz5eHLV7QfGMH8AfzEEBEz1n8dNSDK++ tmi6sheuk0IoCAPGzo/oOzA+KrPo+FklMq8uI6dIlNLawNA5ApmCr9qOV7cdmViam/32 zUqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kATDgmQm; 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 qs15-20020a05620a394f00b007882aa0b7f4si8168511qkn.157.2024.03.12.07.43.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2024 07:43:31 -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=kATDgmQm; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rk3Hn-0003ZT-GN; Tue, 12 Mar 2024 10:39:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk3HY-0003Wr-2P for qemu-devel@nongnu.org; Tue, 12 Mar 2024 10:39:08 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rk3HE-0007ik-Hs for qemu-devel@nongnu.org; Tue, 12 Mar 2024 10:39:02 -0400 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-29bb3d62949so2882512a91.1 for ; Tue, 12 Mar 2024 07:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710254326; x=1710859126; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=RnJQyEnXrtZcjBCHyJq+5yv9WO+0xDyYir75PeP3MhY=; b=kATDgmQmhJ+Ob75w7trJZRHt1FX2uoW08aQ7rPUJuhsowzunuksXXI8COqL7KFa5q9 BBMCppjRk6pCRdeycPIBdm21hLl1qCS0rRi1vF8Gw1nVIJJjl6OhqjTsdqtgvBrZFXRx xcKyHq0BsU7BA7Qzie4T3H4VImzr6y0DboHps57edol7okikFC1DTNp7scKYLrE5XZFv ilzWIN84J1ZpBW3gaMyJItg8xUP2WMv+HbLeeUVkoSJp1tpzG5Feel3NfQSGR1oGMmYB oTIwB2WIiSnV4wWF1iGw3ynrHgC0WK/4+NR8EK2OcHIMj56kkgDbtSPbUcTrSdkvyJON 4p3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710254326; x=1710859126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RnJQyEnXrtZcjBCHyJq+5yv9WO+0xDyYir75PeP3MhY=; b=bnvxQpTdBAjd1Fb+epOctBSGskOSC1rzgzToYAsq+mpNRuShxeunHNtR5qRSWEz0oY 3cxLUbi1L4khgdAKnG8Qypg09jJPMkQTq3nb5qE0vUnsavdm/WxB0MlzK3SbBDt61hvq 83IL/Dcq1DXQnqpfa4lMTT5/Rdlvqf32oPuro/F8WpTOe8wrgb3h/4+a2oHOYmRJyId7 HgWUeB30+HODGzwn1+zBMbqUo0GqvAeNHZFpGli8k218ml1mq0btBmhz029qo4E2HZig b7et40TY+PFTNlv9owvOw4qHJGmU1eNj41xM8pJbbR5pKa3Fl4P4AY4iHyFUujpunJG2 aQBw== X-Gm-Message-State: AOJu0YwAKCg0Xcz3NlzRo/iPTY7BoWstzpkPRFX/hkCEFIP8MnyeX7EI NhxiaXgmIoMJ3JPIPNlHcdKSZDDjTSVuyvA2PY/PLSSw4DtERjaHzwCA+sEXReDoqtO/o1blrCW s X-Received: by 2002:a17:90a:fb57:b0:29b:af8d:3264 with SMTP id iq23-20020a17090afb5700b0029baf8d3264mr1933099pjb.37.1710254326258; Tue, 12 Mar 2024 07:38:46 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id jx15-20020a17090b46cf00b0029baa0b1a6csm7492214pjb.24.2024.03.12.07.38.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:38:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 02/15] tcg/optimize: Fold orc with immediate to or Date: Tue, 12 Mar 2024 04:38:26 -1000 Message-Id: <20240312143839.136408-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240312143839.136408-1-richard.henderson@linaro.org> References: <20240312143839.136408-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2ec52df368..5729433548 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2065,6 +2065,15 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return true; } + /* Fold orc r,x,i to or r,x,~i. */ + if (arg_is_const(op->args[2])) { + uint64_t val = ~arg_info(op->args[2])->val; + + op->opc = (ctx->type == TCG_TYPE_I32 + ? INDEX_op_or_i32 : INDEX_op_or_i64); + op->args[2] = arg_new_constant(ctx, val); + } + ctx->s_mask = arg_info(op->args[1])->s_mask & arg_info(op->args[2])->s_mask; return false;