From nobody Sat May 30 17:46:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1780086715; cv=none; d=zohomail.com; s=zohoarc; b=XXeJrzb5PHaJe8AHZvJUVEaZKvqCPn+fdhpNgXO34/ijNg7wvFtbt0Parj/8ZWGUyxCrOXQvn2/ZE8JzAa48R9VVndh3V9jq/z/i4Cdrh6HtBz3jqVw7aR7O5mfEBMATMb31DSdXHTv6ACTfBkBs8C5NXwWD+U9xmc9VY8upKiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780086715; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+vv7aEndI0iV1vKeBeel9GNX8MitI4GAwLM1EzXkEww=; b=bk5nb4rqKTmGyHiL+KEQ5VMPLWjCYXtJ+bgeciTWyyKZphh+FQapHo+wZxsBFu98W3Rg2m8rhzjVNtkobciOQDHawoq8DvOpgQD2SoS0G+Vzp21Etvlujznz5z9L1OjK6PPAw9yOuS2ADBOBeSXcpjQ67xpW4AukV5tOySCxZN4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780086715374610.3583665233074; Fri, 29 May 2026 13:31:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wT3rK-0005bm-D4; Fri, 29 May 2026 16:31:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wT3rH-0005bI-Fl for qemu-devel@nongnu.org; Fri, 29 May 2026 16:31:07 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wT3rF-0007g9-JU for qemu-devel@nongnu.org; Fri, 29 May 2026 16:31:07 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-c8095d7d75bso5864188a12.1 for ; Fri, 29 May 2026 13:31:05 -0700 (PDT) Received: from stoup.. ([71.212.142.33]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84214b02365sm2720237b3a.8.2026.05.29.13.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 13:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780086664; x=1780691464; 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=+vv7aEndI0iV1vKeBeel9GNX8MitI4GAwLM1EzXkEww=; b=QNmpP8W8sZaa2WOnwyXdeSsUfGwRh33wjcWZugQPUbCJnGvR/lwnaHetHNSvE6OyVv KWpEspKRfdXFF9ub/Uxm5cwr53iSuV9ZX839ymOsm89Jn6tIw+Kf7a9dSzS1bLyXYEz1 LdkeaCQD9DIuRanwGte7hswO6UFQ5jG4jtkhsS90cQgBAbRM4gE7eUjVzStzaBW/23+N SU3PE1zOp5OlZzM1oNjeDSEtMXgGTouWsrD7EiWumVu8wsOX8VUUToYOhdYQ1XtaSnTp rfUk4sccyljM8t0oi0vjbhKNgCWvKydCC/2tAY2uvIewVQ46xk9vMfD5z8++0InMpYdN Z4aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780086664; x=1780691464; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+vv7aEndI0iV1vKeBeel9GNX8MitI4GAwLM1EzXkEww=; b=lpMOM8hhr8bkczG0Ux1k/THAMHosZFymHqII/vvh/yBFk1T4vgrhokP5zoL1J3hKOg 0T8tBvkdHZnbWZCUXtckPKbk8En3I9VTGv8Tf+Ag90+qJJZY6LEedbmf2wZ3tgJSFXeK K3kUr0OzDfwsaMrpbadw5bLWqCdK7m3Z8s5ZZCIAJwp1A820C+A6TM6wtu8594pNAQw6 0fc77QgfvbywhvuY9OkBBz/5cWsKtK4t9XB30v8HhTtINt/yY/9Odgu+qfCCTAYzehNy zPvtokT8ViFoLu0yv3dQWAbZw2kkdWcbwgLI4N85mTmaGN15MSR6iWkqXMKxxvcPuCaG 6m8g== X-Gm-Message-State: AOJu0YyiDgvjq0gKbTRzv9SDpuUHpcqymOXTYOT0PqPJsY8KzGKT7YaO C4yVj3V7S6BAw0SM5gEy8m6jzRzF7he7kWI4bU63NxJVpDzhyV3Mr2a0fnFan42xooB0nPgyhgv DvhUBHHU= X-Gm-Gg: Acq92OH/k1ei9noQ7MAMwM9N8fAWu1l5Kk+1PMnHMiTxoysTPF8jEl7VlJkSeN1KO9i 5rQau6L7mrWIMecKJaQnAAT/UcRsGQ0Net9gIs8/q5owCMr5acMQM4+XiHGu+sMuxvVyFlbh1fi /6jyUE11L3HyNfeLP9KnS0prfRsV4yCFFk3npB+UBJeXcYrCeTinx+cR+EbadjdOM0+RXppHTRK 130Dnnl6Aosc4RxsjlOvhnQcnB+SNkrH2GvCdkU1yCyLVhfVxcZLKodTo12ycLzRvPM0EApPgVb xM1GzRqJk5qpVOFrS0ukVIyUXidjwzrTlg4nkhZN2AFQmnYTmWSI9m9dQ9yLR+u0neEa3tveqjd c/pdT8ncesERFZbkjbHWF/nVmTQZzGv7GFOsF0PhvM/LxjBPQlCAUMaCHKyPwrMHJ7N4Ch7n4L6 TdAu5+24FvPqXRQYNPmVrsWSKCEgKlO59S/5SBDVc= X-Received: by 2002:a05:6a21:730b:b0:398:7eea:50a0 with SMTP id adf61e73a8af0-3b427c69149mr929775637.18.1780086663876; Fri, 29 May 2026 13:31:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 1/3] docs/devel/tcg-ops: Fix reStructuredText format Date: Fri, 29 May 2026 13:30:59 -0700 Message-ID: <20260529203101.290947-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260529203101.290947-1-richard.henderson@linaro.org> References: <20260529203101.290947-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1780086717470158500 From: Philippe Mathieu-Daud=C3=A9 In the standard reStructuredText inline markup, italic text is surrounded by one asterisk. Fix incomplete style from commits 5e97a28a8b9 ("tcg: convert tcg/README to rst") and 76f42780292 ("tcg: Add add/sub with carry opcodes and infrastructure"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20260519210019.11665-1-philmd@linaro.org> --- docs/devel/tcg-ops.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 56c0b0bd3d..92ef127c80 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -563,9 +563,9 @@ Load/Store =20 ld16u_i32/i64 *t0*, *t1*, *offset* =20 - ld32s_i64 t0, *t1*, *offset* + ld32s_i64 *t0*, *t1*, *offset* =20 - ld32u_i64 t0, *t1*, *offset* + ld32u_i64 *t0*, *t1*, *offset* =20 - | *t0* =3D read(*t1* + *offset*) | @@ -598,19 +598,19 @@ Multiword arithmetic support - | Compute *t0* =3D *t1* + *t2* and in addition output to the carry bit provided by the host architecture. =20 - * - addci *t0, *t1*, *t2* + * - addci *t0*, *t1*, *t2* =20 - | Compute *t0* =3D *t1* + *t2* + *C*, where *C* is the input carry bit provided by the host architecture. The output carry bit need not be computed. =20 - * - addcio *t0, *t1*, *t2* + * - addcio *t0*, *t1*, *t2* =20 - | Compute *t0* =3D *t1* + *t2* + *C*, where *C* is the input carry bit provided by the host architecture, and also compute the output carry bit. =20 - * - addc1o *t0, *t1*, *t2* + * - addc1o *t0*, *t1*, *t2* =20 - | Compute *t0* =3D *t1* + *t2* + 1, and in addition output to the carry bit provided by the host architecture. This is akin to @@ -630,19 +630,19 @@ Multiword arithmetic support identical to the borrow bit. Thus the addc\* and subb\* opcodes must not be mixed. =20 - * - subbi *t0, *t1*, *t2* + * - subbi *t0*, *t1*, *t2* =20 - | Compute *t0* =3D *t1* - *t2* - *B*, where *B* is the input borrow bit provided by the host architecture. The output borrow bit need not be computed. =20 - * - subbio *t0, *t1*, *t2* + * - subbio *t0*, *t1*, *t2* =20 - | Compute *t0* =3D *t1* - *t2* - *B*, where *B* is the input borrow bit provided by the host architecture, and also compute the output borrow bit. =20 - * - subb1o *t0, *t1*, *t2* + * - subb1o *t0*, *t1*, *t2* =20 - | Compute *t0* =3D *t1* - *t2* - 1, and in addition output to the borrow bit provided by the host architecture. This is akin to --=20 2.43.0 From nobody Sat May 30 17:46:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1780086714; cv=none; d=zohomail.com; s=zohoarc; b=lcGlJMuI754avf0pld2m9jgfoHAr9PcSb2zxQGJljIytA7jahNWExcH1WtPbrw/xsLy24hxO7VbSrMNsAJOoCJEuphvdagqcyVZ4Yv/thQhRqGuEZ9HOzfPYEIiTh6GqxnpQy8BwnbcODieCNkVl+TFsf6Y95L7LdkfqbB+Eb7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780086714; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iunL4KCalfZtawye7ZT9J8Pu4zGGcHn38w0XSr6WX4Q=; b=ccHCORJHLXJj0Sqj7MZMD3/rtqUiz3N5OvQh0rDTyLRhUWinJ83ETGJ7yi+7s5e07jTSF02+XV66lMBEPWhYoO1qQDlnYmNjG1+uovYA71qD5TKI0VKYCPJiTrr4peHYs6zMGHIZwsg5jpoNGgk42K6UArdobZnSheuPb/rlRhk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780086714632202.77827081421754; Fri, 29 May 2026 13:31:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wT3rL-0005cA-Mc; Fri, 29 May 2026 16:31:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wT3rI-0005bV-H0 for qemu-devel@nongnu.org; Fri, 29 May 2026 16:31:08 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wT3rG-0007gQ-QM for qemu-devel@nongnu.org; Fri, 29 May 2026 16:31:08 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-8353c9f24d2so7304476b3a.3 for ; Fri, 29 May 2026 13:31:06 -0700 (PDT) Received: from stoup.. ([71.212.142.33]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84214b02365sm2720237b3a.8.2026.05.29.13.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 13:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780086665; x=1780691465; 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=iunL4KCalfZtawye7ZT9J8Pu4zGGcHn38w0XSr6WX4Q=; b=o0zqmCdWNtQdbA6QHl/tZ/9WxNEtUlSHwWr+CZwRc93qvq2vBlVvcKVfMhfPH81t4G fF6xzG016ypgT6fNrA0t8oWDA2U/bO1QggYIHkVIqgBt979Bs4VAwuUK9i/u5GRI0Fw4 WBOOvhgx7olIxJErXgz5PBLpjRGuQ+g5hW8yOqrWjZDGIKJ8B3urEc5qB7S9d8YZI1JB z7gtM+FYpiwSvx/ucp/ivUuVIMsryAUBZv11pnrKOw9U/v3oBavEx9JvI9ywmgoSJzMl 0bpCuAac3AI+dTXV59CJw0KS+UuLQ96GyQdNo7PFGu0e5yLtPVtOXFzrVNPPzPQ3SV3z +jWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780086665; x=1780691465; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iunL4KCalfZtawye7ZT9J8Pu4zGGcHn38w0XSr6WX4Q=; b=Gph8Xe5OVKbY6wAaSvuQI1Q+2EPzaAAH5hqyQqv3HtET1g7N0hZATn6re+4JZv/Qu8 M7bksesrst64fMpdYrZg5qL3I7A4tvnWh8h2RIoWb5k0XFRkEgRKZafAmaeWsfEcWHZU n7z0lR08CEudR2p3uPSxbHT3fjaEvG3Y+cn0zd1F3RAD0gH6BHUbeW7nnCA6QFPKnxJT 2uHO69u2BmnZ223DlVbuGRp3ruzCz64RqXL8xZEg/DSJCi5EjyS/XMSylcbd3oQ7pwv6 8jZcwMZ3H2O7f9TsIaD+Y12nSPDTmyJTP0BeCm0g1EFlGu8qkhvrD8dlKFx07nkTd04F wiYg== X-Gm-Message-State: AOJu0YwsOvuaPw3+QdIVdorvAwelSfoJb2NNQhPovj3FKRbSFNmZlQzs byFXJZwy+GbG7FjzPv6t5pdFfa4E/4NYo72pmtluIZrZKDeI5GPmjcfJoiWYYH+vBMxGSL4fTc/ kj0vm3Y8= X-Gm-Gg: Acq92OHUjS2Ad2USiWMo7SVp7Vn63CcB+XX/DcUBdhBYUhs4C6zdHZ/N7W0s/3QpCll +TxwyBGxs9MRE8G0kqZwuMHmkO43PLGOTqEUmMFSyIM888qkV7ofEtxNSC446itabvGtW0BAbIy /TAooYc47Q90vYAqY8AnGxCiXHMSTldOuDEeyRWi/JiGq/K+w8tnOv5JMorHrNV8oXDb1Xv7Y+d 4eK9bbnMMz2QaI6XypiN2g9VJ2DCfUc4Vdrym6VVsZksyQo1S98AIrKgZk+TzMQw5+ECzkJIRcl Q38vlCr8fRWHxUJktr5NxzkrgVw+0Z2wgC+1iJJTntutMG+QUz0z6mWcCzLzz8j/RvPcdmVk7xu fkKRQgkPwid65hcCmnqbWHw9SmwOzpwhWgtMtchO2gOA5M7AaHu949KcXXJb6eemJ0CXr8mmhzP 5Pf8Wul3NeEFpCjgVxReLHFLmWBzZJGiFABK2gEcI= X-Received: by 2002:a05:6a00:21cf:b0:841:e7f6:3e93 with SMTP id d2e1a72fcca58-84225347d97mr924767b3a.1.1780086664806; Fri, 29 May 2026 13:31:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 2/3] tcg: Massage fold_multiply2() Date: Fri, 29 May 2026 13:31:00 -0700 Message-ID: <20260529203101.290947-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260529203101.290947-1-richard.henderson@linaro.org> References: <20260529203101.290947-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1780086716760154100 In order to ease next commit review, check arg2 constness in the inner loop. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-ID: <20260520125139.13352-2-philmd@linaro.org> --- tcg/optimize.c | 68 +++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index b1abec69a5..ef5eb2cf17 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2173,45 +2173,45 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *= op) { swap_commutative(op->args[0], &op->args[2], &op->args[3]); =20 - if (arg_is_const(op->args[2]) && arg_is_const(op->args[3])) { - uint64_t a =3D arg_const_val(op->args[2]); + if (arg_is_const(op->args[3])) { uint64_t b =3D arg_const_val(op->args[3]); - uint64_t h, l; - TCGArg rl, rh; + TCGArg rl =3D op->args[0]; + TCGArg rh =3D op->args[1]; TCGOp *op2; =20 - switch (op->opc) { - case INDEX_op_mulu2: - if (ctx->type =3D=3D TCG_TYPE_I32) { - l =3D (uint64_t)(uint32_t)a * (uint32_t)b; - h =3D (int32_t)(l >> 32); - l =3D (int32_t)l; - } else { - mulu64(&l, &h, a, b); + if (arg_is_const(op->args[2])) { + uint64_t a =3D arg_const_val(op->args[2]); + uint64_t h, l; + + switch (op->opc) { + case INDEX_op_mulu2: + if (ctx->type =3D=3D TCG_TYPE_I32) { + l =3D (uint64_t)(uint32_t)a * (uint32_t)b; + h =3D (int32_t)(l >> 32); + l =3D (int32_t)l; + } else { + mulu64(&l, &h, a, b); + } + break; + case INDEX_op_muls2: + if (ctx->type =3D=3D TCG_TYPE_I32) { + l =3D (int64_t)(int32_t)a * (int32_t)b; + h =3D l >> 32; + l =3D (int32_t)l; + } else { + muls64(&l, &h, a, b); + } + break; + default: + g_assert_not_reached(); } - break; - case INDEX_op_muls2: - if (ctx->type =3D=3D TCG_TYPE_I32) { - l =3D (int64_t)(int32_t)a * (int32_t)b; - h =3D l >> 32; - l =3D (int32_t)l; - } else { - muls64(&l, &h, a, b); - } - break; - default: - g_assert_not_reached(); + + /* The proper opcode is supplied by tcg_opt_gen_mov. */ + op2 =3D opt_insert_before(ctx, op, 0, 2); + tcg_opt_gen_movi(ctx, op, rl, l); + tcg_opt_gen_movi(ctx, op2, rh, h); + return true; } - - rl =3D op->args[0]; - rh =3D op->args[1]; - - /* The proper opcode is supplied by tcg_opt_gen_mov. */ - op2 =3D opt_insert_before(ctx, op, 0, 2); - - tcg_opt_gen_movi(ctx, op, rl, l); - tcg_opt_gen_movi(ctx, op2, rh, h); - return true; } return finish_folding(ctx, op); } --=20 2.43.0 From nobody Sat May 30 17:46:17 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1780086739; cv=none; d=zohomail.com; s=zohoarc; b=UFHtY7J8T+Jxcggo/SXXW9hupUHyBRelx1MNBc7QUG1BVpa18b9oZjZVnwuQ2AHvFkv0U+kv9mqiDXaRl1cgdBW004bL7J+NAcKhc/PVowW7XEahJYQjBaLC+/AX5TCqjbO/05NWyhAcVQhWEeW+Zii1kg7q6MDRSTL8Q7Mf0iU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780086739; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5Ty6h0d35x4g+W1Vc5lJ0weoc9xaWAtRx0HaQeYSiqo=; b=Jvmriz812sdDYPo2xOr9tnxulkpLLuvRLlUDV55ZfF7qAy17n74gGmbgkYhlQbwlEbWXI81hqVMiyUQEcX2x27OyVHM0qlN5sd63Doe95np7EbH9IHmbp/daW3AH8qUkRVqbHNbWQ+xFjl0u66OCpTyD0/xmbsRtOVT7qDYFVmc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780086739449843.3783582356089; Fri, 29 May 2026 13:32:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wT3rM-0005ch-RM; Fri, 29 May 2026 16:31:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wT3rJ-0005bd-3H for qemu-devel@nongnu.org; Fri, 29 May 2026 16:31:09 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wT3rH-0007gv-FU for qemu-devel@nongnu.org; Fri, 29 May 2026 16:31:08 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-842273a2c4dso124745b3a.3 for ; Fri, 29 May 2026 13:31:06 -0700 (PDT) Received: from stoup.. ([71.212.142.33]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84214b02365sm2720237b3a.8.2026.05.29.13.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 13:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780086666; x=1780691466; 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=5Ty6h0d35x4g+W1Vc5lJ0weoc9xaWAtRx0HaQeYSiqo=; b=aHnMzJNrFenzhFsQW9IqT+68XV1dQOtr4n71ZUaMzQxZqtna+UIUvY19vF9REdpfu2 0q3g6AwhgbvYCbn/LZkWFkZQJbio0hLwWP7wGd9l8chPtfmhkXfKhP4iKrhBxbi8BVxT NAbxToEGUWF5DUp8ENjoZthgZygUZv3dr6ZdgubNdcTsV2QDZ2IPfFWcv/Q3riGHGGoh cBdsJ+8x+8fu6E4nuxwKy6hgUX2MpHEUq8UZhNx/eOASfaAxQW7l8w7JFuObxBP9WjQl 4jnPSP78XW+DqM59lId9643FXWBDF8apdial4ppqvklNU8QzRrFIsw9SP5is1iSyOEjB GiVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780086666; x=1780691466; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5Ty6h0d35x4g+W1Vc5lJ0weoc9xaWAtRx0HaQeYSiqo=; b=R7KMnsk1XVehSDVIvI0HJgpm8BRN/UkzHjoDa+K732TILhBkB76zEp+FxWw5VNxWUh rvWPsBP+w2+N6qcQiR1zYuJ3U/uWEDgqXIJfOSKA+vrxXc82+sDetdwrdmmxejqUpybk d7c2zmCTtgD8wC2EMsSVSKhUrgj4SffH95TWvfwxaGBKG/OxKKlrg8ekPxV3kkqRBIbd i2p5n6J2sqjQLu14/pxT8vpQex6wyjtnkDMOXPc0C5V/DStt0k/Z32hbFQcSqT+apGG2 42Dn1Ns+77AWdo2SqR8jsQf/qT6goWqghVOhFKahen45YqjrdkgzRiDz8I6hTI5uFxFV sdqw== X-Gm-Message-State: AOJu0YwRD7X0vrUXgPwswtvftRS5WnPd8fnavttN8hzRpvKur9vlZZ7l AVoNC8CkVa8PS5UBkazBYnPrxLMDpv+OzjdoSruXUxzEkiK3xChkweRguAqd5LFbXby1/GwJc4f RMYB+4y8= X-Gm-Gg: Acq92OFf1DL6h2ytrHUh23lC3Z2rwehl5XZ8CLtKMmRQKTl1AEE9yPUduDoVoWp57xD A6Q9CgNv/2/8ySIpC+u0sOxa9FterScvQovtoZ8aZdBxxq1pyNBF6+laumRmJwTWKkVDN1eloeM +rZDxXH0Jqj8LExRqWCpHDFxxN39q4DqAG8xecEl12kdPuuselrsGfJ6kNYlYWR/F00mQTMrxi6 BIUR6W0E1ryLNJ7DK8f35Cz/op+swsvDlRApvOfCXQaqxs58jQQj7w/32M2qg/2aW6gmnRl09Ik W6IJ+R7zRF1F8Vh0ClMUG2nPO+tIbBhZxQDs7mAPD0tuqHZNkM8iIY4coZK/e8ke08Rm6HIojg4 YHc5hgEx3nnnMuCczNk1e207giKTul4uAL4LQXbSF8Gd3mkzfpiPcTSzMfSj6MT6y0PcENIL1zb 2G2G2caul3isSea/NRdO1deCUDLxoHgy6lQoO3o4Q= X-Received: by 2002:a05:6a00:32cb:b0:83e:c8f8:cec7 with SMTP id d2e1a72fcca58-84225492890mr1101900b3a.35.1780086665755; Fri, 29 May 2026 13:31:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: James Hilliard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 3/3] tcg: Optimize INDEX_op_mul[us]2 for 0 and 1 Date: Fri, 29 May 2026 13:31:01 -0700 Message-ID: <20260529203101.290947-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260529203101.290947-1-richard.henderson@linaro.org> References: <20260529203101.290947-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1780086741696158500 Zero operands produce a zero high and low product. One operands produce a copy of the other operand and a zero or sign extension in the high half. Fold those cases during TCG optimization so wide-multiply idioms used by target translators can collapse before code generation. Signed-off-by: James Hilliard Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-ID: <20260520125139.13352-3-philmd@linaro.org> --- tcg/optimize.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index ef5eb2cf17..fcdef25bee 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2212,6 +2212,34 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *o= p) tcg_opt_gen_movi(ctx, op2, rh, h); return true; } + + if (b =3D=3D 0) { + op2 =3D opt_insert_before(ctx, op, 0, 2); + tcg_opt_gen_movi(ctx, op2, rl, 0); + tcg_opt_gen_movi(ctx, op, rh, 0); + return true; + } + if (b =3D=3D 1) { + op2 =3D opt_insert_before(ctx, op, 0, 2); + tcg_opt_gen_mov(ctx, op2, rl, op->args[2]); + + switch (op->opc) { + case INDEX_op_mulu2: + tcg_opt_gen_movi(ctx, op, rh, 0); + break; + case INDEX_op_muls2: + op->opc =3D INDEX_op_sar; + op->args[0] =3D rh; + op->args[1] =3D rl; + op->args[2] =3D + arg_new_constant(ctx, tcg_type_size(ctx->type) * 8 - 1= ); + break; + default: + g_assert_not_reached(); + } + + return true; + } } return finish_folding(ctx, op); } --=20 2.43.0