Message ID | 20250107080112.1175095-63-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp102635wra; Tue, 7 Jan 2025 00:16:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVaulWKSY9HDm63MopKcLh8PoL2vGvITFuT2pcoY727eTO/PzecBoSbg7xsMuApQEugUZ6CyQ==@linaro.org X-Google-Smtp-Source: AGHT+IHJuMfs1/CWbnPmVg5LEDX4/yD64+4uTSh88exaJPHT54jmcD1+nSdi2olhs4oByiKMC+vF X-Received: by 2002:a05:622a:52:b0:466:a20c:a67a with SMTP id d75a77b69052e-46a4a970419mr939228471cf.38.1736237773012; Tue, 07 Jan 2025 00:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736237773; cv=none; d=google.com; s=arc-20240605; b=BNku+wGrMOED6CydB5BUTL0tx0NmBd7B6noPhwlR1hR3tdiwLpt3DXpZ+QQGPAAeq6 rC7yTaKmEkXXIOACGyEpIZhxQHgNyvdpJ6wJGJ+9LijDiAbNcLGPp0CD/QjZeo8nHQdm WmwLV9TjeZazXUWzvclKBO2HHmZAqfHh2pztmQf4Dr7kKwvE99jCWspCbI9EauQNAmcQ 8t42QvWrXvRflJQ6QSXTGlLidqOXMV4YcY8advqhZ+VppaYbRpv5v4fk0DCLsnskL5HE MOdLs9X4AY5gyr31QwYw2qrSpp8bM1Cy1032uXU+AUsF0edG0rbOusOULfCb7F4rT/mO ZANQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:cc:to :from:dkim-signature; bh=C0KgZymbeIKjXHvxpXV9E7eb7+jFfsh6E+cmm227Et0=; fh=1AaLZNOiARaO2MErHmdWiM20H44tzxxDYMw0tHmbGN4=; b=LeUqfJ4Lbx7lXGMKCEr6z7+b6LdNw2d0wythCUgVgMEOEHYuIuW3lcjnWO+5w3d5J6 10p/vOW4grjBXKqtpbSRNNVlQbpN+eAgB/YVYgsPD7KqZIfqPkSi+PbZ6izkH1Kyd+jL dxdU9pDUDc6CnRAsg/SginhaJyF1EEkP9a8xOGzMFDcW3B2ikBp4N5sb2GJYi5a3tl69 QvPhlVXvP/5Zgtb8n7Xz+iT2e5mzD/80hwWfDuTfef+AHLPszBVN5SFs5TKvNGdcBoro hOmF7j5Nal0n3uexJMhGpFAYqTyc9ms8+SjolFiPSxBJKruo7opE/cU1bpgnf3sSgpfQ O3Zw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jUGyL2NY; 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; dara=neutral header.i=@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 d75a77b69052e-46a3ebc6140si425930321cf.492.2025.01.07.00.16.12 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jan 2025 00:16:12 -0800 (PST) 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=jUGyL2NY; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1tV4b7-0002HC-F4; Tue, 07 Jan 2025 03:05:58 -0500 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 <richard.henderson@linaro.org>) id 1tV4af-0000fo-5a for qemu-devel@nongnu.org; Tue, 07 Jan 2025 03:05:31 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) 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 1tV4aY-0003Qa-9E for qemu-devel@nongnu.org; Tue, 07 Jan 2025 03:05:28 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2156e078563so192293715ad.2 for <qemu-devel@nongnu.org>; Tue, 07 Jan 2025 00:05:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736237120; x=1736841920; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C0KgZymbeIKjXHvxpXV9E7eb7+jFfsh6E+cmm227Et0=; b=jUGyL2NYRcIEPsXKHpKhD4Wq11sqbFLAoeEY6gEb5N4a8Ii6OolVrsLVAi+QZ5ksOT rxN9ZR9JzGrQpkt8JjRKEDYjdIaXEOnj1xgesVBYnuNZgEJbDsqJ+6Lhj3vN3U6Jh9G5 GuU46lUTG7+pd64WjaBGY6lpcfW71A7Mb8OyJHYWL/tRGtyV/FGXEAQbJ2152JJGy55V Qk76gZ22gi5CRFKR89N195sL/JDttDNlavcKtJydCrjD2BSE7jsg+hc9rS/NRKYN0WdX zLZpYRsFlEFnQntWv7dPQADp6ATS6Mr1xwyMIDZ29zWR0snJtuBxrhJBf50bayh3/k8O NrZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736237120; x=1736841920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C0KgZymbeIKjXHvxpXV9E7eb7+jFfsh6E+cmm227Et0=; b=drbE3JlQE50otUC3liYz7Guu/aP+j/cjGR0GCIeQATBU74fhg/EjFd0BHdxIYwIQ7d YMQpxAw4T7fKKt/7c4jLYClk+yPpGyUZToBUzwK6wVBchJL3BAKWZxRsjmRwWFdoRy+Z H5gYZXh7MPpIAtXqe8YJiXdYGkodSrEnJa7RjVMyMOO6hQ/EZNMjZsw6eHa11C6Mqwv4 5tYZ3f1KLSooGKGAlSRJxcSHapQG97RCszK+S4mzifXLu9skNCMbdKSZ5GX0+foRmQzF DUTYDreLPN1UOsnv5mQIbIwN3vrzCOGsVFs/Sdmw3hvbKN2ATWSPKXUQcS3kiis7G8FN GIGw== X-Gm-Message-State: AOJu0YxB3BwOPiTcEQ6LWrlRq+0r4EMnfeMby7JHDGpJ7ArDcWfPs83b TYuaWxXl0JWPLJjMhQYVIj4/hAsqtTh6PsuG0dmOgkxC2t6KmQEKDREQWeCM7CoB48YM+sffVcS z X-Gm-Gg: ASbGncvXLrV/K0Q2TjN3ecVCUHbjTMinaRMUYhGLzg5zjwzF7gK5seqX7PZveBdjL5v 2DlUD5ILTVbvjFj4V4b0wHI0qSOMQ8chO1EMi0dsmQW3QyUBTrqyvYpPPJVfv078vBHJc1N3zVQ ToGeQyiq/7Ftn5RWvyZ4wOT2m2sXBB/KyP1NG3DU0xwjvvFKb1QwdFcNME1df1AJcXVsJjshksa 5HU4Po/nfZvieCsGMyDw0+AuTAaCa3Sz6ipYzYV4ycJHAqJymDJ/JW/nkielQYZBYNkHaFSsdNt u/aCd8XVsL/Z12TjvA== X-Received: by 2002:a05:6a00:6c89:b0:725:ef4b:de21 with SMTP id d2e1a72fcca58-72abdeaa169mr88650701b3a.20.1736237120227; Tue, 07 Jan 2025 00:05:20 -0800 (PST) Received: from stoup.. (76-14-228-138.or.wavecable.com. [76.14.228.138]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad84eb5dsm32577852b3a.86.2025.01.07.00.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 00:05:19 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Cc: philmd@linaro.org, pierrick.bouvier@linaro.org Subject: [PATCH v2 62/81] tcg/optimize: Fold orc with immediate to or Date: Tue, 7 Jan 2025 00:00:53 -0800 Message-ID: <20250107080112.1175095-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250107080112.1175095-1-richard.henderson@linaro.org> References: <20250107080112.1175095-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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.29 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> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
tcg: Merge *_i32 and *_i64 opcodes
|
expand
|
diff --git a/tcg/optimize.c b/tcg/optimize.c index b84bdb989e..b0e7457eb0 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2128,6 +2128,7 @@ static bool fold_or(OptContext *ctx, TCGOp *op) static bool fold_orc(OptContext *ctx, TCGOp *op) { uint64_t s_mask; + TempOptInfo *t1, *t2; if (fold_const2(ctx, op) || fold_xx_to_i(ctx, op, -1) || @@ -2136,8 +2137,28 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return true; } - s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; + t2 = arg_info(op->args[2]); + if (ti_is_const(t2)) { + /* Fold orc r,x,i to or r,x,~i. */ + switch (ctx->type) { + case TCG_TYPE_I32: + case TCG_TYPE_I64: + op->opc = INDEX_op_or; + break; + case TCG_TYPE_V64: + case TCG_TYPE_V128: + case TCG_TYPE_V256: + op->opc = INDEX_op_or_vec; + break; + default: + g_assert_not_reached(); + } + op->args[2] = arg_new_constant(ctx, ~ti_const_val(t2)); + return fold_or(ctx, op); + } + + t1 = arg_info(op->args[1]); + s_mask = t1->s_mask & t2->s_mask; return fold_masks_s(ctx, op, s_mask); }
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- tcg/optimize.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)