From patchwork Tue Dec 24 20:04:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853207 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081133wrq; Tue, 24 Dec 2024 12:06:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXL+yWQURhfirrdeAVc96uY+4XOF8lWyAuEMwEXb20ILZGWbWeJj4j2TKeN2+51k97eih40vg==@linaro.org X-Google-Smtp-Source: AGHT+IEfO3zVl/cy42HC3tKUeoD5QPhgoV1AYLW5s5TSNira3AKIPwguUY1Vq+h4e+9i/WpoRhpc X-Received: by 2002:a05:620a:1a0b:b0:7b6:da92:fcdd with SMTP id af79cd13be357-7b9ba72a52fmr2681953985a.15.1735070780704; Tue, 24 Dec 2024 12:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070780; cv=none; d=google.com; s=arc-20240605; b=k/TOzNy9V/6uJ4mIB5ciJ4xjazvUjMrOVYi6qUCpI0YfJ6dR46DV3voWibCfqDbuB8 lgvafx6XKmGX8jmf6KG2i65oKu/qrUySoi3vfyXKvpTcKOkyUOim6ej4Jly7JUa0+5OV /gcPaTPrUHzwJSJB8hYy9Cj21hlcEBv2cl2WxUt1IAdegC9NwmKGLsw/XmbfrvQ7wDa5 24EoDGxLD6kiIYM7IgPd9dFTzQGF76ORierOlnvPwXlntQXUYQ0rH0uw3lSnR9UBBYRo ruklmH2AzZ3mAORRzhjGvCqq27l5+Pa3eYbVkSZrE2b2g+PBWPbNRvR+ghVk3nYrL3UL ZcmQ== 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=+v7eNfvrqQSZE5BwDanDqUsLKy4GSW+67YoWGKlQXJ4=; fh=s6Dua0hNp8Zj7t921nPEi60F8M5fHTElXx6xkuMzL+s=; b=eDqJ3PypQUhpdV6lSgy/p6q1UNnRlR8gpOpg/jy34t+UPFXl1AZYPtDoANnsrkppQZ HWqg4DzXXkjyTvxuk880ZU2bVgZOUXqgYbvoC8VMKUvWjY5AVyc1Ad3ToyH4Y49Gu+Ui sF7B0VwirFl/S6A6VfQrP4uA1C8fKLQ/yrOWYfzar+w5luAwDpa9TmXv1CMc5b5ooFfp 2W8wsaDovnd/s+PcAfBzmFReVQSz5htfhhT4KIDdu3egWr9h4crOmXaFffVBKDAPyH6K f3ZLHSbxzqD6q1Sy5E2fQ2uPy2GSQyrhUrvUrFJtIKRYcOCKPsOgkn3U+VUBC72H0FeR cvzA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NZ1TpG3X; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ab6fesi1382623385a.10.2024.12.24.12.06.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:20 -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=NZ1TpG3X; 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 ) id 1tQB9o-0002kP-8p; Tue, 24 Dec 2024 15:05:32 -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 ) id 1tQB9i-0002jE-Fr for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:26 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9g-0002Ud-Sh for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:26 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2166360285dso57544885ad.1 for ; Tue, 24 Dec 2024 12:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070723; x=1735675523; 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=+v7eNfvrqQSZE5BwDanDqUsLKy4GSW+67YoWGKlQXJ4=; b=NZ1TpG3XefX4+yahtm2rKAHsAgCFQQfi3/2BYhmdRSZuG3Xp8cIualiwE2pyABvbvg LezyPHKOyczli27mnNGmLaYKsOpGpPG1+O9LWJpU4yo4cqtnj1To1fodCWrS+8ahj8FF WpQPHp/9fVthfu/dSjVNjy6Qqgftq+4uNq21qyyH+VG1ttzl3H0chq8VfpND3MBU8OFH lkO2E/7sn+vXmUI1nKn5QBuvFwzn2+anCktpYkBCLPW8rK9y9cwcnn7lnR+LTfZLCmd3 43jOyPVEi9z5dqlmESVN9qDGApwt1Tlgx/rptIamBLHytigpOahyB0m0nvyXqbu0opJp XhRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070723; x=1735675523; 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=+v7eNfvrqQSZE5BwDanDqUsLKy4GSW+67YoWGKlQXJ4=; b=Cpcr5ctZGdZ7bPO8BrYQFHIUQwmJ34uwocNdFSX/ndPafC1903qnEjK3JHC2p47bEE C+Yzmu2V4DteAedBRZDkiujXb3t2GH2C+HPFeimNX9SeaCUWUcYx/4CCMn7c5DqEL6cc 4coFO/21xpjSzW2di1winO3Fazmaan7BU6sSyFFtk+XtvgSFzYXwJksZSoG4OUkcuf5f gZHk3SrtJrBiW20SPD0MRovMtpuwIlWLC5qvdJ8bT7Dm8tLJ4YyyP6Jh3N7arFavz28k yofQzx8R4n1XIPDPkykl2fZA2JtkaD2G0uGKB8PLrzRR1n9BjslSBOTWRSKWycAqcPD/ nXOQ== X-Gm-Message-State: AOJu0YztmSeIJL9dre06sLOfFURr+gl/7lxFAR1i4cQ+O6dJnYQRBiPn 1XHUitIfECWfg+pnbhgjv5KWzJ+DXxW605deLy8RhjiC/8Q4hbyVn3KzWoZjlVvcbgrSQyId3xz XF2w= X-Gm-Gg: ASbGncsh/8UM35HlcCN31bGB55WAdnUg5QVa0ykCFiHP0cOnKK2+3ivYE1DhLs/i36F +x3tBwPz1N2kUwDSrmD/LDKi3IB3k70M63rcC3BrQskOMryILwDnLEYqqt2FrnGuFSoZ98+sifW j80qr93cXbCBRrSxTYl6L34E2lV5Z2FgWDKELl9oGdj90brHpRq99zvLjr2H0SNF3GqvCDdPWkm Is62jMG7nblPbP6vF/q73lWjvfinrsK8dH0rtOzE7ukq3nzjMioZZvYiI9Tyfp6upPR36ANIejd JILZaGT1903nrBABNYwDoLOf9g== X-Received: by 2002:a05:6a20:841d:b0:1e1:b19a:fb58 with SMTP id adf61e73a8af0-1e5e0480dc7mr31260952637.13.1735070723567; Tue, 24 Dec 2024 12:05:23 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Paolo Bonzini Subject: [PULL 01/72] tests/tcg: Do not use inttypes.h in multiarch/system/memory.c Date: Tue, 24 Dec 2024 12:04:10 -0800 Message-ID: <20241224200521.310066-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 From: Ilya Leoshkevich make check-tcg fails on Fedora with the following error message: alpha-linux-gnu-gcc [...] qemu/tests/tcg/multiarch/system/memory.c -o memory [...] qemu/tests/tcg/multiarch/system/memory.c:17:10: fatal error: inttypes.h: No such file or directory 17 | #include | ^~~~~~~~~~~~ compilation terminated. The reason is that Fedora has cross-compilers, but no cross-glibc headers. Fix by hardcoding the format specifiers and dropping the include. An alternative fix would be to introduce a configure check for inttypes.h. But this would make it impossible to use Fedora cross-compilers for softmmu tests, which used to work so far. Fixes: ecbcc9ead2f8 ("tests/tcg: add a system test to check memory instrumentation") Signed-off-by: Ilya Leoshkevich Reviewed-by: Paolo Bonzini Message-ID: <20241010085906.226249-1-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/multiarch/system/memory.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c index 65a6038a24..7508f6b916 100644 --- a/tests/tcg/multiarch/system/memory.c +++ b/tests/tcg/multiarch/system/memory.c @@ -14,7 +14,6 @@ #include #include -#include #include #ifndef CHECK_UNALIGNED @@ -511,8 +510,8 @@ int main(void) int i; bool ok = true; - ml_printf("Test data start: 0x%"PRIxPTR"\n", &test_data[0]); - ml_printf("Test data end: 0x%"PRIxPTR"\n", &test_data[TEST_SIZE]); + ml_printf("Test data start: 0x%lx\n", (unsigned long)&test_data[0]); + ml_printf("Test data end: 0x%lx\n", (unsigned long)&test_data[TEST_SIZE]); /* Run through the unsigned tests first */ for (i = 0; i < ARRAY_SIZE(init_ufns) && ok; i++) { @@ -529,8 +528,8 @@ int main(void) ok = do_signed_reads(true); } - ml_printf("Test data read: %"PRId32"\n", test_read_count); - ml_printf("Test data write: %"PRId32"\n", test_write_count); + ml_printf("Test data read: %lu\n", (unsigned long)test_read_count); + ml_printf("Test data write: %lu\n", (unsigned long)test_write_count); ml_printf("Test complete: %s\n", ok ? "PASSED" : "FAILED"); return ok ? 0 : -1; } From patchwork Tue Dec 24 20:04:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853246 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082396wrq; Tue, 24 Dec 2024 12:10:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWqX3RQ4un7DQOxKkT5zQZbiizEbtGnCchLpiUFcRG0HLyxCyakCjBspVl7UcJ0GdJ3MJMtYg==@linaro.org X-Google-Smtp-Source: AGHT+IH/bVdXqlMPTLA1YM8Jf1Jh4TwZq/ODo3TQy/CEVN9ERPU4xaBHbuCFjRSRouJhgKrscECu X-Received: by 2002:a05:620a:40d2:b0:7b6:eed4:695c with SMTP id af79cd13be357-7b9ba79d2cdmr2554026585a.32.1735071009904; Tue, 24 Dec 2024 12:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071009; cv=none; d=google.com; s=arc-20240605; b=jmHZiPRM0ukgYsK/A5jANrHJBVl/timat5WoBXmfqVdS61JmXtGT7Yv6X4Lo2/Djmj UvJKsw6c71rX5bAX673TPbZsUTFxVFQ0QSve/qw13XpMC1FbprKDQbknj6r0/p1zTHVp 1/KtVUrvPXv2Gzs62zfcWzdrkUvFNmTeFhUZDcP4I1+E0uo2cXsjDpV7YLRZ2RyV5tPk IoOyHcFbC+whAOk/CVjEN+x4Yg418qQ4EGjs1kxPezq09wNiGHDdYN+laW6KSkVEdzrr nw8XDkPoVbnH58CO9ULRTaMfu1CRYvgEEH/pTZ98K1XU7Rpf1YdqSekx4nTQEuraIg3k pDtw== 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=ZG6ae1a+VQYDF+HP8pwyU2WyU4xA7uudCLK9pyvDcw4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=MHV7+TqK/kqvJp5q5W1TWjBRO3Kr/MyNMC67UQRFOgJ3YmK8LGikA+ZBvHCXFoI6HX ysYVLyHfjzKfEgIB4xWkoorGZSopayQGkUHkvxC4B0lAIjw6qr62cG44xfi/Ep3H6J4d 5pIHRTYttuM3WIyHkN+9jyj4FtCYb94l173ZrBsLgSpf1hPIyyD5lyhwRnkwDRVPGtWi CJVf3jNL+bpYF+QhV83wFvLQbpOHefgdWPwV/YuiE2j/eFo+ljOgCnFXf2XWfY93iom/ Lfme+09K/hPjBQItGLtiR9gOgi/OVloecXeL9gay3NyXg2awUjg11G2ZYIB+z9HjB8fV Mr5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YP/8EBKQ"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ad5cdsi1375901085a.34.2024.12.24.12.10.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:09 -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="YP/8EBKQ"; 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 ) id 1tQB9t-0002li-Bh; Tue, 24 Dec 2024 15:05:37 -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 ) id 1tQB9j-0002jU-Ir for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:30 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9h-0002Us-Of for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:27 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-21680814d42so52211635ad.2 for ; Tue, 24 Dec 2024 12:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070724; x=1735675524; 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=ZG6ae1a+VQYDF+HP8pwyU2WyU4xA7uudCLK9pyvDcw4=; b=YP/8EBKQCBeA+I5TNXMTHmBe8XG4ifwGnXK3FuD5QELLegUs0iC/r8911ZJVIQ/yWp rO9LNdSuKLNVpKt16KxOLeYV5ht4Wsnh3TpV4auhHwRLE9V3/7PRi+PDllGlnih59dMi 1Sy/VrhK2vUwb4jR8c2/RA+UK20N+pO6BWcVBAe7YcXhDlMdFy/TyyHSbVQDYiyP8Sah lMpQ4i3xMdJ+L6uDQjI4mNMf3fLGgGtZQZ3SxOKkvAPr8sMs3xsnkaIFG77uhh8flpK5 I41mHnqSLLeBU7+OYYKZLbe4dnU3U1a9Kx4GCwoaDJoX8xVG4h3mo1U7x7ApTvU6Mw+/ kkEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070724; x=1735675524; 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=ZG6ae1a+VQYDF+HP8pwyU2WyU4xA7uudCLK9pyvDcw4=; b=iiNq6fyfsnpjgHPSmkAzkP3MHnKEzxTwfLx9gktE11gAj4g6IWHOZpGLCggMySyJB+ Qy32Z8jV/lAsiPwNfkvqmgmfgPydpug66+etxjj8+yehH8gnv78yuc1PDXWwyEnYzAtd 1E/Ul+smEh9ed7T/qHoRw5Zl5fQlpNk3i2DJAy3gfLqgGygSX57FEcrrr6MmrJqL4XE6 Q/R4ZIWEO+d6HDCoPrhCbsww6+qRvOTUM5mNRDyzp45DzXJUIabpilp/BNtW+q7hlr4U v3bZg7Qn9PB1b0pT0fJxaufXVQS7AzXYxCMosUKNCBqUafD0nX0ZSMRcprq3lu89ibd+ sx+g== X-Gm-Message-State: AOJu0YzSqtwRyUKPcXPqUu5dhOsoMOdxMY5P9dFkVyB0HMYwLWlg53sR Ki1e2Dbv6pFU/2W3dzolu7CYWORAGcK4FtLUeSJb9QCrVvamoJjzMPch14u8EVei78annICC5xJ 759k= X-Gm-Gg: ASbGncvUdkWr0xkH3K3W8Duetq602cKkm59hDgzPhKnjFJ/al8gsXx1b5EjoZfBfPwn U6O9cEZsjFDb8gDre6kQ3QXvAoau+U85VU22taJozRxvCpOBtRG3SmmCwZRxBwutVLYX78SW/MH KTDUslClD/v0utfEL7K0UVCtQkEAzfNV6WSjS/OyaBQIaX4tpWYprRRZdTSDYGQmthZYEGrena+ WRXIdyyc8gGRggA3VrlKS0o+rOPXJfI5bHim17/e6srle7OV5AU0LgngSaDMOLWUE7pYsLsijc7 mljd73JeW10UF+riw6dq490Vjg== X-Received: by 2002:a05:6a00:1942:b0:725:cfa3:bc6b with SMTP id d2e1a72fcca58-72abde404b0mr26512426b3a.3.1735070724395; Tue, 24 Dec 2024 12:05:24 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 02/72] plugins: optimize cpu_index code generation Date: Tue, 24 Dec 2024 12:04:11 -0800 Message-ID: <20241224200521.310066-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 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 From: Pierrick Bouvier When running with a single vcpu, we can return a constant instead of a load when accessing cpu_index. A side effect is that all tcg operations using it are optimized, most notably scoreboard access. When running a simple loop in user-mode, the speedup is around 20%. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20241128213843.1023080-1-pierrick.bouvier@linaro.org> --- accel/tcg/plugin-gen.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 1ef075552c..7e5f040bf7 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -102,6 +102,15 @@ static void gen_disable_mem_helper(void) static TCGv_i32 gen_cpu_index(void) { + /* + * Optimize when we run with a single vcpu. All values using cpu_index, + * including scoreboard index, will be optimized out. + * User-mode calls tb_flush when setting this flag. In system-mode, all + * vcpus are created before generating code. + */ + if (!tcg_cflags_has(current_cpu, CF_PARALLEL)) { + return tcg_constant_i32(current_cpu->cpu_index); + } TCGv_i32 cpu_index = tcg_temp_ebb_new_i32(); tcg_gen_ld_i32(cpu_index, tcg_env, -offsetof(ArchCPU, env) + offsetof(CPUState, cpu_index)); From patchwork Tue Dec 24 20:04:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853213 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081255wrq; Tue, 24 Dec 2024 12:06:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVNvhDSOl8RzITGpDmm/w7sBfHEZTKV5dFFCjAg+PD8NjscAF5rt/uoY8DD/LLsAUnFg7FvgA==@linaro.org X-Google-Smtp-Source: AGHT+IGcISnScms9TkQS8W/wDTQgl/Oj8J9ClrmQK+06TLN9uj7GRrP6CE/btuI2G+VrADAFbU7V X-Received: by 2002:ac8:5a54:0:b0:467:8342:d0d5 with SMTP id d75a77b69052e-46a4a8c5db9mr269157051cf.2.1735070797484; Tue, 24 Dec 2024 12:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070797; cv=none; d=google.com; s=arc-20240605; b=gi+DEwnxSJ8jNdWxCItO9x2xnhwTFmXn7pCtRp7U5qPEcCpB6yp5EV3xXRIa3RZhM8 mXoxuoh4QKi5gTicBXCvFJeKyOSO329a29lM5X4LQiBXRGXb0coDqwq92/h7Vr2NCTwt 1qMBKW8hNKdmX2OKdA7alRn1Bl/FD0eYr0K6pQQxuiH+AzYvsKxO3J95404Dp0bXv+bI ucxviN6AjKmpA87a5wFmY5lLzgrhsiQu1ZC/6gEyxhQEdjPjVMDyiT8YaNumdBrYborx jaXDNfWz2DfNdHX/+5QCcIOyFN0gwnU1xT2vm1SjAmX+rbNsZ9lFQR0giyYxE2+/t4Cr pO6g== 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=i8y2SP5gsVRd2DDyIzSjHzTbblUtHqyMo6MFtQTYJr0=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Za4MPIgxOPVTFu8kPkVCK+WEr7RINH30W1I1HyFUiWYIzd2InTo5Pregbckzt3HgRF u/QUGLwBiWMYRzHTK8TSgFJjmmG2j2c7EIbtx5ozo6sU3vw7hPbnnQYXB2ylRQNOLIwB S76lxK2t40zRKYztk43KVJhBugL0zotc4M5zCrxgnZ4cYGRdcffHI29RhOwUbtDdN+d3 ok6/iUaW+M6eO9faftfbBOl0SlQ9RdbRnfsnvc0skpoeFizuQ995k8KcwOc0RYV9v7xr m1dyJPGXpQoO2I33cIkYkaXHPTXQRRPYF1djwbFstXFo+hej949cc1NKTad+BD+hHPZy E7Fg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W4nI2Ds2; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb990f2si157375551cf.270.2024.12.24.12.06.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:37 -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=W4nI2Ds2; 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 ) id 1tQBA1-0002oR-5z; Tue, 24 Dec 2024 15:05:46 -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 ) id 1tQB9k-0002jW-66 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:30 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9i-0002Vj-J5 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:27 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21644e6140cso59036495ad.1 for ; Tue, 24 Dec 2024 12:05:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070725; x=1735675525; 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=i8y2SP5gsVRd2DDyIzSjHzTbblUtHqyMo6MFtQTYJr0=; b=W4nI2Ds2quteX6Et2TlbzRKDIrAwJuQSnBaXNatDUIhhqPQoFfDusMKGmZWGQTs4L+ mtEZ1hyUvjQRxf5fOrDPFIz9tqZE4nJBLHs07cHJsEvl0+A68+ldn1NODh/gcg/Drryl ThpJI5d02hOg/2HnkGT1ZzGSycki8sVu3NyUsDIfWuUXKk9+bvmBWd2oQAo6s53pbtXP ha2S7IdAUnzXfnV+uEiahuvlwYCOdbDiKF9A5aK4bW1KhBtfpOnBQ2K795ihcNyXlLC/ 3RAf2loDnCUXCkmTAJbpjSQqpCFEKwrS7d+XZnXHAnUY1aVDzjbzMd3lRXnDkPrA3nm6 0paQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070725; x=1735675525; 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=i8y2SP5gsVRd2DDyIzSjHzTbblUtHqyMo6MFtQTYJr0=; b=HNBpa8q0zFQs0uIrR1aIO17hYpKefD3y3v2v48W4VkLvioh3ZXE37tMx6SHU0pKD9Q +naSc3bW8qHdV9HXqBstqFLs+qAi8z0g36+fTxUoA36QhCMs0mzKPdtZjtELk+7Tvhs3 FQj1TknknPtQh2XHmbO3aGG/0Oa9znGK+dXT33PHJy0hqRydGIeB9hU57gQW6SC60Ru3 9xspiP2xZl9j5Mh1epTGaU5Q6FBgIv8ckQgmSXmvU6BbNXldFfVyoePp8K+Nn19oTxKO cZ+D92ehnqopy9lni+17v+huzoYPE55VDPbGoSH3/mfOl+42+cMwEy6i9ZIrVuwpHFFy 9WmA== X-Gm-Message-State: AOJu0YzTTTqyuCG6nb1xu2Z0uCdcGYbIvnlyJkd0VipBUQyTzanr+YHU 3h0BqE4hCTsR9ZVF0ffbElJ2oF8uQqb5RXBtIow2YS2jcbep/rU7X4pN4P52FKlrP2DoIIPUxD5 wDkI= X-Gm-Gg: ASbGnctnlPvGmMOYxJWhc2LI1fOtyz6gIJrdn5vzx0K9i6bwY1j2hGQ4/XRqXjb3jn4 n4uhdbpnTwlHbq5vNY2aKQ+QQtWXPa75lJTr9LnmBTLtbQiFsIhv6gof1tN6cNXQbzbcEsaKt5x SLHPSERWeM7h47XzWKi33YZhGU1x5Qzi0QmTY+Ds0vpqicvSf8j0VWYwScy37cXGQGxklQ64OEd sMQ6gmRVuE+c5u4YuEvG7TfgkjgKZgaO/bNTdtuCw29FEAyeP0/rVvGaN/sYYd7ddeGbVEmBiPy yYLsoemopPKdmp3GaaIF0dAFtA== X-Received: by 2002:a05:6a00:3cc2:b0:71e:4cff:2654 with SMTP id d2e1a72fcca58-72abdd6eb8cmr21763038b3a.6.1735070725198; Tue, 24 Dec 2024 12:05:25 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 03/72] tcg/optimize: Split out finish_bb, finish_ebb Date: Tue, 24 Dec 2024 12:04:12 -0800 Message-ID: <20241224200521.310066-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-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.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 Call them directly from the opcode switch statement in tcg_optimize, rather than in finish_folding based on opcode flags. Adjust folding of conditional branches to match. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index e9ef16b3c6..453e8c43bd 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -964,24 +964,25 @@ static void copy_propagate(OptContext *ctx, TCGOp *op, } } +static void finish_bb(OptContext *ctx) +{ + /* We only optimize memory barriers across basic blocks. */ + ctx->prev_mb = NULL; +} + +static void finish_ebb(OptContext *ctx) +{ + finish_bb(ctx); + /* We only optimize across extended basic blocks. */ + memset(&ctx->temps_used, 0, sizeof(ctx->temps_used)); + remove_mem_copy_all(ctx); +} + static void finish_folding(OptContext *ctx, TCGOp *op) { const TCGOpDef *def = &tcg_op_defs[op->opc]; int i, nb_oargs; - /* - * We only optimize extended basic blocks. If the opcode ends a BB - * and is not a conditional branch, reset all temp data. - */ - if (def->flags & TCG_OPF_BB_END) { - ctx->prev_mb = NULL; - if (!(def->flags & TCG_OPF_COND_BRANCH)) { - memset(&ctx->temps_used, 0, sizeof(ctx->temps_used)); - remove_mem_copy_all(ctx); - } - return; - } - nb_oargs = def->nb_oargs; for (i = 0; i < nb_oargs; i++) { TCGTemp *ts = arg_temp(op->args[i]); @@ -1351,8 +1352,11 @@ static bool fold_brcond(OptContext *ctx, TCGOp *op) if (i > 0) { op->opc = INDEX_op_br; op->args[0] = op->args[3]; + finish_ebb(ctx); + } else { + finish_bb(ctx); } - return false; + return true; } static bool fold_brcond2(OptContext *ctx, TCGOp *op) @@ -1443,9 +1447,12 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op) } op->opc = INDEX_op_br; op->args[0] = label; - break; + finish_ebb(ctx); + return true; } - return false; + + finish_bb(ctx); + return true; } static bool fold_bswap(OptContext *ctx, TCGOp *op) @@ -3037,6 +3044,14 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64_VEC(xor): done = fold_xor(&ctx, op); break; + case INDEX_op_set_label: + case INDEX_op_br: + case INDEX_op_exit_tb: + case INDEX_op_goto_tb: + case INDEX_op_goto_ptr: + finish_ebb(&ctx); + done = true; + break; default: break; } From patchwork Tue Dec 24 20:04:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853212 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081237wrq; Tue, 24 Dec 2024 12:06:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVvUeTefFS7D06+Y1qpjIM4fbkrRQDljaK8vKevpYbp3iMYWLVtIYRpL12HHJggYqeKut1vsA==@linaro.org X-Google-Smtp-Source: AGHT+IH2nTIrzG85DhYtMJDOWU757XeQx28KbXnDSCRkUsRHpsuSMyVfaUQ1YBj/YLTx0T0Y4Z5y X-Received: by 2002:a05:622a:314:b0:467:71bb:480c with SMTP id d75a77b69052e-46a4a9b71b7mr302939971cf.49.1735070795529; Tue, 24 Dec 2024 12:06:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070795; cv=none; d=google.com; s=arc-20240605; b=Ktm3fhxPAkCoXOgSCnHg63gYuWf71+67dpRZ2/XnbUuufV53djHnQvxnmvah9byRy9 4G5Ftsc/LWY4CgTKGgXMuX3ScZVvmAYTvLi0mAG3W3goXm7TWw1vbdgcJa96VplhAZCl fMRG/qu4dSFbYen8lPTATxRYostqwmSF6+GblhEFKM7iXaaUCP+6koRqTzNg/ztfYmda bBX3pjgbU6tNaleVgHGPg5DYzAdSTzfCOCSbXxlYTJvqKr0geTO00vvvVecT+oN6eDeJ zg4D1lkwYOOM44SVOwrBBHtzwaAF5nDzVlWRKMjLHDBqAetIZ75ziBOJ0yt24klkQFl4 MR0w== 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=iOzpxqZ9VNfy3l9f3NLQHzVfPYu5zW7VkQL9KwFwxnA=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=UM2ssHGrS1voQXYOyt0mlf3Nqzm6U72INFkbHFiXBamreJHltRgbLtw8we5norbwBq 8a6baBQLIu4JkUyC5shfMslaxrST1oc8WmSrsjMBq89yZgorVvE8Z6TFxK3Ip8G6clEg Ibn+/SOm/92fs6QwxTtp69r8aBEaMEkG7VH9+KZ3zuTsRimSxnspUrABslAOy8zX7fbY 2hN6xBECso7byLKj9f5wQp2pAjvKIBRjblxfvb7IOopIdsjXM8uV2tOVJa0RxYjZrEqg 6XD3FuBGxKuT3G7IVK0HSW18Xo5w70kGpWbe71weE9pMNvrUrK+yp3VCsAVgwQrXA2tm Lx0w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xcLWc0LJ; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebd6d5dsi134024301cf.547.2024.12.24.12.06.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:35 -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=xcLWc0LJ; 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 ) id 1tQB9u-0002ly-Vq; Tue, 24 Dec 2024 15:05:39 -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 ) id 1tQB9l-0002jX-9j for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:30 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9j-0002Ws-MR for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:29 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2166f1e589cso67033785ad.3 for ; Tue, 24 Dec 2024 12:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070726; x=1735675526; 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=iOzpxqZ9VNfy3l9f3NLQHzVfPYu5zW7VkQL9KwFwxnA=; b=xcLWc0LJluNu9CiKwHB1b/v9WGr0iy/kgAYBBZ+mTVb6eIkwlSIpvg/ATl8PDZ3aoL OSP4HLFLoJ/pmYZHtDCQiaCYxJ5gVTrbIJGOVSM8akb0oIkNALvNevi4ljpkYU6amBHm i4YynXDzU0joKD+Onsi7bcjcXzlOAjHmaMgVTL4+Led/2DKhXOB/3eTzU5PJqZpKL+Cv SBYfKnx6Jx161YUUl0qMZgRbP5lreHVeqt5MmbawIsEIen5q9GauClEGagOkf1SkKmHw xYMP/ZLHhgLd4xvKRLfl3N2SC0O6KmL1U6VfjndhAsCTU6ie/C/KsAGd7lMHokn4BCSx M+2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070726; x=1735675526; 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=iOzpxqZ9VNfy3l9f3NLQHzVfPYu5zW7VkQL9KwFwxnA=; b=SNfLUhF5nN2rSGa9SwHrZVfMmXNNVaV3EtNyn6lnbBJ4HL+SJ7qZvoPToatoJasT9Z z8YHkzQt3vpkU8KyXkYaM+16fmT++H07Jy4GLV4GQDFTfvQ+yOza4AFS1adP2sOtWG7K aIbor6cty7yL0V4p85gtECMRD/6h/sObLr1z60llmzwj0vaoIvQ3ufrYD3z/GBpC66v0 gkRmFPYew52k/Kj0x8GrADWK7Rl8KiDpuLZ2XZc6IU6H4MyKFj7F4aMvVg/rXlRLAYdp nI96LhzLRsHpLnY1kcgMr8G4KKMf0vFr6i7fDgI9laKfXoyOz+WMVWxryiYCdVOepg/X /hoQ== X-Gm-Message-State: AOJu0YyPDLpwtdlqvhs2B0tEZ6hYcslk/jMrGnAqMpgp2amfYcqxgH8X hD/TIroyi1+40GQmkgGoZM3+VmMc9HiBkhKvdOwVdQkS18hhyST2CYKQiO0/D9rDP9CjVV5xVY0 af54= X-Gm-Gg: ASbGncv7psoRQMr7filob/BdTdEXhOJ6DN/kNSEUAl+Xu18RyYI8fBPgxW1W++ISlcG WD3FdDOXBFVrJu+y21dm0S+Rudm1A2Sy8gB5guoKBbcxq+8m4ZFj9Z30kcXebxBUsIzyRS2Pq4U 7y01TWK2s2AFICSOd9vnN3ADcX+cLgyMA+9fJ9l3rcE8qsLVgw4Xmu5JzY8jCzD1gW6qV7a61QB cEBQ6OHx8ivna6tWac7zEa8d1sTclXtZuI8diqG5JzCqtvshDWlMRHn/Lj7gjsGGs6nMNTurm0M KLg8NnhJXO+neIJgy5t2Az4fpw== X-Received: by 2002:a05:6a21:3103:b0:1e1:a932:4a40 with SMTP id adf61e73a8af0-1e5e043f517mr25728596637.4.1735070726119; Tue, 24 Dec 2024 12:05:26 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 04/72] tcg/optimize: Split out fold_affected_mask Date: Tue, 24 Dec 2024 12:04:13 -0800 Message-ID: <20241224200521.310066-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 There are only a few logical operations which can compute an "affected" mask. Split out handling of this optimization to a separate function, only to be called when applicable. Remove the a_mask field from OptContext, as the mask is no longer stored anywhere. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 453e8c43bd..6757fe0036 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -64,7 +64,6 @@ typedef struct OptContext { QSIMPLEQ_HEAD(, MemCopyInfo) mem_free; /* In flight values from optimization. */ - uint64_t a_mask; /* mask bit is 0 iff value identical to first input */ uint64_t z_mask; /* mask bit is 0 iff value bit is 0 */ uint64_t s_mask; /* mask of clrsb(value) bits */ TCGType type; @@ -1047,7 +1046,6 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) static bool fold_masks(OptContext *ctx, TCGOp *op) { - uint64_t a_mask = ctx->a_mask; uint64_t z_mask = ctx->z_mask; uint64_t s_mask = ctx->s_mask; @@ -1059,7 +1057,6 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) * type changing opcodes. */ if (ctx->type == TCG_TYPE_I32) { - a_mask = (int32_t)a_mask; z_mask = (int32_t)z_mask; s_mask |= MAKE_64BIT_MASK(32, 32); ctx->z_mask = z_mask; @@ -1069,6 +1066,19 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) if (z_mask == 0) { return tcg_opt_gen_movi(ctx, op, op->args[0], 0); } + return false; +} + +/* + * An "affected" mask bit is 0 if and only if the result is identical + * to the first input. Thus if the entire mask is 0, the operation + * is equivalent to a copy. + */ +static bool fold_affected_mask(OptContext *ctx, TCGOp *op, uint64_t a_mask) +{ + if (ctx->type == TCG_TYPE_I32) { + a_mask = (uint32_t)a_mask; + } if (a_mask == 0) { return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); } @@ -1305,8 +1315,9 @@ static bool fold_and(OptContext *ctx, TCGOp *op) * Known-zeros does not imply known-ones. Therefore unless * arg2 is constant, we can't infer affected bits from it. */ - if (arg_is_const(op->args[2])) { - ctx->a_mask = z1 & ~z2; + if (arg_is_const(op->args[2]) && + fold_affected_mask(ctx, op, z1 & ~z2)) { + return true; } return fold_masks(ctx, op); @@ -1331,7 +1342,9 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) */ if (arg_is_const(op->args[2])) { uint64_t z2 = ~arg_info(op->args[2])->z_mask; - ctx->a_mask = z1 & ~z2; + if (fold_affected_mask(ctx, op, z1 & ~z2)) { + return true; + } z1 &= z2; } ctx->z_mask = z1; @@ -1709,8 +1722,8 @@ static bool fold_extract(OptContext *ctx, TCGOp *op) z_mask_old = arg_info(op->args[1])->z_mask; z_mask = extract64(z_mask_old, pos, len); - if (pos == 0) { - ctx->a_mask = z_mask_old ^ z_mask; + if (pos == 0 && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { + return true; } ctx->z_mask = z_mask; ctx->s_mask = smask_from_zmask(z_mask); @@ -1777,8 +1790,8 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) ctx->z_mask = z_mask; ctx->s_mask = s_mask; - if (!type_change) { - ctx->a_mask = s_mask & ~s_mask_old; + if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + return true; } return fold_masks(ctx, op); @@ -1819,8 +1832,8 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) ctx->z_mask = z_mask; ctx->s_mask = smask_from_zmask(z_mask); - if (!type_change) { - ctx->a_mask = z_mask_old ^ z_mask; + if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { + return true; } return fold_masks(ctx, op); } @@ -2482,8 +2495,8 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) s_mask |= MAKE_64BIT_MASK(len, 64 - len); ctx->s_mask = s_mask; - if (pos == 0) { - ctx->a_mask = s_mask & ~s_mask_old; + if (pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + return true; } return fold_masks(ctx, op); @@ -2843,7 +2856,6 @@ void tcg_optimize(TCGContext *s) } /* Assume all bits affected, no bits known zero, no sign reps. */ - ctx.a_mask = -1; ctx.z_mask = -1; ctx.s_mask = 0; From patchwork Tue Dec 24 20:04:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853214 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081299wrq; Tue, 24 Dec 2024 12:06:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXj5TsyE73lA5OatT4yMU+2p0hE8m3XUW/smdjVFRAqS19pGx3dBwO1DxWtQWRE93IB42v2Wg==@linaro.org X-Google-Smtp-Source: AGHT+IGYYglk5MGYo/6lEXV6LmDmwncy9/ouwroVNYjsqsZTE/3J01NzR/ZHNvWQmxz5RbpyA5Xc X-Received: by 2002:a05:620a:2995:b0:7b6:dd89:d86f with SMTP id af79cd13be357-7b9bacd3c66mr2956826585a.24.1735070803570; Tue, 24 Dec 2024 12:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070803; cv=none; d=google.com; s=arc-20240605; b=eghpOBglg2CbAJD2R9SX9VCv107vFTmAmvW41FXP648GywAyuHnmp+ju2jSAll8YMg 7+37aYuJZuHPJWM/broq+4MKG7MLZCZ8BQar1BptidrWd4otu2SEdxqsnHYhQ1fOc5h5 x8ZMtVPvpAsECkk+FFMkStjs8EUfmVaAdXWEyn9jnqjTL04lhrJtLM6n2MS2d8tk3JOh +rVeiygJ7ps75QK3CoxnKrBldS7LHurBg95rIbU5WXTjkXOAWwzrdCUgUVLVaZ5Utpmt Yh2pE8i7uMfCroQqvHHWG8Nc/SnQfi7Ieyc5MZMaz/mdXxEx8S3MOOTcQ6s6eqidGzIf yP7A== 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=kwAmrbK+z6InFUYOYJQouqu9jlEe2zkE3MrW95sabRA=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=dc9fUPb65t/nM8w4UnPyyku3uF1NF+rv3TQ3owUp5QO/VhSJ8G6V9JTvsGOYiYLAgm CGPfkqzJIxgfN9jIjNDgfKpG47JTWRtd1h3YETKPdQ/6VyXjV5mWU8iM9DYRjrEETQdf r9ChHvN0Zpm8pxVwpdv6GuI997E2eMUjBNjyOFzXsmsvQxFPY++elBJxGJ9LPa/kuk4O ePk/41EKRp3TvhOYcKRD5+cFLbjkE7DZpn4X60yzUTuUwaSRjY89z+uWaThzXF++gs78 xsJVw/vnk5b8R8nOYI8VumVXl0ooRd555ozATA6d+HAoSY2msSnbqj3KFOiJjDsOKL7L ONsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hptUS2Qc; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4ce7edsi1413885085a.386.2024.12.24.12.06.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:43 -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=hptUS2Qc; 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 ) id 1tQB9w-0002mj-T3; Tue, 24 Dec 2024 15:05:40 -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 ) id 1tQB9l-0002jY-Ey for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:30 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9k-0002X3-1p for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:29 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2162c0f6a39so64868855ad.0 for ; Tue, 24 Dec 2024 12:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070727; x=1735675527; 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=kwAmrbK+z6InFUYOYJQouqu9jlEe2zkE3MrW95sabRA=; b=hptUS2Qc/0PzPXBWt5iKl0AuHcyGIEIHu5iwdrsBDtFbZ+QdI17AJc2Ng3BTTZicLG sPW1v6qbPRtWPW0NkBdxU4h5P/cPA/49xDZoX52xYxz3Qi+Yg8ve0ejz+0Hx+etUTTBP WCkdlLbUN2mQuSJJzmNrhk4xT59qAa5uPxxrfhh5SVezQn6nifCfZ1WSKBTfiBcAU+5O whxC0wZi1LTGUKqKMeB08UDUJsREP0wKTIsLlqRCZPnOAVtz5O0uCenS8KgnDudSdsGy DT3ykdXyOU/7gW4ErlWh/lzMRrVMn+ZfenMYMjpYDyUDrSqDTM+p1P/rI91HqvU9JVpS QReg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070727; x=1735675527; 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=kwAmrbK+z6InFUYOYJQouqu9jlEe2zkE3MrW95sabRA=; b=qpMVj8oiDI/OoWStCDjlpQB6kLsItzQ5cAN6/RqXuHYwIn5Rm5sh3sZybamuCeK+AF 0qoLJ7hqUU2uFRUkEwgl9CSy2f1esccHg4aAv8ZumKHZPJq7cclWCssuYhmslWyO56Xx eesOaAxb7TK+PODsiDhfvK4p+NukTY3IFfdMC3EMF44AtPm8vDgN091HI4lBf4tbo4V5 eYO0lc+oQRtmAB2xh6/d2Ef2TNuTbrXi4TfcyXn1eg+9VfP3e/KtDM+lObuIN8bam/vs xNaaNPmmnWlq/VHVtEyeHPELKpjuXx6hVC4BW/eQxN2/gshBwC0dCNBZ2G5nr+b7w59R CNNg== X-Gm-Message-State: AOJu0YyAAbQHa0AjoZEXLFejItzTjkNGYtCV/pnx8hw01kl3PZao6N43 3IN1em8p8eJ51gwaxNiWhxlXwQ/HW6CIP9K0X9lRJOofa4aIzjTlzFw0dpzvv4Dq6Sn6+0ueDuk SNfY= X-Gm-Gg: ASbGncuUYC2FfbM2NRE+Er3sNTbaVtRP7o83W06JpMnu+Eh5fBY9Pviv9c9GKo1ky4+ ak3/8E88F2JBEIFWD8u3XGA2Bs79nawKgn6a/F+Ofw3exSz0FQYZPx2L9PvF7ejNGATiGoRHMWz x7L33ElOTw9Optqk1Va6H4odC99LXKydItgclH733l8U7Jna+pB7gYj+9MNoqtfn/OfJSHHp0Kk KJL1J0w6vpdXMCi1McBUNkdSKWU57d+rh0ctWbCVnwzlTO60wCLUMUfW/GQsvmhN80KHq6S9Jea gHbJ4GrYcXoLDqN+TYXN3VZMVA== X-Received: by 2002:a05:6a00:69ad:b0:725:f1e9:5334 with SMTP id d2e1a72fcca58-72aa9ade355mr28645965b3a.8.1735070726851; Tue, 24 Dec 2024 12:05:26 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 05/72] tcg/optimize: Copy mask writeback to fold_masks Date: Tue, 24 Dec 2024 12:04:14 -0800 Message-ID: <20241224200521.310066-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 Use of fold_masks should be restricted to those opcodes that can reliably make use of it -- those with a single output, and from higher-level folders that set up the masks. Prepare for conversion of each folder in turn. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 6757fe0036..2aa57afd64 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1048,6 +1048,12 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) { uint64_t z_mask = ctx->z_mask; uint64_t s_mask = ctx->s_mask; + const TCGOpDef *def = &tcg_op_defs[op->opc]; + TCGTemp *ts; + TempOptInfo *ti; + + /* Only single-output opcodes are supported here. */ + tcg_debug_assert(def->nb_oargs == 1); /* * 32-bit ops generate 32-bit results, which for the purpose of @@ -1059,14 +1065,19 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) if (ctx->type == TCG_TYPE_I32) { z_mask = (int32_t)z_mask; s_mask |= MAKE_64BIT_MASK(32, 32); - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; } if (z_mask == 0) { return tcg_opt_gen_movi(ctx, op, op->args[0], 0); } - return false; + + ts = arg_temp(op->args[0]); + reset_ts(ctx, ts); + + ti = ts_info(ts); + ti->z_mask = z_mask; + ti->s_mask = s_mask; + return true; } /* From patchwork Tue Dec 24 20:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853208 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081144wrq; Tue, 24 Dec 2024 12:06:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVTFsuGIau9Rk8FZFP3HkpAcxbIiJS9ndbPHc+Vkf2sTuhZNzJWLVY5eHCJUFZF0zMcH4qsgg==@linaro.org X-Google-Smtp-Source: AGHT+IHmXNDWylyMrknfiQqnjSi14PtameE1W8DOMS3IAZ74Yl1XiGsFLehvm0EMycSPSeDXU0rn X-Received: by 2002:a05:620a:28c9:b0:7b6:d23a:be4e with SMTP id af79cd13be357-7b9ba79aaf2mr3150551985a.25.1735070782267; Tue, 24 Dec 2024 12:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070782; cv=none; d=google.com; s=arc-20240605; b=BqEqM4ANumialNcEdoOwQOMy4Njn1gJcWD8Wrqio1X1KsmRLOOmgNna5lkAlzIrLSJ pRGsJpZrn76MrGT6ZkAoC1lj00UlC386wEAEfue9QXseLiJsyPVpBcOuiicj5NXzGcZQ 9FvBkaLS5gVPXgKYysiN5JrKq+8/0QzulqVkILSKaNJWT+eFQbCTUD4ltIt0mmoHO3el CaFKt2uTxKY7zR3TyKuqcycb011nkxdAYvy1lAql4aFMY8xaZqhdipEb2rFRZ9YPy3rZ wySL/e7YpeCdZV9cZkq4vh4/Oi31TTSP2CpXhnwi+fWSalXqeRLimOHFgAEPnSLPUnsp quNw== 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=6O0RsWWKqdEinIh2H96IW4WRMj9sIUVKDwhRVVNpMf0=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=R24OUKagYmV2LwcRrA2Z/AGLrsmyy5s7ac6n4tESLS135/fasnmsx9zsRJOIk5b14S wJpNyt8tqUS+1i8NTkW48HmNLSibCSFBDTMRstSljA5bPkpMN1Unoujs5yytgf4luxtJ /iXRjPB3Obg/G8bcfxB7kHrX4I8Rp90gU5+dKMdEAF1f1cmvTq6Mj6qrkJ4tj/S8dkot /RBnIQQvNMgBYoZQ8LbyxLbwm3nHtxApNyZnGEc09mPAi0iSJ1eQGaaef0F74o2j19Y1 IpSl/UrzJMZUU6W0GLs7Q8lCeXu5Uk+TW/JowCvQLszSv66DCxvCTwh+Xs69LbkPiQwh XEFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R0LncO7i; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb9969dsi136818631cf.306.2024.12.24.12.06.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:22 -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=R0LncO7i; 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 ) id 1tQB9w-0002mk-Tn; Tue, 24 Dec 2024 15:05:41 -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 ) id 1tQB9m-0002je-JQ for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:30 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9l-0002XI-4g for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:30 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-216401de828so54800755ad.3 for ; Tue, 24 Dec 2024 12:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070728; x=1735675528; 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=6O0RsWWKqdEinIh2H96IW4WRMj9sIUVKDwhRVVNpMf0=; b=R0LncO7iqnfvdWdHnmBW90w4sao/4HqmR/WnRXAW4PGPLyQ1dr+W1Xnt5zF0/Nf0xX T0tOXsDl64IOo8Y8fyVrLpkHcjE9UjK8J29xgu0HMCsMxqYv3nrXDGkZ16U0Ef1Le//3 lL/ArsTBsG+s4ysdLWO7tet4ZzRtre+2Z69zkYUCjgtnSp29iWF3quriHY8B/XpZhefT Z7MicNU2x4sHBFRfjl1YZ2y/qxZVMvgJ3Var9E5oXld+uqO+a+SSNU7y284pc04HWKrY MGhf3b4sPwXr/MVj7uMwRRX3h7G80dagX4n0jfIu2AQbSY1AyFDmepVJOL0mL70LfYvC 7fVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070728; x=1735675528; 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=6O0RsWWKqdEinIh2H96IW4WRMj9sIUVKDwhRVVNpMf0=; b=gzbhG9apv8e/vk13WYpw/7NfuXwKsPNEVCLbgju14sS0BTSTe1Vc0iOKHk0aAOMMBZ uFqr3hEOaJtpMkHHKz6i55aNcOhVz/1qjsohwJQo7tIoMXPzoAOQdAe4kxzOx+lX1sSt nDGj0NM0yUjXd8b2z4io8LCIfI1hq9t3XaypDsk487+YqGmERktP04AbjoEuIpg13wv0 B6qoLiPWvjMfN6K9qlgs55NoC5vqTQzz3n3TYWtdRH+7jXHzVsRPbB4APBaPw5zupCrM 1l3ndRG4ezUBvvax2jSpF7f5eTYGj0WRuDC9wSBCQgGI0qqCu2k91yM2jAvKtqEyn72Y MugQ== X-Gm-Message-State: AOJu0YwNob8apu0bZuJdiKukUoHLngCF3YgOMLUQxXtJW+ddpuVKYZpT vC8wsGczQfdgbwap09L95M2rPjTivQEEHTSNg/B36lYOUIwuAW02mmoKOSZdHiPcn3kRr78G0rJ mMsA= X-Gm-Gg: ASbGncvBBrqqrNEGOw9cML0fR8LhyOC3td7d6YERT3MuNomY6zD4iNko29apWCzv2/X NZSj7QCI0J0+1jMlSWL+TYdasfURNnVD5GGATKjnsi/mnnITCxZL0xd/amo7CL2TmSPAmqhdaoa y4RL9qf9uGV+07ivGqThpx/LH5Os4bJM5c12CUr4yXVWNt0dO2X3Une4Batp4FVMW8W6Zm1uUcU C6X/u+FqEo2etk6o7xBWSf9HOgglwT3KUfRCgIKdTA84bDs1phhxYiLZI2CtWWYYFy4otsnkV+u SgAAoQ3tMMOBbgrsPbXkOxDOKw== X-Received: by 2002:a05:6a00:44c4:b0:725:e405:6df7 with SMTP id d2e1a72fcca58-72abdd7f683mr26519750b3a.10.1735070727737; Tue, 24 Dec 2024 12:05:27 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 06/72] tcg/optimize: Split out fold_masks_zs Date: Tue, 24 Dec 2024 12:04:15 -0800 Message-ID: <20241224200521.310066-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 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 Add a routine to which masks can be passed directly, rather than storing them into OptContext. To be used in upcoming patches. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2aa57afd64..d70127b88d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1044,10 +1044,14 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) return fold_const2(ctx, op); } -static bool fold_masks(OptContext *ctx, TCGOp *op) +/* + * Record "zero" and "sign" masks for the single output of @op. + * See TempOptInfo definition of z_mask and s_mask. + * If z_mask allows, fold the output to constant zero. + */ +static bool fold_masks_zs(OptContext *ctx, TCGOp *op, + uint64_t z_mask, uint64_t s_mask) { - uint64_t z_mask = ctx->z_mask; - uint64_t s_mask = ctx->s_mask; const TCGOpDef *def = &tcg_op_defs[op->opc]; TCGTemp *ts; TempOptInfo *ti; @@ -1080,6 +1084,11 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) return true; } +static bool fold_masks(OptContext *ctx, TCGOp *op) +{ + return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); +} + /* * An "affected" mask bit is 0 if and only if the result is identical * to the first input. Thus if the entire mask is 0, the operation From patchwork Tue Dec 24 20:04:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853206 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081042wrq; Tue, 24 Dec 2024 12:06:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU90vCXSbPsu1Lvy6X8mwOf8Y0Mx4emZ/1h7akB06yopf3vTUE1DUSow+NpiNWHiTb+IjWU/A==@linaro.org X-Google-Smtp-Source: AGHT+IHkEN+uLX+5oilR+OLuElEfkkTLFd6kCx23Jn5vjMyhg/TUfpRoL+M4KJZPHnbmjDb17fOT X-Received: by 2002:ac8:7c47:0:b0:461:646c:b8fc with SMTP id d75a77b69052e-46a4a8ee2eemr320352351cf.23.1735070770276; Tue, 24 Dec 2024 12:06:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070770; cv=none; d=google.com; s=arc-20240605; b=iUvpnduGm1+ftPN8n73748YmdcRQWVe9G9jrRmsPAOr2deGmuuiHkuFJr/P6SeMU5C bX1GBylUbAXQs3d4qVttV43eKqMTCCbltybh6uH94wlEe2DOjXhAN7zujjFxNPaMSsrP 0RUIHaYt3USfQs6GqY36vDrZ2nZPJ1gbXehtcyLhxIpKOSTsctmgETS7ie3YKDCmnci6 3VR3HEs2zWcYGzRvrMf7OQZzkv4IujiS9AXVdJLBQNzYa8gQ1CMMDqk/55yE6Gbk2wIM HCs3p7OonWQeaKzXqp2RTEWIUJNf9BtghWogmLU5jI+djDpyoCMv6Orofv1WN+oIUNAU iLbg== 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=0XbbAA6tPaSy58TXvgA24Kz1zz5lDy83D/6o1p8rm3g=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=W/7oUx/ohzZN4/S4qfmeugvk9Bx1vTBmBa6wtL+F1LVplRAwt57aMZvciU3qL8rZOz YghUXAt2S2jcvfDR5k8KCcU7eGISwejBVu/+ZSuhSjVaZTpl2nH2gLXRaeLYjvSBrSKk ofwkqfdPWWgddIjd8Jphnqy052e1Boem34JmQOhMrE8HsoiNlOmEq96RNY1TCy88g/LD Q+nQr6zvR6rtuQo2SORsk//T5MmDEVsf6xl/AKFC7PJCOsAsBjzM7AWzj2mRBuPqOtoy LACRmkXAJjyZ0zTsLMyYWPKiZMiMrvk/6NUWg6xE42qA/5nOQQgI7MSezmf4InJA4w7B db0w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iyPogcdM; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb99486si153824501cf.266.2024.12.24.12.06.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:10 -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=iyPogcdM; 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 ) id 1tQB9u-0002lw-Uk; Tue, 24 Dec 2024 15:05:38 -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 ) id 1tQB9n-0002kT-Tj for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:32 -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 ) id 1tQB9m-0002XW-Ax for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:31 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-21669fd5c7cso57784075ad.3 for ; Tue, 24 Dec 2024 12:05:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070729; x=1735675529; 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=0XbbAA6tPaSy58TXvgA24Kz1zz5lDy83D/6o1p8rm3g=; b=iyPogcdMBkfObjKqSzGho6xFZuGnanmIkOd2YZXZ0gJZHwWS+lSiMFSxYTOb5rZdM1 P1tOLUimDiUQ/6YyWo2TnNY9ZPkjXswc8V67XjiVX9ogroX3AACuKGGGmW/g5uqLFuHk HgX/vEm8I2UIog0bbYbWlT/DGDyXHBY/yZ8qVFpPp1RI8LSOsIBW814defj2+lyZYulV 7zqTh+EzZ2SB8015c1bQSsx8hjSFxc0BotZNv7AP+H9gr2i/KaHSwtPVdHtkrQIIOhuW 9I9B6rqzhowMrBLR3IcqYJcesiu8acW25w5eh/HjqpL3Uqjhu3NeegJ8ofsFyfuXEMnT 43fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070729; x=1735675529; 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=0XbbAA6tPaSy58TXvgA24Kz1zz5lDy83D/6o1p8rm3g=; b=VX4FyZ73IOgMsSIja3MZUHhU668C7L2Q6dhRoiM0DV+P3lWqFMTFLw2YPxSbHBq1uo UVAmMLnwYtG9F4gZjkprZPWwalmo2YJa3ash8d5ZQLBaC+cpdn9hGvh2Nzei1pQaT4io EfSGdpxcTwLJpUlxiRI7gi1amJwx1O13PHqG2reLX4zVxS9A7WOOUWWgFiAzt+TAoYnG +hIhMXOWBPCQsFs8tn+dGgX+iCG/rdvS0X1EWRJMQDZsACGPcNmZtWZmgUwVV2aIvxhh riAsoYYvZbgk7TlIfBO4h6xb6SS3DF8YHIm84TiRO3wjcjMUB7mJ2kNFCca4PgG+9yAh 2bog== X-Gm-Message-State: AOJu0YwFKO2z/OsA6VhvH6+ad6eFezQ0AB1mhXb/2Z7DmjUZxTMpwYY5 ODM/+74j/RM2u0/xYod/0ZXQErS1NfL8TVQbZfh/lACx/4EZHW3Y5l4SsLfufzLXqzJV4WrAj5j OMsA= X-Gm-Gg: ASbGncveBmkC3O8hCV3NLKI502LYTX3Hzef29lKTSG1sd8+hdig/CphoJcmd5X0i5Bv k8ElVgOxBg4LscIVh0AkLV/cQ8NjqOgiwGE1i9Wobvp7/S2tkjO9S5eXNZc8os1lS/rEXaTZghB LDzzpDP1DXhUgfdZN4lCIgEbiUYQZ8qePCvNWfecbcymOYq+mrUeZGv74a40MINThVF5mAwEown hbKaVCpuWP8HtXYpgUIG9Kd9fBqQbEkfatXazKni+dtzRaPILQNBSYVaIOYvxQR4Hcp2anDptRK O9Wtl2AA+Cm5XAGnhinEu9LKVA== X-Received: by 2002:a05:6a00:889:b0:71d:eb7d:20d5 with SMTP id d2e1a72fcca58-72abdd7b8fdmr31105365b3a.8.1735070728843; Tue, 24 Dec 2024 12:05:28 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 07/72] tcg/optimize: Augment s_mask from z_mask in fold_masks_zs Date: Tue, 24 Dec 2024 12:04:16 -0800 Message-ID: <20241224200521.310066-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 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: 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 Consider the passed s_mask to be a minimum deduced from either existing s_mask or from a sign-extension operation. We may be able to deduce more from the set of known zeros. Remove identical logic from several opcode folders. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index d70127b88d..d8f6542c4f 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1048,6 +1048,7 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) * Record "zero" and "sign" masks for the single output of @op. * See TempOptInfo definition of z_mask and s_mask. * If z_mask allows, fold the output to constant zero. + * The passed s_mask may be augmented by z_mask. */ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, uint64_t z_mask, uint64_t s_mask) @@ -1080,7 +1081,7 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, ti = ts_info(ts); ti->z_mask = z_mask; - ti->s_mask = s_mask; + ti->s_mask = s_mask | smask_from_zmask(z_mask); return true; } @@ -1519,8 +1520,8 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - s_mask = smask_from_zmask(z_mask); + s_mask = 0; switch (op->args[2] & (TCG_BSWAP_OZ | TCG_BSWAP_OS)) { case TCG_BSWAP_OZ: break; @@ -1534,7 +1535,6 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) default: /* The high bits are undefined: force all bits above the sign to 1. */ z_mask |= sign << 1; - s_mask = 0; break; } ctx->z_mask = z_mask; @@ -1605,7 +1605,6 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } ctx->z_mask = arg_info(op->args[2])->z_mask | z_mask; - ctx->s_mask = smask_from_zmask(ctx->z_mask); return false; } @@ -1625,7 +1624,6 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - ctx->s_mask = smask_from_zmask(ctx->z_mask); return false; } @@ -1746,7 +1744,6 @@ static bool fold_extract(OptContext *ctx, TCGOp *op) return true; } ctx->z_mask = z_mask; - ctx->s_mask = smask_from_zmask(z_mask); return fold_masks(ctx, op); } @@ -1851,7 +1848,6 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) } ctx->z_mask = z_mask; - ctx->s_mask = smask_from_zmask(z_mask); if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } @@ -2116,10 +2112,10 @@ static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) int width = 8 * memop_size(mop); if (width < 64) { - ctx->s_mask = MAKE_64BIT_MASK(width, 64 - width); - if (!(mop & MO_SIGN)) { + if (mop & MO_SIGN) { + ctx->s_mask = MAKE_64BIT_MASK(width, 64 - width); + } else { ctx->z_mask = MAKE_64BIT_MASK(0, width); - ctx->s_mask <<= 1; } } @@ -2354,7 +2350,6 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) fold_setcond_tst_pow2(ctx, op, false); ctx->z_mask = 1; - ctx->s_mask = smask_from_zmask(1); return false; } @@ -2455,7 +2450,6 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) } ctx->z_mask = 1; - ctx->s_mask = smask_from_zmask(1); return false; do_setcond_const: @@ -2649,21 +2643,18 @@ static bool fold_tcg_ld(OptContext *ctx, TCGOp *op) break; CASE_OP_32_64(ld8u): ctx->z_mask = MAKE_64BIT_MASK(0, 8); - ctx->s_mask = MAKE_64BIT_MASK(9, 55); break; CASE_OP_32_64(ld16s): ctx->s_mask = MAKE_64BIT_MASK(16, 48); break; CASE_OP_32_64(ld16u): ctx->z_mask = MAKE_64BIT_MASK(0, 16); - ctx->s_mask = MAKE_64BIT_MASK(17, 47); break; case INDEX_op_ld32s_i64: ctx->s_mask = MAKE_64BIT_MASK(32, 32); break; case INDEX_op_ld32u_i64: ctx->z_mask = MAKE_64BIT_MASK(0, 32); - ctx->s_mask = MAKE_64BIT_MASK(33, 31); break; default: g_assert_not_reached(); From patchwork Tue Dec 24 20:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853215 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081324wrq; Tue, 24 Dec 2024 12:06:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVFC+XYYxM+6vH7/uBusOMMGaRDIsnK/LB1y4NHb+o/Z/CB3IoaluW21h9QgK3XYhiu1Ko4YA==@linaro.org X-Google-Smtp-Source: AGHT+IFFvspCqB+jdR+b+Wo03BMHyhzixRpuNbFF2T0n3lNnwvxiV/+NWHbp/CBiXDB6HhhfoB1p X-Received: by 2002:a05:620a:2985:b0:7b6:6d5a:d51b with SMTP id af79cd13be357-7b9ba8102a1mr3138260685a.52.1735070808970; Tue, 24 Dec 2024 12:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070808; cv=none; d=google.com; s=arc-20240605; b=gxxap+PuRt91IB7rAiwI5m9cVLgRSjMFKp239HKgnq8/bAsQ34roNbVDRgCRcYalwR o3n5AjyKpqU8CIatrJe+YMw6h9GZxrkmrDbLhRagOeod3ENIlrggqcbQYcFU1ZxqmvoR EVXdJIM+vSzwgERJUOLqYB6/bAuvEGL5lRe0JkkZVSGyHg0j1wTdGl/x4x1EzGHlARAv zo2rgg9fTUGIVFzjRDbgDkGL9puVawWgzg9E3rFkZ4ptk49tHeLOAMQHhkjrlKPWFjeK 5HrEUPuNUrpnIaCQwWVfXeiKUwZbcG/3xFkal3lGlJGVQWwB4yJly+i6G8m5AWD3kUhC MP0w== 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=UguTmxMFL4TTxOKQ146kQqPat3A///6xR4q4RSBU0vs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=BBkH+NJ8y8AW+daJ1fFTI3Fes5OIf1uaHGl9HZOW7I8Gh27ghIGF2om8V6WHq5/IBG /1jAgjOStVPg6EfuRmb0rupnuOWcx/R68YW4RlaBmmnym2c4xPJfEMcoDRiRxtSQfBJ2 t2nDW97mPs7UIC7+PscTPaI6IcBbMoEiZgp8YJIMHIjNnqKPtmdZwd3C3mSv7LKZwD25 Ev1yvgKWRU9EMdXVJ4jNWZ/u2+DXOW0263jAK/TJNuFObXgZQCUAbo7XMWOgGb5vX8YD Fz24RlWBSB6FYJAjw+O3vIDDz/fxwarXJEkv3MRrXRrQi7gL9TuiTuuRzi3Ui+V6ce7+ MzCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ggxvILR3; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ec0adabsi140034591cf.726.2024.12.24.12.06.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:48 -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=ggxvILR3; 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 ) id 1tQBAA-0002qC-Dn; Tue, 24 Dec 2024 15:05:54 -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 ) id 1tQB9o-0002kf-Ra for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:34 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9n-0002Xe-4K for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:32 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21683192bf9so61841305ad.3 for ; Tue, 24 Dec 2024 12:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070730; x=1735675530; 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=UguTmxMFL4TTxOKQ146kQqPat3A///6xR4q4RSBU0vs=; b=ggxvILR3vS8BOiNzHCattKWGCWjrkje5nrcJRRaAiVG+DDOa/UO2s0Ymu5wCamRSJq OM+zbfXeW3AmLFx9O6hsnrrPDvYDIHXM23tllJeN9aiSdlEO9z02Vhs4e1g7VDuw9A7a Bgsx+yK3d0JzuAMqhHx1rgSpKsCECqTAElr++XrsVHton9pNFuwIY/GkswIVylufs1Mh C/LbzPa7cWSY3Y7v5YSXWGuYN/oOYeRwN2eP5D8onnQL+gQmpXo9ED/ZWcykPxx7UeSB kitqNVj30+gnwiILbWOnAehxewPf+5i9obQtdy0ieXEC90/XsEsAGD9f+hZ6TSS2K9sX OLjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070730; x=1735675530; 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=UguTmxMFL4TTxOKQ146kQqPat3A///6xR4q4RSBU0vs=; b=m8ZAEzFdn2PlNsE3CxEMyrrmhqt3xKXK+1YM7tuZU7RmaD2AubymNo+97SntaELiki qG5Ajw+OcmrPmv7k7LDy34CFpDPzK5gGr+hs05yr3m6uqwnJWzAa9FrlfFg5k0lblOsL 5kA2m2KkKkosG4i7U92I0IfzdVnpJtLGi3UAfAILjNmFrT8k7Ud/TPdk7kaDceMYQ+9q BPrb+teVIOlYvvH428odeJVS8ttanILwKkBZRwXzn0mJ/LQQ+C6qqciEAZCMeij33w1e LdhIa5c7FJn5ispOjnd926G+aRtTTOmFLYnRHUEzET1uHGFjUqSBTQK34Xr/ejUZHL2j ojLg== X-Gm-Message-State: AOJu0YzqNGs7/BBTKzEh7YFodQYBKiMR+6Tjgq0KU4JTAehAynHjUvUo BGSQ5WsI2UKVFRabNTBnMIDjYmBUQlfXzQET42gOhoBunKOzX7XMPTFAgl8wCkMnHyZP4Mkicsp z6AI= X-Gm-Gg: ASbGnctN6DdvrJQ6MYogbxIRt/Qn8f87mV9Pr9ibE69361FCLz+SGbjSLRvpq5BKSU4 RvPZ2h0dhRnAD+MO0DMI9qSqPizBa5iPUkVRsZH/bNvHYS067M1AiZnCo6mBkKrO0xUpOojJHAO RwaXPAPNAKGJO9mJqwQlRyMhQ+ZSQWIRDQMDFlx2PdakzDjqqJd8brpEHUdyyiSzkSBpUQUY7+i 0KNWdlGTFhUC9IB3Ze+x3uO/qeKb/j9wvLRCwePZBC9spOMcB8thV1OHQuA8WnKSW577F95mlts 4MSUa2N4pK8e2AQvyW8hz9EBrg== X-Received: by 2002:a05:6a00:44cb:b0:725:1d37:ebff with SMTP id d2e1a72fcca58-72abe0960c6mr24861733b3a.22.1735070729831; Tue, 24 Dec 2024 12:05:29 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 08/72] tcg/optimize: Change representation of s_mask Date: Tue, 24 Dec 2024 12:04:17 -0800 Message-ID: <20241224200521.310066-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-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.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 Change the representation from sign bit repetitions to all bits equal to the sign bit, including the sign bit itself. The previous format has a problem in that it is difficult to recreate a valid sign mask after a shift operation: the "repetitions" part of the previous format meant that applying the same shift as for the value lead to an off-by-one value. The new format, including the sign bit itself, means that the sign mask can be manipulated in exactly the same way as the value, canonicalization is easier. Canonicalize the s_mask in fold_masks_zs, rather than requiring callers to do so. Treat 0 as a non-canonical but typeless input for no sign information, which will be reset as appropriate for the data type. We can easily fold in the data from z_mask while canonicalizing. Temporarily disable optimizations using s_mask while each operation is converted to use fold_masks_zs and to the new form. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 64 ++++++++++++-------------------------------------- 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index d8f6542c4f..fbc0dc5588 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -52,7 +52,7 @@ typedef struct TempOptInfo { QSIMPLEQ_HEAD(, MemCopyInfo) mem_copy; uint64_t val; uint64_t z_mask; /* mask bit is 0 if and only if value bit is 0 */ - uint64_t s_mask; /* a left-aligned mask of clrsb(value) bits. */ + uint64_t s_mask; /* mask bit is 1 if value bit matches msb */ } TempOptInfo; typedef struct OptContext { @@ -65,49 +65,10 @@ typedef struct OptContext { /* In flight values from optimization. */ uint64_t z_mask; /* mask bit is 0 iff value bit is 0 */ - uint64_t s_mask; /* mask of clrsb(value) bits */ + uint64_t s_mask; /* mask bit is 1 if value bit matches msb */ TCGType type; } OptContext; -/* Calculate the smask for a specific value. */ -static uint64_t smask_from_value(uint64_t value) -{ - int rep = clrsb64(value); - return ~(~0ull >> rep); -} - -/* - * Calculate the smask for a given set of known-zeros. - * If there are lots of zeros on the left, we can consider the remainder - * an unsigned field, and thus the corresponding signed field is one bit - * larger. - */ -static uint64_t smask_from_zmask(uint64_t zmask) -{ - /* - * Only the 0 bits are significant for zmask, thus the msb itself - * must be zero, else we have no sign information. - */ - int rep = clz64(zmask); - if (rep == 0) { - return 0; - } - rep -= 1; - return ~(~0ull >> rep); -} - -/* - * Recreate a properly left-aligned smask after manipulation. - * Some bit-shuffling, particularly shifts and rotates, may - * retain sign bits on the left, but may scatter disconnected - * sign bits on the right. Retain only what remains to the left. - */ -static uint64_t smask_from_smask(int64_t smask) -{ - /* Only the 1 bits are significant for smask */ - return smask_from_zmask(~smask); -} - static inline TempOptInfo *ts_info(TCGTemp *ts) { return ts->state_ptr; @@ -173,7 +134,7 @@ static void init_ts_info(OptContext *ctx, TCGTemp *ts) ti->is_const = true; ti->val = ts->val; ti->z_mask = ts->val; - ti->s_mask = smask_from_value(ts->val); + ti->s_mask = INT64_MIN >> clrsb64(ts->val); } else { ti->is_const = false; ti->z_mask = -1; @@ -992,7 +953,6 @@ static void finish_folding(OptContext *ctx, TCGOp *op) */ if (i == 0) { ts_info(ts)->z_mask = ctx->z_mask; - ts_info(ts)->s_mask = ctx->s_mask; } } } @@ -1051,11 +1011,12 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) * The passed s_mask may be augmented by z_mask. */ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, - uint64_t z_mask, uint64_t s_mask) + uint64_t z_mask, int64_t s_mask) { const TCGOpDef *def = &tcg_op_defs[op->opc]; TCGTemp *ts; TempOptInfo *ti; + int rep; /* Only single-output opcodes are supported here. */ tcg_debug_assert(def->nb_oargs == 1); @@ -1069,7 +1030,7 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, */ if (ctx->type == TCG_TYPE_I32) { z_mask = (int32_t)z_mask; - s_mask |= MAKE_64BIT_MASK(32, 32); + s_mask |= INT32_MIN; } if (z_mask == 0) { @@ -1081,7 +1042,13 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, ti = ts_info(ts); ti->z_mask = z_mask; - ti->s_mask = s_mask | smask_from_zmask(z_mask); + + /* Canonicalize s_mask and incorporate data from z_mask. */ + rep = clz64(~s_mask); + rep = MAX(rep, clz64(z_mask)); + rep = MAX(rep - 1, 0); + ti->s_mask = INT64_MIN >> rep; + return true; } @@ -1807,7 +1774,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) ctx->z_mask = z_mask; ctx->s_mask = s_mask; - if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + if (0 && !type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } @@ -2509,7 +2476,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) s_mask |= MAKE_64BIT_MASK(len, 64 - len); ctx->s_mask = s_mask; - if (pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + if (0 && pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } @@ -2535,7 +2502,6 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) ctx->z_mask = do_constant_folding(op->opc, ctx->type, z_mask, sh); s_mask = do_constant_folding(op->opc, ctx->type, s_mask, sh); - ctx->s_mask = smask_from_smask(s_mask); return fold_masks(ctx, op); } From patchwork Tue Dec 24 20:04:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853264 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084178wrq; Tue, 24 Dec 2024 12:16:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJNCulEL3EbIA650vesxetIYD66OooVxhX0GJ1Z51zjYlSJwi5wS1i0bntCYssydW5DnSjEg==@linaro.org X-Google-Smtp-Source: AGHT+IHZUD0wNIr9jCQB7jbJFgMnFhRKZ8oCugxyQzh9zPxYTbNT5IHJdjli+KYMa275nNq5r3rg X-Received: by 2002:ac8:7dc8:0:b0:461:169e:d2dc with SMTP id d75a77b69052e-46a4a991a62mr259593611cf.49.1735071369473; Tue, 24 Dec 2024 12:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071369; cv=none; d=google.com; s=arc-20240605; b=co5LY0RcyJwsDY2+8Xvnv0woeRQzYgcalbJrHr/dBKw9KJm2q88aN5+tLWJCZOUecb jlRr7AlePwL+vmEhOdRg9N/sDNVQ9JbhaabUYLWBiX5qYZ9SgdDUOV9RUnrcmI8Bxzaw KL8Zd8+qm2Y+bX9qFAxGO1hhRTpTqDUi3eGX/f5E3gJsS1X6cIa/0wC48ZGdhNzP5DSu 9oElZOz1INnKdY7ESMetjrDSL5Zs4DNJ6VMFVV6J11840RG2eb0GCTVvdlLPs+ZPF5cj GZx9ddFQpRqlxSkBCBkqmUqCmSDKGBg7ntKpp7TWSS1Haph4T5/cOXIJuX2n6wowco42 SyHA== 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=ntKzLXVCf+dfdJqwHevl/7NkCe78JheCkwV4PXcpwhs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=eKUBNIV3jCtvaSK3A2OPc4OJV2ZkUJGyfaaQZlDr0AQPL/CszqLuGgR6LBwA9tGsSN OfCWy8IO+EV3OKuAheAtToHTLfDuRBM3Vx/IbnHMGZ1nieItWRLH6L/T2lAEzJAN4A62 io0aPGZsn3EWa6Pfkgxgs0ZjWqEVlBeHwu4+wOCO9b95gjtEmATbuINYvMVagcITkyUD +g+/2Bd7GKhZzIvRk0vLEiwFcPNqCIWS7j63akuKEdfAlcCwCWnUdqjKpo3z32f55yxt YU9GnGAK4g0wFoeGALE2FBLNWsI1+Ado+ZXsrJ2SZuRuwb7MpeufxcE4BZdOk22w481P sp4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Unh/ig9G"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebd65d6si139420451cf.554.2024.12.24.12.16.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:16:09 -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="Unh/ig9G"; 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 ) id 1tQB9x-0002n8-8x; Tue, 24 Dec 2024 15:05:41 -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 ) id 1tQB9p-0002kh-Iq for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:34 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9o-0002Xs-5k for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:33 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-21661be2c2dso51061105ad.1 for ; Tue, 24 Dec 2024 12:05:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070731; x=1735675531; 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=ntKzLXVCf+dfdJqwHevl/7NkCe78JheCkwV4PXcpwhs=; b=Unh/ig9G8US+z/9RSgAEzWn1xkrz/udN6OUZb20HfBuV+VPNbwG1Q2h49hTLyFq8iX wLJL3lMu5kZw2560Gf6uJoK1zYc01SpkECZ3edevYhZ+cCs6cux5GTYUCZ45jhB1Dm9+ NYT5CkFSN+5IRAzE8rSCt1+e8p7yOUiqUJ9XoP5yc2gtVEgtA7OhvsZmQq53MLdhyKL2 A8qqJOf8eR5mogiY8VYuggdTpNXut7M7fju7TDF1hTf7PLmMiHA14vzKu8QOwQPz4VLu 30xT4AglLB8CN9oNWqMRbwUTUeemanAwC93uTA2OeygBZyxuMBNRdGKiKSAAg2plHSAI S75Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070731; x=1735675531; 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=ntKzLXVCf+dfdJqwHevl/7NkCe78JheCkwV4PXcpwhs=; b=UFHWZsxuCRM5V2F2NY5YRf56geIHYhZjDEgKk40rP9F0GkMMm4LY2etPjxljzsqSjS kYbbOYjBNDqxyJ9ZFoCMOSUaxAV8UKyrhO+2ZgCqnkVSbeFGisbXqQP+Sb2J23YSxCxH d8ca/r3ESyRet+2+j8+DcyDc3bh/w1PP0cm0y+05WrTLNYW9H0ISPqPxW8Bx/sCwJJXM MUgB2bh0LCGBW5e+iCzzR/uE/VJztlcZE+Lismj2vi0A/J+xLyDn7kObd1sJA1pxqMFo ViTfwJ2jalm2TUj92LWX2eaBybhRLVvX/1RexN4w3+MP5T7tPSxWLDT2x71zbLMUUxKi v7lQ== X-Gm-Message-State: AOJu0Yy3UGZzaaYRvRUv7R3BEMyXapjz2b18H1GFF+M3Jw2fY93FrYuB WrBS/ZX9+Yw+FTkG6UiX4FtHs7gWhefqiihrAsYHLjK82FamA/hUdXcjbcuw843rpiKs5DEeegp Z8lM= X-Gm-Gg: ASbGncuu2Hkl3xCLutLEvjqZNY06jOIs/3raMf21ac3TxXFATRyVnpVMK5vradw/O97 fuSylQRWFi+XUHmhD6epJOX8WMAs5oN68gWAWFy26s46V0G7mu+IpAkZeTe/1b50cE4dj6fQru6 e+uAy0n4bG0mKPlH+BKRmJ+2lEK8FOY7C1SQIq/KJMZCiNjI/5rvDQP3HTSu+Vm+/fd7WPtKUTZ Rr+An7fv8fOIoD+nkj/7kew+pFGnG7RydzAxhdgFqCHY0s/yrxFA4xGuUg0lgz92SHL5JWkryUk tfv39ewjkAPYCOJUUzkaWLBkSA== X-Received: by 2002:a05:6a20:430d:b0:1e0:cbcf:8917 with SMTP id adf61e73a8af0-1e5e048ce0amr24611347637.21.1735070730797; Tue, 24 Dec 2024 12:05:30 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 09/72] tcg/optimize: Use finish_folding in fold_add, fold_add_vec, fold_addsub2 Date: Tue, 24 Dec 2024 12:04:18 -0800 Message-ID: <20241224200521.310066-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index fbc0dc5588..26d1c5d4a1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -938,7 +938,7 @@ static void finish_ebb(OptContext *ctx) remove_mem_copy_all(ctx); } -static void finish_folding(OptContext *ctx, TCGOp *op) +static bool finish_folding(OptContext *ctx, TCGOp *op) { const TCGOpDef *def = &tcg_op_defs[op->opc]; int i, nb_oargs; @@ -955,6 +955,7 @@ static void finish_folding(OptContext *ctx, TCGOp *op) ts_info(ts)->z_mask = ctx->z_mask; } } + return true; } /* @@ -1188,7 +1189,7 @@ static bool fold_add(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } /* We cannot as yet do_constant_folding with vectors. */ @@ -1198,7 +1199,7 @@ static bool fold_add_vec(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add) @@ -1265,7 +1266,7 @@ static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add) op->args[4] = arg_new_constant(ctx, bl); op->args[5] = arg_new_constant(ctx, bh); } - return false; + return finish_folding(ctx, op); } static bool fold_add2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853223 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081634wrq; Tue, 24 Dec 2024 12:07:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWAzws1h0Ycb1zjnFHgWqeqtu7DpRGsUFUHZOYE5RrDZ+7qkrXmJ0ebBiUVYFQ6a/F3Q9cPiA==@linaro.org X-Google-Smtp-Source: AGHT+IFI4GK1LjIgwlp09rclkUeA0hEhgavCHritiyRom2v1si9+2b6fNBe0fe/h0vBKQxI6NRgy X-Received: by 2002:a05:6214:c4b:b0:6d8:7d6b:cb78 with SMTP id 6a1803df08f44-6dd233af5dfmr311650386d6.47.1735070869856; Tue, 24 Dec 2024 12:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070869; cv=none; d=google.com; s=arc-20240605; b=LGLzg3Qk45DKxQOOm6SdvdLDX7ROAVMMGwQjWu+G2LA+SR6x/ShGOPQEw22sWkbdyF D8LqqvjNs6NFXf0SHyrj2rHIBrseox0rwWcA0gKRwNafUe1lWQ8ryQkAzpE2dn5dGXJv 6ZK8FltGIM+ayRjzMTPVfScyWIZ8XW2pnJTkC80c4/sOsxTFGAqK1Tdhd0BKNCx9xtQy z+LbWnfCx1xWaNaqz+bqDU6VW7la/+isGZV5++3hN0NDZb9aMRyAx0w0twqugMz7sii8 DZ79yGa34bUCuz+IQvFeYhcfNzu4S9w5A4OKtunK4FYSP9GborMWCiShvIgx8H4cysIo G6tw== 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:to:from :dkim-signature; bh=MvL7unhiDd3lPuRXr6mq82bN6R8xw9zcqDFlejItlQ8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=iHx5Z1jEaYOyJ4V1tSYtx50fWNbCxTOLXIZApPJpYvpJ8Tha6gX4cbrsFXu+SHxvz+ h5zdAuLvi0JeSHiPcMwkuKTv1IHIO7D8DCjXzVzyOFvl3NUwZZnRrBPBwnR3bDpsnVQG vWJmm1pfjHnP5PxzKs+ELC1puEK6tEL6EW873DGnbVONXp6axpFt9V8308bBm1HPCPO3 mK+Y9Xll9YiutH5TOQDeM2rUxagDj5FS7jmMxkzHbDDsxdDXW09Vc0BOXYGZ/++aId66 gwHV4cIXSDxNeXojaOeFY55RiQbz8GwW2S86cqDnSpPQdXT/zkSHnr7DjHP8XzptJvVx fqcw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YkAKyEFe; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd182505e9si134285076d6.316.2024.12.24.12.07.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07:49 -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=YkAKyEFe; 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 ) id 1tQB9u-0002lv-Ic; Tue, 24 Dec 2024 15:05:38 -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 ) id 1tQB9q-0002kp-TR for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:36 -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 ) id 1tQB9o-0002Y1-V3 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:34 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-21649a7bcdcso57354525ad.1 for ; Tue, 24 Dec 2024 12:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070732; x=1735675532; 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=MvL7unhiDd3lPuRXr6mq82bN6R8xw9zcqDFlejItlQ8=; b=YkAKyEFepi1p/NeYSv+IOTBD0qRrkdC9/sEd6CrACfgjNhpTEpEvXZfIdbIGtJI+kL tmD/KuAK53eZaotCkhOBWHoeYQJ05u/kIiQ8BnD51+nQDx41CgazTUvZQMahV5GZrGN6 WDHMHCXOAVzHoCrvxGDzQ0WPzg66T9G7kXO0bTrUiJ94E6AIg/QAGq6ZVi23qKwFIsuW aZj1AGl4ebudsogynIS/BHJMxniucyTCL95IIRbDu6rJL5ioTHZYO/EIs6aUNmSsK90C yyGAL1yFWK7lM0tawhauPEv7THWbIimnoU/O72ezFT1lE6oZ1pNkjXwMyZf54Lp6acLb b+kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070732; x=1735675532; 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=MvL7unhiDd3lPuRXr6mq82bN6R8xw9zcqDFlejItlQ8=; b=RDLEhlX7kq/YAp40EZwuMrHWSM95/a1SgNwS36nhII+Ighil1jXfZh+XDjZQcJDusj c5bUodfNJtoxkULwxqKj4j+EsV4LPwrbjrTAV9ShJFHYisXkEibBQALm3v9jYBaFvNm/ 06oOSjMODtTbYK7lHHktFza41TLfckbkwb+VtJyW+DoHID7E3pj58GD3hOiyenbgpftz W6rfibIDCVsFLdT8+YUoCzTAPV1f810Ly6Q8+Z1HeFO7PHXYRUxN3jvvjZzwAxcBFCGx 73dE4wKkR8cs0konGtypoCu0gqwk/AmgFTQievzDqdgt56tFlbnF38scjgwIX2NLp/1b JkSw== X-Gm-Message-State: AOJu0YxibKUj8OOGAicXcUoYyt63c5aTrA9du3vaf6+urRTDLdlbCChg y0n7KGRbjZP5toam1F1gcXHrak5Dp+rSBrRxsdtdWwcj7tI3ZETtsiQXUWFCblbyIUzZB+8ZMO/ nebc= X-Gm-Gg: ASbGncuA5EJZC6SGvBe7J08SUXe2aIA3FCkY/zFptly5yR7d70orfzOB5Mu4b27wG08 WzG1XJSqBORq+BTmqJK9c97t2gW75tJQwy+S2MEqcj1t12HHC+190rf9Ec8dBXzJM8cpH6d7GM4 iIqN/bv4ODkGTXGdofNLWAC+OGO9k+PzuYC5G4oS/HYcpLyb1+BC1IqHRdsAveRceL5zT7XkTJi ecMJBXCeodQYcG9gKnm5bwoP9W9miJoZHlMIfK2aExCGe1NpQy2/u1L+AsMEvIlvZgv0zuIhDjw 9/IZdc3G8td5xoYG6noSPmGA8w== X-Received: by 2002:a05:6a00:4ac6:b0:725:e015:9090 with SMTP id d2e1a72fcca58-72abdea0803mr21685710b3a.9.1735070731748; Tue, 24 Dec 2024 12:05:31 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/72] tcg/optimize: Introduce const value accessors for TempOptInfo Date: Tue, 24 Dec 2024 12:04:19 -0800 Message-ID: <20241224200521.310066-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 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: 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 Introduce ti_is_const, ti_const_val, ti_is_const_val. Signed-off-by: Richard Henderson --- tcg/optimize.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 26d1c5d4a1..5090f6e759 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -79,15 +79,29 @@ static inline TempOptInfo *arg_info(TCGArg arg) return ts_info(arg_temp(arg)); } +static inline bool ti_is_const(TempOptInfo *ti) +{ + return ti->is_const; +} + +static inline uint64_t ti_const_val(TempOptInfo *ti) +{ + return ti->val; +} + +static inline bool ti_is_const_val(TempOptInfo *ti, uint64_t val) +{ + return ti_is_const(ti) && ti_const_val(ti) == val; +} + static inline bool ts_is_const(TCGTemp *ts) { - return ts_info(ts)->is_const; + return ti_is_const(ts_info(ts)); } static inline bool ts_is_const_val(TCGTemp *ts, uint64_t val) { - TempOptInfo *ti = ts_info(ts); - return ti->is_const && ti->val == val; + return ti_is_const_val(ts_info(ts), val); } static inline bool arg_is_const(TCGArg arg) From patchwork Tue Dec 24 20:04:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853240 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082272wrq; Tue, 24 Dec 2024 12:09:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWdmlF3KHUwuZMvlVsvOyqjNTwpj+ASSgCf0VHBhkQLPachLmNeDIowfF+/iAB5CzznSFVqHA==@linaro.org X-Google-Smtp-Source: AGHT+IEIIfkVICp+5QkIhbVqHS3wwCGxd/AwDxvOxfeXcbQxeVoG35LpmEeymV1/Fj+QkVuTYpB9 X-Received: by 2002:a05:622a:10c:b0:467:68a2:cb55 with SMTP id d75a77b69052e-46a4a8eb7eemr283110861cf.28.1735070985127; Tue, 24 Dec 2024 12:09:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070985; cv=none; d=google.com; s=arc-20240605; b=SeXH07cQmTQ+uEnNiTxFLj17561zmjWtH2BBVLV7avR6zcd2Dmn00sw6l2Jfd6w89f /pree8gl3f+9VfUBr4fstJk/IT5tE3heSJJM4UDmFnWTXx4vw+pRxs1zaTSeY++VHEZD YE7SDRybAwcyStBGlJRcaN706BGrOZJvjOaPyagOZHq0knqp/GXiR1hwo5lrH/HBbFLx Q0fLb3G32HlpqBumXM5OZkurMVXOagtoKfhiDHsQNfO1IswNB83hHg3ZhJ6Gr/ssoanW HrkTvB4iswOz7CIUD5QwlbkH2wcofu0ukf6FiqFtez+N59AbIbNkZgSuxueYrzXuVbpo EA6g== 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=hpqpgVCVgx0sIQuZRDJGY03SPPXo8ssS0CTWPjNfIQM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=HOScRnPMWtWVl1vYBWIFZz3SnJjamNmFoq5gE57vo2pMpAOkQG7BzboNwOEN6okf1s Ijk/XTYjavodq4bTFimCamsMMEzlZoJM8RK57fCX8RIWdCeAwLBQtWAlKLEPcy10RaYn bAEkjZNoGP800m2BOu9FAfTsYIvdO8MDiaPzCjUkUJJLdiweCFZCGBwSRX3ymN4Y09lH IhB+dzcpPghrqSdNrJ+Bl+g9Bg/g/xmN32GOn81UMBcko6afQEZdlWWWsMVIeX9+Ndl7 JKunE3BvPdvbL1VydMqKSzV7/4Wb8DbYob6NmW6uH5m8hggRvbcr1GyorJGPyAgn7lKw P44A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tx0ERFhm; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e6817absi157312251cf.27.2024.12.24.12.09.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:45 -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=Tx0ERFhm; 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 ) id 1tQBAU-0003O2-1X; Tue, 24 Dec 2024 15:06:15 -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 ) id 1tQB9r-0002kw-J7 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:36 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9q-0002YC-4j for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:35 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2165448243fso66700385ad.1 for ; Tue, 24 Dec 2024 12:05:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070732; x=1735675532; 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=hpqpgVCVgx0sIQuZRDJGY03SPPXo8ssS0CTWPjNfIQM=; b=Tx0ERFhmSuQSAnPUkhaOkpsKzaU2ICcLwa7+EWwS6qbL5L2nebL8EbOXPqBG74czwM 1DlSQFHk2dQda+X/etHqVJSqLcXrnwdOxk+dT3ja585O4ZlGA3MhU5nYwF5P0+F0uO4l n86GmhAPX+3mvzBbGeIqTIns6JFqZyxs6AKfhMIasQWeI5mWZKsT3GuWLGZbVMh4UVdv QmC3/Z+E/6bKapKryT8Q780jjuWg9RmvxaMOmgK0x6Y5V0vOkrAQEsZ4DgmCO/e1Kf5Y 6EYyf+hx/pB5RAA8bKo04y+L78tEMVgUbfJT18FEygD00ISnMve+6piE4W4KAe3ui6Me V9gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070732; x=1735675532; 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=hpqpgVCVgx0sIQuZRDJGY03SPPXo8ssS0CTWPjNfIQM=; b=ducOX/NDk9suXOYdhsuDA9NDKcuY2bpK+0dVCg85pfSHPI+8ECMVtkCkGiBAn3US3t MMro4ZF2Sf2GttaAafgnyDHmLtVFkCPm24qNYzFIMgk5fiJkxNfYDng0heHQ+s7VVimb FlsfK5IB24tzAU5SGIaqLa0OaeOU2KTl94xv6NhCcZDixE/wBUt2oMA+TABkQu7uAD9I sK7rnt1WBNVDv8exESMvjJ+l89Me0q5rVJiv+SKExmnnAQ4kvG4V5loqnjHbX15dYkuD bEiIoHfM455vNkgGCrnjrJedURvywT2EFsqVImSJiWR40rjnnxODbjVba4GmUmw0FXmL GgsA== X-Gm-Message-State: AOJu0YyLxlhZJ+ircqRk++Lk/qilngZ8+k4IXKturwnploc6aDYjlf6x Hlw6f6qwiClaLaSeIy0KI4U7m05wmoYYeGFPj5mMDueBqvGaSfMjuYtG7STQfGko8H+YoiDI7Ga v01A= X-Gm-Gg: ASbGncsIvmsmojE085m8AykEwae+ZeoCWK/7lX/75j1hvcilz94aWNJ82s99YLAFmwD nAqVDFanhgkzJRRrRx4pBuO61gPoPqcSUZX2pP4zZaq/bVsARbQXivTev+Tn5829ujMW+Ntwx6r xxoOXkAeUs7N4ei/aKm4B1Gwi2du6bKEdtphySUOr/WkzBq+iePrFVQxxmArQEeVHrqZ8NTTiPm oyr0U0K/Cm+5LIWOBinu1H6If7o0CLnblskOckalNYBppMgfXzIf39o5iTL6wQB+1ZeO2WtI3EQ CP99Z4HYDna56XpeaLL87ThBQg== X-Received: by 2002:a05:6a00:8085:b0:725:e309:7110 with SMTP id d2e1a72fcca58-72abdd3bf64mr26835076b3a.5.1735070732617; Tue, 24 Dec 2024 12:05:32 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 11/72] tcg/optimize: Use fold_masks_zs in fold_and Date: Tue, 24 Dec 2024 12:04:20 -0800 Message-ID: <20241224200521.310066-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Sink mask computation below fold_affected_mask early exit. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 5090f6e759..4a5b52916a 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1294,7 +1294,8 @@ static bool fold_add2(OptContext *ctx, TCGOp *op) static bool fold_and(OptContext *ctx, TCGOp *op) { - uint64_t z1, z2; + uint64_t z1, z2, z_mask, s_mask; + TempOptInfo *t1, *t2; if (fold_const2_commutative(ctx, op) || fold_xi_to_i(ctx, op, 0) || @@ -1303,27 +1304,28 @@ static bool fold_and(OptContext *ctx, TCGOp *op) return true; } - z1 = arg_info(op->args[1])->z_mask; - z2 = arg_info(op->args[2])->z_mask; - ctx->z_mask = z1 & z2; - - /* - * Sign repetitions are perforce all identical, whether they are 1 or 0. - * Bitwise operations preserve the relative quantity of the repetitions. - */ - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z1 = t1->z_mask; + z2 = t2->z_mask; /* * Known-zeros does not imply known-ones. Therefore unless * arg2 is constant, we can't infer affected bits from it. */ - if (arg_is_const(op->args[2]) && - fold_affected_mask(ctx, op, z1 & ~z2)) { + if (ti_is_const(t2) && fold_affected_mask(ctx, op, z1 & ~z2)) { return true; } - return fold_masks(ctx, op); + z_mask = z1 & z2; + + /* + * Sign repetitions are perforce all identical, whether they are 1 or 0. + * Bitwise operations preserve the relative quantity of the repetitions. + */ + s_mask = t1->s_mask & t2->s_mask; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_andc(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853216 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081360wrq; Tue, 24 Dec 2024 12:06:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVgM8wjuux+rdeCf1cAxy31cEwE5zR24jskqQvDnL91ay46ERsxlo0LQ1YIRkMRwJL0eCbG9g==@linaro.org X-Google-Smtp-Source: AGHT+IH+RXWpKZMd3vTdPgiDzz4Aq6ZIgK/j0JE+xmPauvHP+lxxyQo8A+oJfq5aB8aivJ6Ncnvk X-Received: by 2002:a05:620a:191f:b0:7b6:d3e5:4f45 with SMTP id af79cd13be357-7b9ba79b519mr2973063685a.30.1735070816375; Tue, 24 Dec 2024 12:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070816; cv=none; d=google.com; s=arc-20240605; b=NsFq76zS3Fqt8+PrtMaShb9GxM+Kt0sk10ZoyB4NKcpoXxGqYii6A9GBiaySjRjR5c gUCmIpiZ048DAz+mOPhvFJIHJlTHTJ74NhnrKONri/1jMhvunThEt1crzF/wz/DWG6+0 Lk2itd+JYqHJZhsqzXoh6rudg7eUrzTPPTC6zxpuhzYkNpwmBh4FKpsSO5OPwz3W9riL 9OBF9/UZ8iTNgOTXgq032ohTsfUgQ9M9aLi41TuXdCM9tzBPhLQgYvFMAbjGNDdurZ+e zSn3W8jt5kq3qaGiQ3ewc6ej9/gUV7c2fvrR8AbbPjt57T3RNtfDHpzSGlhQnIP7o9tn OQrQ== 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=pZ0KIsF1BBfIHqPWVMCdpClBho97FcY+wzgcx7bn3Cs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=OiXFsXFmZsPvK03KnYMjj6hCOlp/LtHcXP2ERJeJ5W7e6so+24FR0vJCTaMpKNZxdh u312nzIIjOFuxWqFS8ZvaeBcONi9j4OF2jJOqkieGEmmRKB0sqGYSMyvnjDzu+aVKAMM zkR72mnvhhaFlQACCGLwInwzBCLifqhmNKDx3zPYilAqIYZT0rPxUh44NKy0SN/aqwnc 6uQFIDyISduCv0yM565u5g/ssAO1eg74Hpabsw3T29SZiXfDaeOAtZTx7pgIdUVqAnCh hPgNhcFZGCtqw6ax3tpoUMbVNkNkLYK6QuI3p9IACv7HwwFaDb8hwmWFC1ADbWwE015O O9PQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=whvym1ej; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2cba48si1356361585a.182.2024.12.24.12.06.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:56 -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=whvym1ej; 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 ) id 1tQBAF-0002yj-MC; Tue, 24 Dec 2024 15:05:59 -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 ) id 1tQB9t-0002lV-0t for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:37 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9r-0002YL-9K for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:36 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21675fd60feso73525435ad.2 for ; Tue, 24 Dec 2024 12:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070734; x=1735675534; 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=pZ0KIsF1BBfIHqPWVMCdpClBho97FcY+wzgcx7bn3Cs=; b=whvym1ejpDLxcBCimTNssEFz4EZQR1b1FBqicwIehHEDNOM78yqxhJFoqfUmPMMrNR ZJ5TEceHYkCxy2bB2MwgEV2zJAwLo6rNp+VMIqFis77Nh78720ASQHcDaSTifaR8BhZy diz0NOvvnEXB3wu6J6unSUVs0r6jO5XiAq987T+OOJhNK6ULjov1Bo4PrjGOxS5zYqE/ 2psBWewT6eztV03FaDP41w3eHAq/iq2h1L7/+UeL9cetcRhNxVpyjHqGHFOzywGmZi/M dJIn5vb9txUT0e5x36w+aO/KOJfH25uFxT51Z7sc5nzzJ1T08sMWApY1IX2L7jL+D/Dj NYOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070734; x=1735675534; 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=pZ0KIsF1BBfIHqPWVMCdpClBho97FcY+wzgcx7bn3Cs=; b=Oikatbx7Eob7MXCiUGIHuvkdBsVOJP+Ccsp9FZ6pT4un+xfTyhdryMh/jj187bZLRD FOl5KBuNxl+WLd/9leGqQHYOn7R485higaDDgUFi+7yrSPY962b7UpBvwiFtvAeKJSRF IKk4WDXOJyhxm1NH1VflRyND0iekUjyaFQ1lyRAUycXDUxEiZ2XJXe+apddddNwhGZjD /yU217GjdZYJtWVzcc0oFpGvpaLfzVmPADY1M9Vu30gJqhwoZRmeuFiBoRvNDgsQCvrI rbFWuFH769fTUfSYrKOZ0otGomvHJbbXYl2DLbTvqNx498RP1SK5smbt2qAKKrdxHttf QMPA== X-Gm-Message-State: AOJu0Yy+xMjmbpIxHys91hKP2ZWpPNWS2Zvq/2ok2gwZVwPA8il/UlD9 wPb7A1eo/6HubgcEC7vPLEyjqo2qEW/sqCPyY8/AqUaNdx4B9gHrnFPWf/p8xDtFiqFIE2Qr9C4 Bl4Y= X-Gm-Gg: ASbGncsN8AdKACo5QuqXsP/sLjKo8HG421Fx3pKz06x+wqo39MSVzXkB1sGi6YKY2zi 0ovisD3nSFMajEPZv28dufmn3ws3roPEKOfsxiNkXvckAx4pZhbQlnG22Xt75yB1UiE/60Wj9Pw kyUVyQF3K21/57kl47FWnuIX5fj7WfuCj695FrL7OaDFCUomqtjmvwnm5Q18b517T3FOcTlZxji 3frNe5JPqVWtX/29ahXDVyoWUrR0GUzd1JdxPb/8wvyFhX0NQ33jXD2Vr3vP9ouh8m37Geqayg7 nthc8Y8yoEjh9/F05Mv23tZhfg== X-Received: by 2002:a05:6a21:1014:b0:1e3:e836:8aea with SMTP id adf61e73a8af0-1e5e046f453mr32506448637.14.1735070733786; Tue, 24 Dec 2024 12:05:33 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 12/72] tcg/optimize: Use fold_masks_zs in fold_andc Date: Tue, 24 Dec 2024 12:04:21 -0800 Message-ID: <20241224200521.310066-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Avoid double inversion of the value of second const operand. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4a5b52916a..2096d705bd 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1330,7 +1330,8 @@ static bool fold_and(OptContext *ctx, TCGOp *op) static bool fold_andc(OptContext *ctx, TCGOp *op) { - uint64_t z1; + uint64_t z_mask, s_mask; + TempOptInfo *t1, *t2; if (fold_const2(ctx, op) || fold_xx_to_i(ctx, op, 0) || @@ -1339,24 +1340,24 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return true; } - z1 = arg_info(op->args[1])->z_mask; + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z_mask = t1->z_mask; /* * Known-zeros does not imply known-ones. Therefore unless * arg2 is constant, we can't infer anything from it. */ - if (arg_is_const(op->args[2])) { - uint64_t z2 = ~arg_info(op->args[2])->z_mask; - if (fold_affected_mask(ctx, op, z1 & ~z2)) { + if (ti_is_const(t2)) { + uint64_t v2 = ti_const_val(t2); + if (fold_affected_mask(ctx, op, z_mask & v2)) { return true; } - z1 &= z2; + z_mask &= ~v2; } - ctx->z_mask = z1; - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + s_mask = t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_brcond(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853234 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082033wrq; Tue, 24 Dec 2024 12:09:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVfOk5zMW4VMkqbtfwo3227f7MA3HG0F3c1knktCvoCCTex/20fOSyFlE1t8Ie4txohWtFSgg==@linaro.org X-Google-Smtp-Source: AGHT+IGHOC8JFWlW8Crprko0YaUlaEIFSWMtAY2qaSZ9OEMV+UBjx8ZePLUlWTPslO+3xprZkE3n X-Received: by 2002:ac8:7d46:0:b0:466:9bc4:578 with SMTP id d75a77b69052e-46a4a8e2899mr283167721cf.22.1735070946182; Tue, 24 Dec 2024 12:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070946; cv=none; d=google.com; s=arc-20240605; b=OKiRP2gElecuxZZY2AvfvBau/un6wHZH3vUg5cbX1BIHqCL2nMILZbkvnS0FnaoJwC vkTfGoeEtKHY8jdtzEJGcLb/smfybvOR+AqM/7d9zA76cJoTUUX0vEGpskYaYp5BZU7M tK7lYe01Te1iv/wj7/O5bwZvoFT9UwrG4FELiKDheGz1BYiRxcm4UZra+Eu1qtTJuF1N P94LjF6k+KnE+da0qFow79GBw4Gj1MpPWDYwOAtT8mHD0ic6BY8bB4gCIAqiJCc80DpE 1jnedEo77dPxHYrCzxy8Lv1vhMLOL475BUC6OfeDFQ8+72Sx5cbEwTD1SDCbYzXdLymz i6eA== 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=xHQE8MNsLMMkg9lb7/TKEPUriJ232hDu2DMvoc1Ulx4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=HvmzMCqV8Th0tBj7a5BasJ8AcV56BF70UeYAkmXg31I6qiMpiw9axd1gfU7dXof0J9 yycTV/sVhKZ3ms6Axqv6EfmjhDVN8E+S25HEkJpzfgI0iVIcWv9suoPlqdfVpN0gyWII 9MqfAkaNhH1m3deU5iqg+oo+ZgXqalH5rd/3bL67HJ1BkycwKI8NeytfUA3pz9RpjWw/ ni3hn8efOOMq3G5ZksPl4aocJcDnAFcz03QXfHUY+AitcRioVHC79lwD9mWnjaOO2bk3 M9VmNHa0PbneZKMlSXtMI/glbHyt89Am8SeNK5PELMqYX8deke7geGqAZ3XdKp3ZJjH2 Stkw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KBpfssXZ; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebbe3d0si133747971cf.405.2024.12.24.12.09.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:06 -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=KBpfssXZ; 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 ) id 1tQBA4-0002ox-PF; Tue, 24 Dec 2024 15:05:48 -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 ) id 1tQB9t-0002lj-Ja for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:37 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9s-0002YU-3n for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:37 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-216281bc30fso65715595ad.0 for ; Tue, 24 Dec 2024 12:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070735; x=1735675535; 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=xHQE8MNsLMMkg9lb7/TKEPUriJ232hDu2DMvoc1Ulx4=; b=KBpfssXZ+7DL0DZuitWLROndsVlwi8iEIErFJthoTod7MtKVnkBgL2O3tJWR0+dS8w LAMHKNynTqqAC5F8HxeXX7GIcH9QEPlvcub8FjvfEiWAOLkOyGfX9MSop/rZrqN0aFid guFgbLEm8q9WCEoFpOletrfYB72NV3QM7W5yF5wrpdjxf0rWzs63nr2DWNdKZlT+aNg2 qjLljy4Bv1YwCuz4TCYUJR21UEBlp9vnvp+DIJhlvbOzyaup6JMHV7/jrYZrebj23QlN kyFPDckjTpiBu5CCMGk+/+qNYD8acOcK3hcm7V+Uaz3PqhtDWH6gCqOMZj01hUH7Lq1g BsiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070735; x=1735675535; 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=xHQE8MNsLMMkg9lb7/TKEPUriJ232hDu2DMvoc1Ulx4=; b=OBlhoWheXXltMLprWBx7uCynznSNLXPFb/D5ViR4CMWk/9N5qRKcUH2RSbzWTdCzak hMge7g8zq819oFYSoDkj3AiKbnDm1hKAq6fx3hi69eRlM8TX4iXT2SFVEl6OERgGFvFI w3oHiuxBFiAycKdoit1cbuVtdgdWUN9Jpc4J3AMsA3rtTNLgNYD70CXSmFypJizL1I7G pimohLqN2fhdcvfGXMIUCGegu4Xkhxl0Omyy692myfbdONlDU0Ye7lHvhLkQrQzXoi57 jkOBAjToRgwor42pVjjVW+ilnIEAuUQCe9/th87chFFV3/fOe36rPcziz+w1Kn83FuYz DGfQ== X-Gm-Message-State: AOJu0YwGXLc+zLgCmFjdDuRnGWyAphdDrxWC7cJvXirL8BgvWm3monu2 2oC3KNL+HJaUyWt9N8wl7dOl3k5zSnFRFBllpDNyN2xUcoZwLGhbrAjKYzIscTZjT0BWSX+844+ Y1jc= X-Gm-Gg: ASbGncs4Nl1kq1tMdC1J44aN7dHgIHefMq9KyWVW6jTLEXmV8cB/LiVvQabjWBNXxtm w57Lo3bVKM9R07KJdpF0755W74RpHtPOSGSANe+CIF0ybxrEd1z2F6DLZdprFWD1nZZGrHGq2Rr QkFe1NK9P8Sf/2vhVWR0zsUlCIj9pF6C6bGckXlkFtstsyqPJm8Z7o/nyv5jkvRSNkLLjiCQue8 AniwbUd56i9iBeOK3DOr76tfbdlC5tDYXoyyXmw49vAz8tp27+YGyJsScrR4TM0kbO1o81HylY2 VL9lelXbKa2B3XHVXDxdsTf5pA== X-Received: by 2002:a05:6a21:6d86:b0:1e1:932e:b348 with SMTP id adf61e73a8af0-1e5e080cb76mr30131289637.41.1735070734850; Tue, 24 Dec 2024 12:05:34 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 13/72] tcg/optimize: Use fold_masks_zs in fold_bswap Date: Tue, 24 Dec 2024 12:04:22 -0800 Message-ID: <20241224200521.310066-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Always set s_mask along the BSWAP_OS path, since the result is being explicitly sign-extended. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2096d705bd..054109d347 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1477,16 +1477,16 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op) static bool fold_bswap(OptContext *ctx, TCGOp *op) { uint64_t z_mask, s_mask, sign; + TempOptInfo *t1 = arg_info(op->args[1]); - if (arg_is_const(op->args[1])) { - uint64_t t = arg_info(op->args[1])->val; - - t = do_constant_folding(op->opc, ctx->type, t, op->args[2]); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (ti_is_const(t1)) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + do_constant_folding(op->opc, ctx->type, + ti_const_val(t1), + op->args[2])); } - z_mask = arg_info(op->args[1])->z_mask; - + z_mask = t1->z_mask; switch (op->opc) { case INDEX_op_bswap16_i32: case INDEX_op_bswap16_i64: @@ -1514,18 +1514,17 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) /* If the sign bit may be 1, force all the bits above to 1. */ if (z_mask & sign) { z_mask |= sign; - s_mask = sign << 1; } + /* The value and therefore s_mask is explicitly sign-extended. */ + s_mask = sign; break; default: /* The high bits are undefined: force all bits above the sign to 1. */ z_mask |= sign << 1; break; } - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_call(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853224 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081680wrq; Tue, 24 Dec 2024 12:08:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW/AFws2JNURo4Zh1eRUO705keLNrNxjdQQp6FHVSD8qruBsB7Fver7hZVjVzGP/mIO7BKKOw==@linaro.org X-Google-Smtp-Source: AGHT+IF/Nppb786osoL/MDymJ4Hffcpcst8NPiqE7Sdoc3Bwi+FTDw6Sy9ZMTaRNiVDnHfEbyAui X-Received: by 2002:a05:620a:650a:b0:7b6:6634:5a42 with SMTP id af79cd13be357-7b9ba79b290mr2552636485a.23.1735070880212; Tue, 24 Dec 2024 12:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070880; cv=none; d=google.com; s=arc-20240605; b=jC2kbtxwBpKmJEOrbWratggpFrLIaxT6ZM/7s5gLTUqc+cD/tK8tvUAa6YAWdydL12 V3hGwR5FMS3oSpmWNwcnEy+kAd1BJ+zk6lcnepJX2VZy6mx6pyuKtfjsGuw1FYRTjclt 6n6gPncvLavR0jAFU2T5kYmQRHTllHU/SLfc0WU/ZX0Tfezup+2JlP3cpxwStWvAYTkS cZpNXWMTjfcP4dMs6R2dB/gzgZczyyFKjYtANASzj8j9W7u9b7daq7cgSupr9E182AWw PLJpPVKot23qnDPtyUr2fhkDJoMtTNZpv35vrfN4LLW+Xfu54xI1grbeGwR0DvycAZPM AVlQ== 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=u/uXovwT+peKJg+4w3zvH44hwa1dOgTurwD+a66/j/A=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=CUUE4TnYFOyngCHwbdMjRfIpUcItVNCvhh/TPgcxMqpK2myY0sDX+DBoiax3+6ngbp dWApyFqj3bDHPPMjdu9SrxdsC49RCuJbNH/Axx9Oy9VmUv/4I155Mqo+pn2/mrvwY41F 8xDvsOx4rckOOSODAzONT+mktfTUN5Jr3iBMhDnLrBFTEnA1KSlDgOMNVvDgkp40pi86 Wnt0TCVtW9waxZciwFeUWQw7OAmacFrjH8Bc4XfC9oaSD5w4/bQITg2YdRz+x9fpXqDR k1P0HGZdWajnLmbuyN7zq+AxHUQ8SWlY9udiKAacncDFuW7pQO2AUEeMYK2/AVi/n7rW aJcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AF91Q8OV; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4ccaf3si1441196985a.377.2024.12.24.12.08.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:00 -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=AF91Q8OV; 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 ) id 1tQBA8-0002po-HE; Tue, 24 Dec 2024 15:05:52 -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 ) id 1tQB9u-0002lx-NI for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:38 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9t-0002Yc-5U for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:38 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21628b3fe7dso53747255ad.3 for ; Tue, 24 Dec 2024 12:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070736; x=1735675536; 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=u/uXovwT+peKJg+4w3zvH44hwa1dOgTurwD+a66/j/A=; b=AF91Q8OV/RUZhcV3F0f6yyryH5Ut3fTIDNfgEafA7pQIkz9AL6WHSLjdZ0E/zRPhf0 gH+2q9IrBvbRUuFuio9dg/g/6BLOTYcleSJdpFRCGYY/C/uc3imLH1mVh2EI79aeZpte zZ1+u1PnriNquBED8CiOvQiRRGzKKhaRjQwLGIcBpfPKfvN4KTsa6thJ3eJB2Z+EviZ3 zv30Wnw0930dvEX+SoAJ1a1Aur43G7EybIUHxFWHvIYRSjd6VdUSTFlLiBEESPQMgBUz W3MZrwMxaUitfMBxp+PczFyyIg13zHafh3FF7yofSN85MM8qgraVir1IsDrKhjZfNKIj zPbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070736; x=1735675536; 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=u/uXovwT+peKJg+4w3zvH44hwa1dOgTurwD+a66/j/A=; b=WCRWJ0hS5Qc0N/8FCmImpqoQhfrmAvz8voHNL30fJf2z5TrFYImpgTd9ZrN5/xSZYy M0m43RLbN4MpsnuemGbhKcm3O+BoGzk3Sl0nQtG1G3FIVNqsvTh3K8c5I5j/Bv48E6M/ sEzdRdn0Mo0SGes7P7LocCOs4wLG9l5sAl88JzhSXuVcrO9xaIGCueP1r2F5b0VHo4Gh MqU1vrBRnWwC5h/nblXK2xBalIf88+lPVK2PE9bpoxnY31nfmOAsU3yuw5ntuc9egZ0G mKcirui55y20vkhE0dc/nK0qf0GiO6jv3xqq0x0yfDTX/ufTasMKvvnga7RenUukA2Yj kDoQ== X-Gm-Message-State: AOJu0YzNUrhH8/Yl65YE8PpjZvaP2dKm4ncMSld909sxbPy9+gLS2nL9 Vto0FWTGxoXLFFK98iU0DVkgGLakihBMsywIlOvim39gbLjIzGzNhxPO/OgKbDc86XCONrqeZUV AWcs= X-Gm-Gg: ASbGncvwZbgYP0X49Fz8kUFIyBmH31Ah+i45TGVVFXa4rrAQAoMMt8/UT+Q6F/RlSuQ gQ+t2VK5i5Vs8Ur5CbgPQFm4avWflNMHGAFudnkD1zWe+sO74RSEUDxkF7hvYlMkHeimPreSa41 nignGMnBDlaIT1QjKyrcIH+mi3v1QOMC7DYfQYkdtC47cIlw6I7RXrc7MjHQQ57GRggwmO32Y6C tOOHxLxLZLrCAFi3ggRLVCaN5TytlwT+7nXG8SjrL7pejRfaqb+M9TSRs3CN1qO2LJxP9JMV7// Dmr94M8I8ZBA15XLYAL7Wuhobg== X-Received: by 2002:a05:6a21:3a44:b0:1e0:ca95:3cb3 with SMTP id adf61e73a8af0-1e5e083e416mr28581928637.37.1735070735680; Tue, 24 Dec 2024 12:05:35 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 14/72] tcg/optimize: Use fold_masks_zs in fold_count_zeros Date: Tue, 24 Dec 2024 12:04:23 -0800 Message-ID: <20241224200521.310066-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Compute s_mask from the union of the maximum count and the op2 fallback for op1 being zero. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 054109d347..0766a452b5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1566,10 +1566,12 @@ static bool fold_call(OptContext *ctx, TCGOp *op) static bool fold_count_zeros(OptContext *ctx, TCGOp *op) { - uint64_t z_mask; + uint64_t z_mask, s_mask; + TempOptInfo *t1 = arg_info(op->args[1]); + TempOptInfo *t2 = arg_info(op->args[2]); - if (arg_is_const(op->args[1])) { - uint64_t t = arg_info(op->args[1])->val; + if (ti_is_const(t1)) { + uint64_t t = ti_const_val(t1); if (t != 0) { t = do_constant_folding(op->opc, ctx->type, t, 0); @@ -1588,8 +1590,11 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - ctx->z_mask = arg_info(op->args[2])->z_mask | z_mask; - return false; + s_mask = ~z_mask; + z_mask |= t2->z_mask; + s_mask &= t2->s_mask; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_ctpop(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853226 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081692wrq; Tue, 24 Dec 2024 12:08:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXEeX3iDzn4b5V3g0MXu/PL1hqjWjqemOui8I2BuFZ0kA1P3CVgiu4Su8rnUVm7FBF+T6I4OA==@linaro.org X-Google-Smtp-Source: AGHT+IFhxdulr7JXz4n60TqISRriDcmA7ajWgP6jRfm0SPdl4SStJMjr8rBBWWyTlLx+AMFdfG8k X-Received: by 2002:a05:622a:5c90:b0:467:56f9:b9f1 with SMTP id d75a77b69052e-46a53e49d94mr237225361cf.22.1735070881865; Tue, 24 Dec 2024 12:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070881; cv=none; d=google.com; s=arc-20240605; b=TMjpVM7/o3856nzc760ArqpLPtpvIdGqyvN7PQL3u2sORkidPS25VSyqQebwGrr7Q8 OlE2PiGSR7qRW4pdMICQgJ8oBbP0jh+LBLUiQN/zEkyLti8nzoDBjFkeK7jUuKQTq1ER YsAtSaK/gICArz7eC8q0Nnj8qGTt1mKwVqQ41HpjYiSmPrxnCcZmgLfrZ+KZcJd/0YOV Ti65HHkEYRhbtJLw3Rn1iJ9ZxO1XzKkWd/vh6m5p7gHapQhEjwk1y9vRdGFyGLj1V4BW 5RLbXCdGlbwLtkmUD+cPaWUnQ3mSXrILf325Bxg5mcHkXh2V8q2jC3XzIuB9bUp164Q2 4/7w== 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=LsfMpsMqMxq0FC0omwsdymCcUELXX5bANXU+yD+lCsQ=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=FJXEQvPI6ijnRlCUZ8WMQcESa+LpxdlcJ6kfvosrSdLuV8xrOe7hkz5CMxn4VFF7Ow B4NsjVi1Q20pKlbSxdGewoH0LG0iyn8Dk+JGnMTAPb1L/o4nDhGFYUCmskFw3mFYahmg xh4mrCXaZXhHoNyYWkznVouGa5gUPW6rilmCMQLC0c0ETUucc+f53usMgCtSixdw8vB9 +r+Vh+E+GaigetybSCp5NtOr8sPjrLfSOXPZUKHOvNizpmUUUMr20Yrc1dS6MlYfcHeM DozjG1+F5ld5oeChTxEfw4vPA+NUhgdEcyUCfuxln7xFwbKobVHSrhdIIIbAqErByquC ZYzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Djw7fbvC; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb98e2esi151864291cf.242.2024.12.24.12.08.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:01 -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=Djw7fbvC; 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 ) id 1tQBAS-0003Gr-G6; Tue, 24 Dec 2024 15:06:12 -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 ) id 1tQB9v-0002mD-Oi for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:40 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9t-0002Yq-W3 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:39 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-219f8263ae0so23702555ad.0 for ; Tue, 24 Dec 2024 12:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070736; x=1735675536; 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=LsfMpsMqMxq0FC0omwsdymCcUELXX5bANXU+yD+lCsQ=; b=Djw7fbvCvS95UCcvWdkqoDt401bZcC08Sohu8lmFAL0o2NW0oNCrxLhyZ/eKEnQLLH HxGW2Z0wjVFbQep2dUcYc1RaUvPWEz6RsBoehleLdNj72pefL0Wt7SNi3yClFzY0r1oC wpn7pFDPRu3Mz94f2Q/sb+FpC2IVAy0xS3SEkHD/BBP/dOmV6K028ValZw+Oaeu7BMuP TF6qNbZoICc0my4iuIQl2WFO4oi1/TtHCJGPppreCtB57JpM5/zY0caiwe+93i+gHrsl x6jVYg6Zh6zhsApB9kPjbhBCsM++y6aY8yJ4ZKDH3na6pJxD+aQKoIUEUajpy4adYCDK hv7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070736; x=1735675536; 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=LsfMpsMqMxq0FC0omwsdymCcUELXX5bANXU+yD+lCsQ=; b=M90fbkuhAkClrXFczqSMMbdJi97Y99VEkWU42QXv7zqJKRV9skXA6RL0k52xvhikEb P0fBaTySftpwSSCkW+bQ4ROp4z9bpngevyRgr2/xy0vgtRyJn3v3VsmiKkWvgpgPo5s3 Vkx9ZYJCq2mu8drt0s7tgNNBpEdqaf7yIq46/3WAs2JFjfWWAOoTK+/QLhD5KOcK7icj RV7Wb96dvxA0Z6PIWp9JeLwOyrSLa0uvONozgOlYveOXnvmibEYxFBT/7SrgyBmh9EGK zgU3YDcfAISSVcPHFvGLaaPIjKPkA0urLHzKTuwtWpvxuFwmpfqAEWgZ2VSNFiJAhKW0 vo0g== X-Gm-Message-State: AOJu0Ywqa+kVM09TgIeEmRu8vAMAkY6ayV0qTElnKlBzIpQZARjXMq+g NbJ5jh1RwygBO10K2+BFSt7HtRJdWV551Dh0UMRUP1KxHfsI2YqmMO2LU4F0tIgI03A2MfPFgx9 k13w= X-Gm-Gg: ASbGncsA8XzLI+W002O+K5GGf755XaeiJM+yDO0UQVf+ewnY6wTAFq95WL+pDbwGfSj r/3Sfi3G+Oa1n8UyhB+xeJTdDtJxelVr4/3oyzAOhM76DGo8orlAy0SNrJXNLZ3d9QZovlt4kQ9 /t+wD+RBlDDdW8DQZiOc4n+ykctKtfELYhmn37eFrmnlClr5AVvXucZUj4NSI5Ko8EYtM+38ejy KaVbLC+BPvxX6yC4B0rDrTw0Iry9RYddLF/h0FyJHt562nR+fuuzzUHafakFYeLVucQn7zABmxa d4tcBD2Jy5BAyjLKPf+4UOavaA== X-Received: by 2002:a05:6a21:100f:b0:1e1:a693:d5fd with SMTP id adf61e73a8af0-1e5e04a3432mr29074598637.25.1735070736528; Tue, 24 Dec 2024 12:05:36 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 15/72] tcg/optimize: Use fold_masks_z in fold_ctpop Date: Tue, 24 Dec 2024 12:04:24 -0800 Message-ID: <20241224200521.310066-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 Add fold_masks_z as a trivial wrapper around fold_masks_zs. Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 0766a452b5..2f5030c899 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1067,6 +1067,11 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, return true; } +static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask) +{ + return fold_masks_zs(ctx, op, z_mask, 0); +} + static bool fold_masks(OptContext *ctx, TCGOp *op) { return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); @@ -1599,21 +1604,23 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) static bool fold_ctpop(OptContext *ctx, TCGOp *op) { + uint64_t z_mask; + if (fold_const1(ctx, op)) { return true; } switch (ctx->type) { case TCG_TYPE_I32: - ctx->z_mask = 32 | 31; + z_mask = 32 | 31; break; case TCG_TYPE_I64: - ctx->z_mask = 64 | 63; + z_mask = 64 | 63; break; default: g_assert_not_reached(); } - return false; + return fold_masks_z(ctx, op, z_mask); } static bool fold_deposit(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853217 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081432wrq; Tue, 24 Dec 2024 12:07:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXyZ0gDi/owaoD3lp4Ve9W0OkIbv2dNvezoDy8O+6PaMQm6k+hNY2KZNBGI0qh1fIG4W0oyrw==@linaro.org X-Google-Smtp-Source: AGHT+IHlwL8O71XuzdHTEo7ji49RHGgP/hsNFeqPiyu3zeqNcfepOmvebmu8JErQuyBki9Hqmo4U X-Received: by 2002:a05:620a:601b:b0:7b6:7909:5208 with SMTP id af79cd13be357-7b9ba716befmr3091812485a.5.1735070832510; Tue, 24 Dec 2024 12:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070832; cv=none; d=google.com; s=arc-20240605; b=S92p8E1Enx8aTeqFpbRN8VeV6/0DBzuee4yJouLrBz1FESeuWXP7bc8MTmJvm03hOh PdXXFUMkIzNq6m9cY6avlPnyzitmwMj2JS8LCF8TU7mH9y3Gq6TfdjnvQySOoBu+H4Hi LSlNrS4BR6Io+InpClyDtnpp4t2jYv1IBXJLAR0bxpnfz2+Zfvnsj85tc7fDL1zPSmj2 fL9GwlacR20XeZf7oEnDT1Fdfobh4VHAO4fyPZh7w2HYAN1p5ee3rt9sYObMeh4Nvcvu k3MTpbB5cyKX/9WBYdd0xu27WB7Oem3I+Mx8edVcKAt27YoR4miyhy3vLY20kmOX/5Vk 0NvA== 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=sf5EKd0lXfaCbRbQXllEv2ceVywi3b3Vv26rFZxb6RY=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=RbihPVrP5rIu6xxHKJeICHZketbHfGoketA8rr8uq4fy+ljhAv1qfJM+ymJBdZ+bf/ rkSJgTILMl0RHT6vIJ15QZUQ9X2maiHzM1ZtE1fY/41Hcl6ZuQle/dkTK3AN7/FcVKAQ H1YEqoNmD+T23L+7jNK/d3T9w48b/6YFJrotD/01AVyzzQuGlc1dbgZswkABbWjUdh/A zPxNwi3TPDsfGvJsvgXiQWA2cXrfenbHIjRj9MNqt1I9l4v5FJHGpZ1AdncGgCM0pYB+ o3Q1GVi1azZyW74LNcScFer/blKH398tOkw+QmLlBaKaP1SigvARrh6Z2aewJ1vo+BjS 8D4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ng+ETRGZ; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ab601si1600902485a.69.2024.12.24.12.07.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07: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=ng+ETRGZ; 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 ) id 1tQBAN-00037W-UO; Tue, 24 Dec 2024 15:06:07 -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 ) id 1tQB9w-0002mF-3v for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:40 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9u-0002Z5-JL for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:39 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2163bd70069so55718015ad.0 for ; Tue, 24 Dec 2024 12:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070737; x=1735675537; 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=sf5EKd0lXfaCbRbQXllEv2ceVywi3b3Vv26rFZxb6RY=; b=ng+ETRGZ/vMlNpAxuI9FwL6DX0sIRSEJx8/dQvJOTTdbuoNwWNFQfluhS4W8Jl6RgO IrxZO+bLw9Zg1BUgeBOv3RvThsOwT/1t5DJIMFrYg5rk6wVZoFZNIbT2SJMeYZ72Jgtp r3RTX3Uhr3K6hzXFRhaje8ZmDvnfBHqfZKPee320FgtjlKmLIgWqaLCksoCvzxi02BJw qUClGQ9xryXzabw3HP524PQ2UPKSrSRuBlU23WAA3lS6TYHLuyB8vLbUeQUrTdwTSyaT 1vXgTeZjDbS91YfN3gPEg32rkW2xO7kBlsVSDNE+734xp3Wk8LDCgel3xU+Lve/kN8YW vyDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070737; x=1735675537; 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=sf5EKd0lXfaCbRbQXllEv2ceVywi3b3Vv26rFZxb6RY=; b=I0CHAlUHyOiCT/rCGOj4W76Hl/gAAbLXo7UNF8StQRwh93f12LjABsJzCAXO+kSRoA LPKN1iQWlF7KQz7xyqUqbGChkniP/5wMlzA2SPN2GBIk0uqW7pjDUeMxvkK/twC7bRrv 8sSPcHEfPDemXGK7jpq29oI7dSK2OTtgm0flD7+Kf94i4iOev5zUy90KzRcue6FJzcvK VEtTR2eOawWBMDu5gjc1nqIg9I2GF1WvJbMmcpXg3X/fFjL6sYTozbYTqRT1zx3Ymtfo YZqKrqAsBZ3hX9032SchappBBYL+SHSHPVOhVQLfNbLpxW6Cb9zrOpu/yPSQjqSCeNMc 3NwA== X-Gm-Message-State: AOJu0Yz796HbG6g8gloeMMI1Nu7CJhE9qMpdlFEYgiWcm1Yx2aHFLBij RFBXz6FoLasuhM0FEMvh1ph+Mg860QaW+cnQnStuPMItKqP47Q5m7byVdtXTiWYhji4pdJod9hI 6MeE= X-Gm-Gg: ASbGnctasYs1biBC1lqEuaoPBj0/9Sn3Tp/xCIcHWVVrJ2gOj7fS/j7ZVa0V4OhUX6a mCGc4IlGOpIbljqio8KCQz/6/x1tcqQ+JNqo5cJLYVmefNApPAnz/7QkiLcVxpe68erVXVIXaqU /WBnVzNssgTW6au4wROUyAmrL+EX2LS7qu2NTfFV64XVHzOmvmvMfgU4b0QQuAeprxm8MAQY2/P QP7UUhx9O4rNigXNiiFl/zVGaqUTxfjFzBC0pisSX5PCGvdi12KxIQxije3dIhs6Vi73kA7cnEx U9BNStSpGenf90ooHbAXEa/v0A== X-Received: by 2002:a05:6a20:c907:b0:1e1:a829:bfa2 with SMTP id adf61e73a8af0-1e5e05ac3bfmr27799976637.19.1735070737356; Tue, 24 Dec 2024 12:05:37 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 16/72] tcg/optimize: Use fold_and and fold_masks_z in fold_deposit Date: Tue, 24 Dec 2024 12:04:25 -0800 Message-ID: <20241224200521.310066-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. When we fold to and, use fold_and. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2f5030c899..c0f0390431 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1625,14 +1625,17 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) static bool fold_deposit(OptContext *ctx, TCGOp *op) { + TempOptInfo *t1 = arg_info(op->args[1]); + TempOptInfo *t2 = arg_info(op->args[2]); + int ofs = op->args[3]; + int len = op->args[4]; TCGOpcode and_opc; + uint64_t z_mask; - 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); + if (ti_is_const(t1) && ti_is_const(t2)) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + deposit64(ti_const_val(t1), ofs, len, + ti_const_val(t2))); } switch (ctx->type) { @@ -1647,30 +1650,26 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) } /* Inserting a value into zero at offset 0. */ - if (arg_is_const_val(op->args[1], 0) && op->args[3] == 0) { - uint64_t mask = MAKE_64BIT_MASK(0, op->args[4]); + if (ti_is_const_val(t1, 0) && ofs == 0) { + uint64_t mask = MAKE_64BIT_MASK(0, len); op->opc = and_opc; op->args[1] = op->args[2]; op->args[2] = arg_new_constant(ctx, mask); - ctx->z_mask = mask & arg_info(op->args[1])->z_mask; - return false; + return fold_and(ctx, op); } /* Inserting zero into a value. */ - if (arg_is_const_val(op->args[2], 0)) { - uint64_t mask = deposit64(-1, op->args[3], op->args[4], 0); + if (ti_is_const_val(t2, 0)) { + uint64_t mask = deposit64(-1, ofs, len, 0); op->opc = and_opc; op->args[2] = arg_new_constant(ctx, mask); - ctx->z_mask = mask & arg_info(op->args[1])->z_mask; - return false; + return fold_and(ctx, op); } - ctx->z_mask = deposit64(arg_info(op->args[1])->z_mask, - op->args[3], op->args[4], - arg_info(op->args[2])->z_mask); - return false; + z_mask = deposit64(t1->z_mask, ofs, len, t2->z_mask); + return fold_masks_z(ctx, op, z_mask); } static bool fold_divide(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04: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: 853220 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081609wrq; Tue, 24 Dec 2024 12:07:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUJb2RATCUfmrdhfhhI3zJksMqJXPMPvPO+4PvcB0O9QKKrjRlKRFmOdxuIt2IaX73refK26Q==@linaro.org X-Google-Smtp-Source: AGHT+IGSD4YzJeFCehULlOrvnYrptbHYmC16cnWfwBRM3e2bqUMvYHft+rp4nO/8Pf7J+WT9Sfqt X-Received: by 2002:a05:620a:2906:b0:7b6:eae1:9947 with SMTP id af79cd13be357-7b9bad06a61mr2976456685a.31.1735070866678; Tue, 24 Dec 2024 12:07:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070866; cv=none; d=google.com; s=arc-20240605; b=QruTMHrkohy8HOLNsT9Ngui7qpKCHI0fABPP8pzoya3SBHWKUk9BbTeY88wupKrTFF d5p7ZHoLxaq9YXbdZXSxSX5CHVmlAlJo2Oc+U2ZlfEO5BPnkdsNuQsuovUUxwLftgMyW YFw9DsiRNaeCv6+rXK56y08CSORK/0DS/7u8kYzNm2GlSBrf47B+vrcME4cBWr8/Trky enlwM8dv1XEO1kWrpHmDj5o1uZek2QINE1WDGBhepkIppAT4KMyHC/Vy17k2IaWH6p0/ z+OeK0zrQk1NyrEl3Prybbu0kW+Itxv5oUEhndQx0X5Za0vxEOwyQCTEOq/mn2HzPZmw 4A/A== 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=djzRryUm4IchJk8S/iBXoENiUIgFlXm/HpsFU74cNpE=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=VLOlsPZMgqgAynklJJmHIsTZ3ATTXIe9c028cX118ppitkW6/E5buEfS+Gy+TOpbVi rxahd/f2vGdyXCqct7l/ZlZozD6pDBZZ7EFo/FAkJRTyLm0hMB5vFzpLMchpH5Fw9KR/ FTtefaCuUn0mcDSsaMqtosZoQAQs2Gm9JDuR5hU0rzK0Ofz4RDlofjMtdxxUgx4nx/P/ 4Grp3t5PuN6zs4rKsWhOhjK9bnmh1Q5T+V3v50V7E342W0lCQ3Rn73p3ytwhpCw6uZyB cQAjndyvD4Gtn3i5sW8L96HmujzUzswsTXoMwLOk+M8YeW2ZWbI1CM3KA6Hnb9cI3GAg 1wJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rj/TRc9V"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac50f8bdsi1424267285a.570.2024.12.24.12.07.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07:46 -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="rj/TRc9V"; 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 ) id 1tQBAS-0003HY-Jq; Tue, 24 Dec 2024 15:06:12 -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 ) id 1tQB9x-0002nM-Eo for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:43 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9v-0002ZL-OU for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:41 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21631789fcdso46982225ad.1 for ; Tue, 24 Dec 2024 12:05:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070738; x=1735675538; 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=djzRryUm4IchJk8S/iBXoENiUIgFlXm/HpsFU74cNpE=; b=rj/TRc9VVY6QbvLbxL1E2cw4rsQcxOV3IvQtzJnArArOsmoMkDDPV5kUq8Kt1UhvYB VHQWzgUXbXvHXpM8XNJ1gEs8gfsG+Wk8QeqRLLCcr6LSvmsWvZVw5dQO3xItLwnjg4VB ezK7mOCZQY/7SWNjrX04cEgLbXpKo9ALacXVPDO+Or3PgPj5Cq85NGEAuldRdb5UMnOL D7IcTstzDDGqV5V3+1mzoYCmu5JnyMu03PMy0eyANcSYRfqV6SD2njtvX7JfaKgTfFH3 xVDgV2exRo32/GodQDY+N2H6z2GASeBp66vTsrk6q+/pstFs89TKn2CUsTAm/nMb6Rg5 6d6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070738; x=1735675538; 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=djzRryUm4IchJk8S/iBXoENiUIgFlXm/HpsFU74cNpE=; b=XZndXuo6S6WLn9x5yOJBX6PODtDGULue6WuC0LSaZftczNKnkgUy+YTOwZktVsCHkg pHX34kdZ82BTA02wSpuPABloV8ZjYU0qKV3q8rgE7Gj7Uxaq15b6pqILHZ0GmZ1MsqTj 62GOGp/JHUZJO10wI6S0OLy6Z9fWWKGSYcjbakfuMrZ6se+ePKxsIQ6FdJCu265wy6BK NFJskJcJnghupCvadAvXhPUg/tAqiM+WMCVc0VzVpYZmfa3ERkr6ZY7CKiI4TjrQHfE3 DEEZjmYqkNsqOc0PAXgrTh5E3XV1c7F3NXQ33CTibOd315R5gNIv1oo6lpdDOKzWoGSs YDwQ== X-Gm-Message-State: AOJu0YyuY842gKf/H9KoI0nB68PVptCk+zo5bDhxK+7zkjgHbvIN6ZmD mqI3MfABkc1TbtWPmQyaiLdhU0RvUKxcW0sVyud8DhnrQ0y2eaoE4AsBLk1RXMNubniKmGejMBZ lZPU= X-Gm-Gg: ASbGnctolJUco0hXXJjCBGqd2M/tncRfV/F9t6V/7MM+XNK19gqIOVHPpHtel3Trls1 7GnsBzBH8sAnC8Li50w5FQo7bQmtxcRxbxqis9NXwvEZMuZZjYbvCoyWwShU/IN80ACKtC2VzFj sznBcen59y/84NFqoYjk7ephMhXti3UnDlEOBQ2vXoBhzhDiIQBBMzWmch1ATm06vDppjdVI8z7 84taNYFeDWwE+munmU3yJ9bozYNOrASmb/ylSIEJYJuTjNagYD9NuSx7UbaZkBt8sb/AmT/Ukxl 28acGFCwh42Yqss10EwAnuXtZw== X-Received: by 2002:a05:6a21:339e:b0:1e5:f8c6:203 with SMTP id adf61e73a8af0-1e5f8c6076fmr14459488637.14.1735070738359; Tue, 24 Dec 2024 12:05:38 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 17/72] tcg/optimize: Compute sign mask in fold_deposit Date: Tue, 24 Dec 2024 12:04:26 -0800 Message-ID: <20241224200521.310066-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 The input which overlaps the sign bit of the output can have its input s_mask propagated to the output s_mask. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c0f0390431..b774c96f49 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1629,8 +1629,9 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) TempOptInfo *t2 = arg_info(op->args[2]); int ofs = op->args[3]; int len = op->args[4]; + int width; TCGOpcode and_opc; - uint64_t z_mask; + uint64_t z_mask, s_mask; if (ti_is_const(t1) && ti_is_const(t2)) { return tcg_opt_gen_movi(ctx, op, op->args[0], @@ -1641,9 +1642,11 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) switch (ctx->type) { case TCG_TYPE_I32: and_opc = INDEX_op_and_i32; + width = 32; break; case TCG_TYPE_I64: and_opc = INDEX_op_and_i64; + width = 64; break; default: g_assert_not_reached(); @@ -1668,8 +1671,15 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) return fold_and(ctx, op); } + /* The s_mask from the top portion of the deposit is still valid. */ + if (ofs + len == width) { + s_mask = t2->s_mask << ofs; + } else { + s_mask = t1->s_mask & ~MAKE_64BIT_MASK(0, ofs + len); + } + z_mask = deposit64(t1->z_mask, ofs, len, t2->z_mask); - return fold_masks_z(ctx, op, z_mask); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_divide(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853210 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081159wrq; Tue, 24 Dec 2024 12:06:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5yVlV1Qza1OaIiDLed/s9hHroJBPFeFeeMNukxSAX2jxceZ4SVr7ed7/ImyF5vTLhae6XYA==@linaro.org X-Google-Smtp-Source: AGHT+IGtGwv8KMPkUdtSOd+hanLudMMi/4GePucRW8IbBdvz9ZVSXcVneJIjK3Py27+aUcjuOCEr X-Received: by 2002:a05:620a:1a0e:b0:7b1:44ee:644d with SMTP id af79cd13be357-7b9aa934626mr3802223685a.10.1735070784290; Tue, 24 Dec 2024 12:06:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070784; cv=none; d=google.com; s=arc-20240605; b=V3jOKFrcJrHOuuswoooTg4C/aisU7WRu+EbEftwnJYOGIbwZUhOkqwDc705GhmTFCr F3aH9BBIIaveGVXVwfa8boQN4npIzrnEK2bzrCcLvQATXF+PEMxbq/HC/9quH65VL5P0 eeYKfKWePeqroLvsxEzAHyD22besS3W+TpSpk2uaHLBS2fHZ9VP4koLn1XGqKBHZHMD9 v6kRPyCzuhKwFHJnjYdkS4L5/aqeywIAhZbWiR8BJbUryoEgUoDJ/ZO69zGBCGl0J0ZJ aBOnB3Hm/0A85ZZn2NLdQJpyvX6zCiVJQ09XC59h1KsnxX8eGZpFPg5FOwUuwQYn8FcJ Y/0w== 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=rao1rvqabzx7DLwVY1TOu70R+eSLvWsnttr4yGctDGo=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=E9eCMsLvdbIVVxDdBjB7CZvKe5Uixn4Motn/xZ9SEf/lTUCZaYnT8Oo3d9e2kNMyNc 21aJRtYljeUcKP52cDMtsLKMqLo9k+cZxNsnwuYhr4z9pXcFqVpmfbMEyddPRSinu59H MgggdnUlx8Kg0FKIyq64G2uasrcKQp4ts4rkIi84iA3q7TMVVmgBwJtK0/7rrCYfuLVU I6+zqHBDOBWE99kDa5arMxbUhUGjiaG6cEtPYRhzkOS2LXZcmIF2VbsLSsCDAE4MwKxh jyYTjhiOp3VCR2O0Ae4YFugVXX1fXhpiiqseGCaN7J70aesRjYb8DeCqH7K/cglSsAR6 eymQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WmxItP/S"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4dc41fsi1469522885a.444.2024.12.24.12.06.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:24 -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="WmxItP/S"; 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 ) id 1tQBAF-0002ud-Im; Tue, 24 Dec 2024 15:05:59 -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 ) id 1tQB9z-0002nd-W2 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:44 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9w-0002ZW-SY for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:42 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-21631789fcdso46982295ad.1 for ; Tue, 24 Dec 2024 12:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070739; x=1735675539; 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=rao1rvqabzx7DLwVY1TOu70R+eSLvWsnttr4yGctDGo=; b=WmxItP/S7QF9ctcufawOtNDdiNWBk/r9fCflyMZZphYnqAqMclwARtRG/3AGiFVgAb 3REjllXoMo4g9Oz5neweLnErUvICTNKg3MePkz3cnRlQb1wvHb4Tvt+kH9TvdjHKtzkZ S0VINMdJyfiC5Zg5AJUnFr8zJQkzaZsUUT01fvDWuCcbQLnkRnlEWy5pIpEYqvvXbvG+ evN1DOeygnALbMYLxk7lix8lmFRgwz/kyCZtlsbSqLm3sA5x+GI/O0K/Ylcy7IFxtCgy /b3CC5pmXLIA4tAHDjEDqIwBglSRkJzZ0OpXLpIYcJ9ZBz0mOqj3RiN3q5xs4Kr1EgfD uS6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070739; x=1735675539; 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=rao1rvqabzx7DLwVY1TOu70R+eSLvWsnttr4yGctDGo=; b=Yq1HNW17z96wm7+zo7xykARo8OF8gLv263AOZ9Y67SwGGTLojKCMfm6MnVaC/WKXpV 2ztuij6WA5sEYfII7oq2Dno1d9KfOLSDcfd/6XNaXuToeVBdyQVZFmJirBBsw0nMXnIl cDTTETQjz9OrADbSWA1Pc59ShdXsCDczLYsjHGnKCg0ySd3FAe5s6FqfLyMrAwBvdET8 i5P3IkeMenSFDkgypYalCam0yGcklP7ZuJyIjZopIRk9QBrYRqYpbFi5NQC2uU8v/jyX XIQEhVfndEun4GuCk0KTQRgu4bbh0YTO1N6gx4x7OOX36hCvuE3ItNV6bBfXYKTCV40H eytQ== X-Gm-Message-State: AOJu0YycygkGGrxIDBAm1KAqB/avq+zWvlQBd7U3ffm7V4uovlAT8woJ 7cyxkBrzJkWwNovO4ypSM1a9NnEfkncoV/NXnFA5nrrpM4kl6znB6JsQvMVFyY1KejhOUtIZ5tU Hn+s= X-Gm-Gg: ASbGnctw4K+oM704jl1R20QA1iGUqgyANRkcLMQ+ITzvh3eSIlja6IY6y1H645HWfRZ qHweDMkFBxY2x9zDAxPOitFbJjY2TPpb/nH4fPHukzAAzj4QiP7z8O1KoDUtM+YoMWtq18+sK3E q8Kttko4URNoCfBh017JdbBPo28DmTtG8lfuXrTvZ9K/Hi9DuWJQRxyj59rnxHxzAAIoh2BDIN1 rpcQ8U2ouSDjO6sy2fCiuTpM3epcgNWEdtzdV/2MhlLRjC4GChp7xnIS9FrpTPin7/PQWLD80fP 6qyMz6aPiSklaMVcyn/3BUp5VA== X-Received: by 2002:a05:6a00:21c6:b0:725:4915:c0f with SMTP id d2e1a72fcca58-72abdbd7f45mr24738959b3a.11.1735070739384; Tue, 24 Dec 2024 12:05:39 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 18/72] tcg/optimize: Use finish_folding in fold_divide Date: Tue, 24 Dec 2024 12:04:27 -0800 Message-ID: <20241224200521.310066-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index b774c96f49..a68221a027 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1688,7 +1688,7 @@ static bool fold_divide(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 1)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_dup(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853209 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081145wrq; Tue, 24 Dec 2024 12:06:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWvVbIVXYjBuQMtkuR0djIPiP9jhY2OqFpFS6SqGBCyib/SGvz3xV682wfCNErhNcUiBkM0VA==@linaro.org X-Google-Smtp-Source: AGHT+IHNu5saihYS4jNU9OdT2KPVOEmtchbcHIgJ5GrAOp/2cmf/iK/7UjxUL6NpozD4GugSKU0D X-Received: by 2002:a05:620a:2697:b0:7a9:9f44:3f8 with SMTP id af79cd13be357-7b9bac05c6cmr2706169785a.5.1735070782349; Tue, 24 Dec 2024 12:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070782; cv=none; d=google.com; s=arc-20240605; b=er+CSGPLda/Y6Y86sVJbqcjvyNcZ/Wk+s7obQDZ95EmCCpHRByt/5+/MHiqkqD2NoT Ty1B3++2SGou6hCJ48I/TqajV3aCnwThJNckMLXOMFGOOISlpTvHBPEzdOQ13RcwyFw6 7fC+V1BZJ+ffGLdIK0vf8UwQcOa9d21Lk6kCiwTvJs1yqJ4mYD12uO6FDwyzjxwrRETF uwVAQboJget1DDLTmfNAQWGXMmie8HArzrSU5jha5ziutKjWPOzsGhYroRn5z12UetcN Dtag5kzbIOehRUbmVq+03eaHL52SqiD1ZqwOm9UTz/WJaAW0iKpz2KvmMDe7404Mo+1p TQqw== 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=oEBb6lgw9CBGrH+fdl+vxQW2dmf3GxJ+EO5jjQIVvNE=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=aKAh3VBwoO9WT5KUV9HptfFQwmuyePO0S6fcQ5H4moetHzVVbuDD6mVz5HhNd+/hl2 YB9n9SvM5LDMSxQHxIKIOWBPErgmS8AxY95gtmuCBD/vhTuOeGsEjQJ626NStDnfFAGy uZHw8LOtwCvJOEjryuDOxgRzgrB28NfefyDIXF3jKaj3hLKbBSaVhAl0N4uU+wv6uxFt 4+RTM0l1VpF4hle+Xw+VCQ2K5kptgjH8FaWhPU+r80e4wgmiMA/g6JjfJsuyH0A7PMCB eqDeHaT0dyqdYhEHPfUVWtySpBQLZ9kjCLIKdTw2ink+3GnoBJ33zPN1uwvgRApkSTFt xX6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A289RmNw; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac47a66csi1390977985a.294.2024.12.24.12.06.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:22 -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=A289RmNw; 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 ) id 1tQBAG-000308-FA; Tue, 24 Dec 2024 15:06:00 -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 ) id 1tQB9z-0002ne-W9 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:44 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9x-0002Zj-NW for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:42 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2162c0f6a39so64869895ad.0 for ; Tue, 24 Dec 2024 12:05:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070740; x=1735675540; 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=oEBb6lgw9CBGrH+fdl+vxQW2dmf3GxJ+EO5jjQIVvNE=; b=A289RmNwd1/g8LiAnGRSsEqJ/ROtkw+Pb06Uq8Y0ru2e/I5y2UxHf95ZLJu9hKcbNn RCJVn/sOz0oxvJ6WiJLwBdbgDl6ozmJpdK+fxMErsz3RTFD/HOQCXSdirlvo6eGOg0M2 uUfXaR2QD8plRFGxLtM5wbh3MqF3+GTW8+wvVlrT0W/wSJyQtZQC2EAgaMeF/2v+UDBd gZDHXjUyH3OxMdisXvZ4NaxuvWTeQQ8mmwBkBqi2SOoj2sr6tiIYuVX0rD+CDFpaoM52 I4lkZ2qao3UIIi2ftK05h8EiG8o1S8kXRYMoNsaLub/VN5/7N2gWbArWjVaKMM6UTfmX mPQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070740; x=1735675540; 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=oEBb6lgw9CBGrH+fdl+vxQW2dmf3GxJ+EO5jjQIVvNE=; b=PuhKCgrR+Egiwdqbb8b5RfYiVjr/3VXTz8sItUNfbgnoECvIiMidFz8YGbD66ivrXE gSWUKlxGYEnmYyC/Gg4ybIuXdsKdyQc+GYTa1DR+N2Xz5mZdZwCQMze5d5W6Pisn7535 9tm+lOVEzLBlUVV+svb/rqrBwPqZVQKoyw3XmDE0O2U/O7pagNgFOQzCrzC3E6truD+n 9KLfYytU16SK5pxY/LawkjOyhL4hQeCh3NNakoZK3+xZxPxTW+EloDvSbqrEvxlsk9g0 PmgMn/gHpJtaVZkYLlOJMiCP+XOnsWVY6rV5xNxqod8Qw6KMtqZ0h5IuiSR8lDGJuK9B iyeg== X-Gm-Message-State: AOJu0YwNNroz7YwjH8OPF+1eRqH3IoEausAKnsK3qJZaMv8k0InYgwIr Q3BzvJJ3mDAtvo28WlovSJf3dDI/Lkqi3+4RjHPuAaaLbTLvHmdadSmhxiz0C9u4+7nltMUDEnM aYH4= X-Gm-Gg: ASbGncvjgO9JpVlHSenpj/tn/47mBGjWQUjjya24h/cuCQ+3hXX6J9swghLAOk6eyQz sKeum85r8YAh1kV8OaXjmRZZb5oCU7w8MmdHah58SJACzEZ3il9yukakD5FzP240xeKZRJVcnV2 d0undYnF1zHSUKHC9H7n1pHHnpXekAU/90U08zQ/bn6NXNScRmLIZcK+Ohq263lFLgy0NHsyNg8 ej+wOBd0DiLgbLSpnbXKFqe2YSBLO/Iis/gL7dbrbUHnQevBCA7dF1w4qOZKdWHMEQxZEpMav7F lM3GJarVNuisC0C139to6Dij5w== X-Received: by 2002:aa7:8d15:0:b0:72a:83ec:b1cb with SMTP id d2e1a72fcca58-72aa98f5b53mr29949932b3a.0.1735070740507; Tue, 24 Dec 2024 12:05:40 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 19/72] tcg/optimize: Use finish_folding in fold_dup, fold_dup2 Date: Tue, 24 Dec 2024 12:04:28 -0800 Message-ID: <20241224200521.310066-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index a68221a027..803bceb4bd 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1698,7 +1698,7 @@ static bool fold_dup(OptContext *ctx, TCGOp *op) t = dup_const(TCGOP_VECE(op), t); return tcg_opt_gen_movi(ctx, op, op->args[0], t); } - return false; + return finish_folding(ctx, op); } static bool fold_dup2(OptContext *ctx, TCGOp *op) @@ -1713,7 +1713,7 @@ static bool fold_dup2(OptContext *ctx, TCGOp *op) op->opc = INDEX_op_dup_vec; TCGOP_VECE(op) = MO_32; } - return false; + return finish_folding(ctx, op); } static bool fold_eqv(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853218 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081519wrq; Tue, 24 Dec 2024 12:07:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVGmL2kBLq+Tz/SK3bdhAQvrCQ5/YFSOvU7uSC8Q24s+TvFfw0mIkI1WaNIhETxRpZobdxatg==@linaro.org X-Google-Smtp-Source: AGHT+IHAztttG7/zeOWJn9qmA+YeCbOalMOImoAUdcKRk582w8rea5lk54vOEb8Kub30iBqAhZKN X-Received: by 2002:a05:622a:283:b0:468:fb3c:5e5e with SMTP id d75a77b69052e-46a4a69066cmr215466891cf.0.1735070849131; Tue, 24 Dec 2024 12:07:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070849; cv=none; d=google.com; s=arc-20240605; b=k5cvOJpAleRQczzcPQLYDkd8Oa8s9g03ZewDgs/h5SdneFLoaqGhqlYDbG5lAK6QtE tna1/teBmQXEmh5uSS+5e/KIB4NIQsC3HfmyWxj28kj9BMIj8HbGr7aozSoBmmyPC2Vl 4PvAtnPhkZilgbkffqFvGcwo8DP2nZ7K2rNLpa1rWuS+aSFimRj7qgzVmuR5rrcRU4a4 UYGAt6hDsI0kKcXvxG+Ypi8klCZ2nMLpYovubyQzmo8pI2k9qo1t49IuphPvWpvYNXf+ UJ4eczjycKC/oCU5Wc2/34Wjx/wMD19fxpwRONHi9bJQVOuuuhVNzcJfJ4v4f2ppo1pU 6Ynw== 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=dMXDaMRpMuM4NGt0K+4xH1eKpmwbvk+xmZf9n7LcDNI=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=KRe9HPGPaRrJv93aCMjLr25oVqON2AF0I2phQskfiP64Di4fQ5jLA0OGRgl9Wc6uPA rJuEFO0ikii7kP5xwyU/rwfNqsz/pDOcl5Ea8w0okQ29xFlN7tE4F3ZWupO1A+eAgWnJ aMUdH70sb5z6/xd4IhG9enZ7tZq151Nn7wKmEXdKz9UoL8bQcRktwy6Onbx/VBHgF4SB Wtq2OWohw8dion7OeNYp+RZU0ZHQIIqL2Lx+JvWm/ULR6YADSgJX0SwloYlvJVmrJocs jahYq3dzUW7CMV3qO7ni3AqUVXZ5L2kASqVZ4VpyU9rQQt1fSpeRgwVMvVzFP8aIfucY U8qQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DmcC6s+g; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e688a75si135395031cf.107.2024.12.24.12.07.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07:29 -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=DmcC6s+g; 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 ) id 1tQBAn-0003mT-Pp; Tue, 24 Dec 2024 15:06:34 -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 ) id 1tQBA3-0002om-2Y for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:47 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQB9z-0002Zs-PA for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:46 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-216728b1836so49402085ad.0 for ; Tue, 24 Dec 2024 12:05:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070741; x=1735675541; 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=dMXDaMRpMuM4NGt0K+4xH1eKpmwbvk+xmZf9n7LcDNI=; b=DmcC6s+gp6hiqc+SjBCQ1eCNGXcm93q8HWQzPcL1mtm5+eO3A80eU6I+PJQVtTC7sj hpnXyf8iKTZHyBzKdf7Du2smVrtx4Ac2/U6mKyV4uhpLJONjbdeEnm7IvbftoVMLuZ7b bFvYnIYR5LvvhqOA21wfod+c17FgFk9izybnCz7HytBpRFTiHxyOV9693A045jJAdMHM GzOM5Ufomj7UQQZ5lIytpZKVZPi6bGbhvwkeIvFS6v4vwMpB+hGGeWHDDc2Okn3Ja9i7 yqq6XnE46Tbm4RUqC+85gnujWHccH3StbvChMgAsEd4Kvub+X+KtZtCkMz+t7bluDnvh X5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070741; x=1735675541; 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=dMXDaMRpMuM4NGt0K+4xH1eKpmwbvk+xmZf9n7LcDNI=; b=Gx7aH//Wi9jnJsI4wcSc8MHNJngg/K75QorTB9ft7qCkMoXirBVe8FekvDikU491Wi zQ3tuusbKZhI+LB4SOBGQ6u2L2z9vCUW950ulYImto0p7PIBHEvN7HqFMj0R2rCIF83V 2O2w8BPkY71ggWbY+dnSBtHozng0kRz/twqQMQWMGTlNM6ijasUCjhaMzqXIbcmeo7XH eXs3mDo9h5iuB78VFs7gxXOQRPuuvbTko2bwewe5E1GVODCeUZKaY5F61AQvdUmBwvrM WlcMDve4JNMlHvmkc5KSPi6ENfqNA++NJVH1Q4TkfYaD01JjWbdgVRZG7adZ4Jqgu9Gt uTqg== X-Gm-Message-State: AOJu0YyqQyc0+1BNMb8iGR3uTmXyy9FGKgsKR4rsnsoaeHTWa1P0Al/M 9wMoU7Z+ukadtdIJczW36dqe+bC1x7JsypaVBtL6OOb/2y0FDe8ci1eF1vVCR9aXFzlZ3liLubX Kwj0= X-Gm-Gg: ASbGnctVqf30MBpkU2VzgbY3wo5e9PZ3BsdD0BtwJYNiMb21d3aEge25kMwdt+ZseeJ rObS3DruAMcXwZYtjXRj5IHfVFj/Y+jXv9ipFqdrz6epu8AgynmbOvCCcHbYoaowy7dh9quCDBg KV2fLWUWs3+W04nwjxQit8eexs+nLZz9SG5lgg4RzFdcGEKAH1p3c8JfxJcdl+uHnHhBBvkPd2j hIYvgACInHX5mj2bMg/IyV2Xw1lL/+WXHy3hGghmzcDl0YyVmsGNYPMk4Ir6jHfp/SweXk0PMFS MZSHApzYIxPltBUyS4aKKlCjEQ== X-Received: by 2002:a05:6a00:240f:b0:728:e40d:c5fc with SMTP id d2e1a72fcca58-72abdeb6267mr19386465b3a.22.1735070741555; Tue, 24 Dec 2024 12:05:41 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 20/72] tcg/optimize: Use fold_masks_s in fold_eqv Date: Tue, 24 Dec 2024 12:04:29 -0800 Message-ID: <20241224200521.310066-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 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 Add fold_masks_s as a trivial wrapper around fold_masks_zs. Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 803bceb4bd..f948cc48c9 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1072,6 +1072,11 @@ static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask) return fold_masks_zs(ctx, op, z_mask, 0); } +static bool fold_masks_s(OptContext *ctx, TCGOp *op, uint64_t s_mask) +{ + return fold_masks_zs(ctx, op, -1, s_mask); +} + static bool fold_masks(OptContext *ctx, TCGOp *op) { return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); @@ -1718,15 +1723,17 @@ static bool fold_dup2(OptContext *ctx, TCGOp *op) static bool fold_eqv(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2_commutative(ctx, op) || fold_xi_to_x(ctx, op, -1) || fold_xi_to_not(ctx, op, 0)) { return true; } - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } static bool fold_extract(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853222 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081625wrq; Tue, 24 Dec 2024 12:07:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU++HEvTI0uXLwEx+5JFmDBpA2szj7yPrQ/lFKHMHaaLJYA/1AJG72qPFA+sZf31X885afdWw==@linaro.org X-Google-Smtp-Source: AGHT+IFzxI8wL1to/4Xn5wAYvvpPNF9+8/If39gQ17Syho/TVOkegBSDpJhqtzAagIdq/y5CQ+Ju X-Received: by 2002:a05:622a:19a9:b0:467:5559:39f4 with SMTP id d75a77b69052e-46a4a9c1d8fmr362125791cf.56.1735070868657; Tue, 24 Dec 2024 12:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070868; cv=none; d=google.com; s=arc-20240605; b=CIOa9Qo7vr1fHPGa9Ki0VXpkPZMzTftDVB6oTGGczMv2CIjR5IUf9KyvaptF2+rIq8 3uOlbnSMnXxzvd2uzyy6TotG/7NhJDDf/eBWQob6v8mkO4WA4bhynWk42syVbk8pZWvV 9o/sMsD5jPnjylgBP/fNIRaIcIFt75xgRtYXfUbM1ygfO6qkKqfeBnB5Layo37CtKTky YZEkPAeSydnurpGBBrs/Ga/sfaPpFp38Ce6qEKjJoO6OseTFq8rvOD/ILfm1sjhAh4N9 w9xp3KU0PMnE5JmpJhoE7W56fvR3U6Wg6heL0eyU6JAb6QoDPYNuGlkl3GDuFPxKWlT3 wUIQ== 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=QpM1VqzEizRAO5S933D2pTQEw1V6cPopLqjkgjzXZkM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=IW/qW4pAxbEMEVXmkUHF1w/kTYmH2yPkoYvcM/yNwluDbtJAA/roLAAvxeJtutenYA X9uhXQnMOgOuKCbksszeueUKHl9UzoX4VRwkDHHqtdw/M1B040/mFT0Ccaf1sJmOsKlp JFvcF3zjEhWLjmB8E7eocEVeX1B5FmeH8hd46zscc2pvETmvgPMWUXuncJzJ0bXxKaeS E/+/6FqYPJlOsBf5KIBT0tasFvA1StL3CQKBooSKGEG9Tsi5usbIJKubvGpaJ7XaLsBn YBCigUn+s69L6KOOfqcHEVOAaKErEwBM8/Hm2SJc8hwzhKtsMgccn6/YEDfiEUmH3/x3 4mGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YEBRN/Al"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e6ad760si148861291cf.210.2024.12.24.12.07.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07:48 -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="YEBRN/Al"; 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 ) id 1tQBAb-0003YU-LW; Tue, 24 Dec 2024 15:06:21 -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 ) id 1tQBA3-0002ok-1T for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:47 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA0-0002a0-S6 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:46 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-216426b0865so55668565ad.0 for ; Tue, 24 Dec 2024 12:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070742; x=1735675542; 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=QpM1VqzEizRAO5S933D2pTQEw1V6cPopLqjkgjzXZkM=; b=YEBRN/AlCXpPLkL6xDfw2zQmd/eSk+cbYpFBLQt68HcmYAW7dP04ozrawc/0Xqo8nl 7WWZdo4/n4stHTQdApxOxvVXJtvvU3i0o55Io/Odz4iAbuLSvqi9akvd/9rZVgsiqFMh xx/t7Upd3Li0HnDbGgt/Yhkr8yE80jL5zq518mfZWPKlKUdUQ/QP6S29/3eciL4Z9HMV Vv+YR0rtbzX0gToIcvjDmYu/O+qKdft21D7BFuNVnf9lGrlKksByBW9Ird8Dqafe4Vfw 0p5sWpsXocmPTaso3Ambt2xQwqGS2ZI4affDNY97lap/DgGfDK5g2dE/I05ihllnlC4u 0jLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070742; x=1735675542; 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=QpM1VqzEizRAO5S933D2pTQEw1V6cPopLqjkgjzXZkM=; b=pV/P1Vmwxq31kO1wB3zTZEyYHW/enG63jzvlJXUjexzeZVGO319v0wj4Zf3nAw4mCb gQQN3Qt8ezfBMQvEgGafafkjKiNuBOspQePAwTePRckb7Tv++qef1qbyFLIdRThPUrpm iX/UYAsSzJ3xqRIHysv5PS4wcPS+5Z5beucUyTcwkECZL43XNW6Mp8R5nO2XfqWtYCK7 FnMjmSnFgyjV8N4APEYJVywMW5WpQOs0toDZc19BM3fdwJPPxQjHQ9JvkuAWY0et+mDm GiSXkEpogbrgLwJuvw5V8FgBDh0NcXwEe4JfANWngWoalD0Zoi6BFkWbK+M8ggVLwP5V ka3w== X-Gm-Message-State: AOJu0YxlOwEuJEPA24ZrWOyeNOa+4pI1ojSS7hky86gC+ysgVEXBTm2y zqPHHCsg4b3fyXQ9Otm5DnHc6M2nUdd/flnXnpFYje1OQzLp5f6ozcQ5vvUnYZhJBkt/JD3b2Us PC7E= X-Gm-Gg: ASbGnctTUJ2OhzFUGHDO44T6osXLqf5y+Gf0LptPSZiKnO7G6RpRc+cpJJ+u0xwERjv PhN3fGY4KnDP+XEW868tbz6z8UUjLeUsxesc0fZsZGvT/rCfE2HQ4BzPRCE66mFc7V7xBKLtYc4 fc2INMv9syA+LKg9vTTSYr/G3AnL6UYUZmIBHiPCcvQG/F0Gt/KnCZwisAdsxZACMjZTY3TThBc YocoxvyCW+uSBwJsZZqb2aHP3vSRsUymJNcFN0rlF0JHP2B0r+I0oYvAAKIYsdA5O0kuJDBGC0X RR+QVcznNjHfrAmNDpn6ioDzIg== X-Received: by 2002:a05:6a00:4ac5:b0:725:f18a:da52 with SMTP id d2e1a72fcca58-72abdd3c1d4mr27143519b3a.4.1735070742443; Tue, 24 Dec 2024 12:05:42 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 21/72] tcg/optimize: Use fold_masks_z in fold_extract Date: Tue, 24 Dec 2024 12:04:30 -0800 Message-ID: <20241224200521.310066-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index f948cc48c9..8111c120af 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1739,25 +1739,22 @@ static bool fold_eqv(OptContext *ctx, TCGOp *op) static bool fold_extract(OptContext *ctx, TCGOp *op) { uint64_t z_mask_old, z_mask; + TempOptInfo *t1 = arg_info(op->args[1]); int pos = op->args[2]; int len = op->args[3]; - if (arg_is_const(op->args[1])) { - uint64_t t; - - t = arg_info(op->args[1])->val; - t = extract64(t, pos, len); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (ti_is_const(t1)) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + extract64(ti_const_val(t1), pos, len)); } - z_mask_old = arg_info(op->args[1])->z_mask; + z_mask_old = t1->z_mask; z_mask = extract64(z_mask_old, pos, len); if (pos == 0 && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } - ctx->z_mask = z_mask; - return fold_masks(ctx, op); + return fold_masks_z(ctx, op, z_mask); } static bool fold_extract2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853262 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4083932wrq; Tue, 24 Dec 2024 12:15:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWxC4HCNe9mq8Ou90UdvQ7lY6WVq0w4HwaGOhMASRusmpGYZou5gwp8A6J1PBIPOd60K0XErg==@linaro.org X-Google-Smtp-Source: AGHT+IHGCkU+DXBiauCpoSlAB7fBf2XFN9YdDNoGsBkREJgnDMpSSphCVc+nQ1Rpxk/skCItTU1o X-Received: by 2002:ac8:5245:0:b0:467:8628:a32c with SMTP id d75a77b69052e-46a4a8efcb6mr269663311cf.27.1735071315651; Tue, 24 Dec 2024 12:15:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071315; cv=none; d=google.com; s=arc-20240605; b=Cmmr8fbRlSSuHKoIsRWcXGNL3Oo57dcgS4K7pA0/ZCOPtCjf+EJk72McpHcvZb4siq gI/yVQplPiQdC52YAv9dzlVYhzWCzwvA7DbPHOIgCLpkqWD+BUqmf+r8M7mUR9AuidrX RLan5tUT1PuFS4TnEk4W6Q7IPB7nLWFuadF95knuM6H0i8epFpZYOD7+/2lQIfXsXLFs rap4fS8M2auvk5XPE6EjrlqTzsV+Mla6mLdYNT0hq5gbKva89jt5rHgs7ywT01jhXVTI eCyOsy1czspQeiZjshL3kEHVs2moLIKT1cxu8FiFYQvOCUCw009BeP8OLo1Z3CbB61DN GwCA== 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=nPKsdrymAAbkS1XKYSlzg/E9Iz2RPvK/Ig74oqbHXos=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=iWG+nR76xRtvlNH9mS+Gi/FZIa3INvV0+s3tAbzYfey+zpLEvT15v8Uh3B1wyd+OAs UasOCoaNqW9UN1WaC5he4fMXiJT4F9C9h4wZ+hMGIHIzFIaH1TXsDSG/nLfSsu8+qab3 WtcBPsYvBX+LAZE4Ibqf9dNnGROkapeMPTXZfp1cCW8PiNHZtStQSUuaYxQqfucrJoID F1UjaGaPY80Sy3MQ1dSmpvCSiVMgUPN3LOxSOfCwCS9rsKnU+SFFBzrzcVRM8SjMxQTK nheAjtoTW7V+zyJ0n6e9rGB1OsEsqFOskF+LbwDZ9D+j0FvjUNchn20ZBoJHyqI9loQV xvjQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KtDNWgXB; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e68521dsi149423031cf.13.2024.12.24.12.15.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:15:15 -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=KtDNWgXB; 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 ) id 1tQBAu-0003x9-Ur; Tue, 24 Dec 2024 15:06:42 -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 ) id 1tQBA3-0002oy-HY for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:48 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA0-0002a7-SH for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:47 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21654fdd5daso55264825ad.1 for ; Tue, 24 Dec 2024 12:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070743; x=1735675543; 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=nPKsdrymAAbkS1XKYSlzg/E9Iz2RPvK/Ig74oqbHXos=; b=KtDNWgXBIbfNnxpSO+WVubHDXDaq82UBn5/iqJzo2oF5j1HYgsgqfI7PNnOCkvYd/r 5i1zMqVjzPN6v9mKfheacMqR9ZKvlWoXgjqhXMLgH36M8VGbibYlFtRujAV9+u0Wm4LW eRInWLyEm2ifgWK7A04DkSU3JENgp+yq2a8n3ryb3X2bmurIE4k0cyydy8xVEltfgYQM sqI1I2iPcxonIeop6BS+9unXfef48x04AgVF4cQ+fJMjmrQyRn0hzsnuI2tLRQprTkTc r1hZ8ZwGpFutPnKSxbb10EYJX/AkNRicC8I8E79FdZ7N2aGQN4g/ArvCUsjc7o0EBb1s 5Vvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070743; x=1735675543; 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=nPKsdrymAAbkS1XKYSlzg/E9Iz2RPvK/Ig74oqbHXos=; b=cBwseDxNDu8gm6yepwd1GIaZg2MYPr53M93twH1sCKWtbexPcXUo7V4kS1CoYl4jYq 5yV+biS4VaRlA4zNfN+Y4BW759uzEtjlsbtO3esUn6ebZF5dBZku4aBxnhHr1u8G7Vl9 v9nYlfMfOe7yrPD3jtTPmyP42wpY453QKtrLjoxZC12s3PHGdZxnNDiJa4VqSX2qA3W1 IGWSZw76YnuknnTutrrn2xy5+ZJNtQmUvdYoIlIj9xXd3LLrAVWd8bJefrGFIQXnvgoE 7GbF4vOPM+bHhPjglBkD/RtCXNLF6fdvTz8rS4LRfXb5CqcRFnPZWV+AipNyMdrse6Nv ooiw== X-Gm-Message-State: AOJu0Yxm6Iq0rf7nu8iDE6egM7+r7MDOBunBVD6/byCa31IVrZngbM/T KC27jAeo5U6xNmULBJ1lNZidHyl+bbYIpq8wzV+0Zh0qtpOl63DsCuhSKxc+igCcvve5wAHWKkT npKs= X-Gm-Gg: ASbGncsavEErd9bPSzOcYjpJ4MmYATwSbz0wxtJAR6/h+prDKKvQOfRt6MBwrJKDQPL cwQRTwfFk3vWrlijBiPjtv8ln5rkTSQgjy32kuLHsnUdwzefhghjzyGir0Uid1iI2udI4jjKge8 zh9IS13derva8ByTGmn3Sk6/AJFxLRtRSuRLPHArAH/CHL/c2QpN4uFZZmF8vImUGNKYoktm2KX O6ITeK63ZFMLwngs1ekIY04X1efULdDEaJUjkFrCwpBoiG6KUO6+FVA2CgCEMyHPkeU15VFq2rL PE4qC9UQuX+0yJyugJKUHDnqkQ== X-Received: by 2002:a05:6a20:2d07:b0:1e1:b44f:cff1 with SMTP id adf61e73a8af0-1e5e07f9c06mr25390234637.33.1735070743264; Tue, 24 Dec 2024 12:05:43 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 22/72] tcg/optimize: Use finish_folding in fold_extract2 Date: Tue, 24 Dec 2024 12:04:31 -0800 Message-ID: <20241224200521.310066-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 8111c120af..04ec6fdcef 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1773,7 +1773,7 @@ static bool fold_extract2(OptContext *ctx, TCGOp *op) } return tcg_opt_gen_movi(ctx, op, op->args[0], v1 | v2); } - return false; + return finish_folding(ctx, op); } static bool fold_exts(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853254 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082823wrq; Tue, 24 Dec 2024 12:11:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWqHw31XplfrX/esBpgM2t95kvTB8T/7+WwpJzMMgMOjDLvsfWRfDA5ihZ1T4BA9VqYP5N5fg==@linaro.org X-Google-Smtp-Source: AGHT+IHSpmFxmTSg7ww0z/uVT7iJvjtH7ozwO1yh/vwy3bpZT8IOOYruksxb0nanNs61HNOFKgQS X-Received: by 2002:a05:6214:262c:b0:6d4:1680:612d with SMTP id 6a1803df08f44-6dd230f3fd3mr294064046d6.0.1735071096429; Tue, 24 Dec 2024 12:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071096; cv=none; d=google.com; s=arc-20240605; b=BvckrzCJdHNVZHcBvTPqMssGNyjevGcH2Wk5BDNOdfWSV+AYRX60s5UAfdNABT5gIu KnPclGRdOIB14f1sO0IE+DYF/3p2e0CooigShwcXvxkMzJCM9Dpf12XSLZkLB/3LXBtE Jf3pMRFJC0bpLDrjl9vGupjIXdcuvHLtfNOVpVDuI5H/VJ3oG+Q0W1u907zumtvr6lhg 9HeT2YK9NuQL3ecHKFQlvOgbBF/rxkIk1QdVFlajBepdaO7y+ENChF5tEMF+2fjlVOfD YzlFPy4xvCLjhBeIlP3AlPwvtS5LDfB5TCZIfySK4IDAl3ZnAQK4ilX1/Pdyf0VOWVbA 0Zhw== 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=K74UPQ6ATO0nDrlE7cqFEozEZk33xGq1bz1J9EIx6SI=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=iR9Pwp5lsQt5IR2/5LpM+LaL+rG1CCYOuEV+LMfqTuC5yIZ4a9LeuVTyasE7suSYbb ofi+0Qk5/3ls+8uXCxx7KtnlZTvaqmkkECnzyLann3LdjEyVP8WwsvLcIV3neIXPSGKq 3Vpb96IjiU0QkY5hnGEa1o7XKRHDKjkKdNbEIt16kAR2K5w1/bpkMJFxDmdx74Ii1x1z LI/zvzEabpZKVHk6qszzRfCylX190Rm3LL1GHr6LIs9EsgIqYXLic4QzW4bsYpgCzzGO KO17DCvStKceWyWzl3jcI4C1Zvk41ZJb696mCiyO4VVOICYYCHTEx09gkYtZt0X9c81l O66g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pBZJ9KiB; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1824d2e4si138476766d6.300.2024.12.24.12.11.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:11:36 -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=pBZJ9KiB; 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 ) id 1tQBAy-0004Hp-MU; Tue, 24 Dec 2024 15:06:44 -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 ) id 1tQBA4-0002pB-BB for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:48 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA2-0002aJ-Q2 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:48 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-216401de828so54802625ad.3 for ; Tue, 24 Dec 2024 12:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070744; x=1735675544; 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=K74UPQ6ATO0nDrlE7cqFEozEZk33xGq1bz1J9EIx6SI=; b=pBZJ9KiB9yKcGMNwZqXl4IEVdV8klzUCp7NRGl4Q+ee6uEFp3l617IL+KSJbzLX35T X3f8uei0ALu6yNTeztUMxIG3JPjdre4LuNEY9P9NBxaHOOMdXqGIHDx7OnWwpasfzAfQ 5kKQ2m0gGDSf90wT5hwpi0e8mNq4mmUfweFe1yzNYfCkVlK7Yf7Uucp6n99CFkTHr48o 4svWZD4K180ZyqOYhvgCo5BVaeM0woMTo95DB8iVNeC1uVTdOm6FPvTsk0z6qmClpexd uwOwCVKdmGdXMAClbyomq/FMzWJBoyAbT6SVKKgKXdDU1wqBntLTP249Pb+TDGySy0vd MLvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070744; x=1735675544; 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=K74UPQ6ATO0nDrlE7cqFEozEZk33xGq1bz1J9EIx6SI=; b=qzY3mchwZnsY0Bsp7cnrnKe2cfOiFhCt3dilznvmErlZ+eTTJFjxGQ483FhvrjI/F+ gFPjzTpUS9EcryRDMSq7H/754YirjmUqyBmi1YDFAQ6ixaFOLsdvwI4K0vksAMbRJes4 lferGBBYLk7RZlAQjL1cKX0fwJu+qFI9Zibyb240FsMbDe4CHBwggPzYNYXmrf+7cfNF fiz1mkkwN7EHYomvZYIKVBmoykbUTqtg68ysWTEYLb3Ni4MA0iLX9wA3ICW5n9+rmyeP Vugg69WT8lq2aWKaqN7L6yhY9dPHL4uEOfK27GZI+HEtBZFNTNRlm0eO0Zoxsb5iYsXZ mvSA== X-Gm-Message-State: AOJu0Yy3FEbtNNw6imzfE3yV6cvaorxp+QKGq+KmpJxw4VTM2l1zSzg1 mu1mrVs4XjUOJTr2Esj+bVOT5UWHDpMFgio4z77iDELDo2SK/8taS7NdknAzhx8MHbmvo0aguC7 RlgI= X-Gm-Gg: ASbGncvQZ7mVBglBtAmb8C/WyJ68zCAbVrDj4LaxeRe01lXXWfv7mjabTeAsVkr97xI fqWHHFdYR3T52HZi8msz58fQVIL7SDBOtuRU+RMY0Q9HtMmSezAer1jZppLfIclH2l+QBcyxQcy +K1zUkKCeNpG+Rghf7VqHrEI0ZKqfcBrPnzYF++AJJ0XDs8N0oi5YM50GdyslNeR/4XUgqtjXSh pWCCS2vh3VzEGo5f3bL7ECf9t5++HiSbwKd0i18JOlAhC7heKzsxKW20I9vwo+FdsTAWMqq9tJx q3SdBY00ekn9ZtYHzIMbvAMw5w== X-Received: by 2002:a05:6a00:414a:b0:725:96b1:d217 with SMTP id d2e1a72fcca58-72abdd7e0e5mr21657386b3a.9.1735070744223; Tue, 24 Dec 2024 12:05:44 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 23/72] tcg/optimize: Use fold_masks_zs in fold_exts Date: Tue, 24 Dec 2024 12:04:32 -0800 Message-ID: <20241224200521.310066-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Explicitly sign-extend z_mask instead of doing that manually. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 04ec6fdcef..3aafe039ed 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1778,49 +1778,44 @@ static bool fold_extract2(OptContext *ctx, TCGOp *op) static bool fold_exts(OptContext *ctx, TCGOp *op) { - uint64_t s_mask_old, s_mask, z_mask, sign; + uint64_t s_mask_old, s_mask, z_mask; bool type_change = false; + TempOptInfo *t1; if (fold_const1(ctx, op)) { return true; } - z_mask = arg_info(op->args[1])->z_mask; - s_mask = arg_info(op->args[1])->s_mask; + t1 = arg_info(op->args[1]); + z_mask = t1->z_mask; + s_mask = t1->s_mask; s_mask_old = s_mask; switch (op->opc) { CASE_OP_32_64(ext8s): - sign = INT8_MIN; - z_mask = (uint8_t)z_mask; + s_mask |= INT8_MIN; + z_mask = (int8_t)z_mask; break; CASE_OP_32_64(ext16s): - sign = INT16_MIN; - z_mask = (uint16_t)z_mask; + s_mask |= INT16_MIN; + z_mask = (int16_t)z_mask; break; case INDEX_op_ext_i32_i64: type_change = true; QEMU_FALLTHROUGH; case INDEX_op_ext32s_i64: - sign = INT32_MIN; - z_mask = (uint32_t)z_mask; + s_mask |= INT32_MIN; + z_mask = (int32_t)z_mask; break; default: g_assert_not_reached(); } - if (z_mask & sign) { - z_mask |= sign; - } - s_mask |= sign << 1; - - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; if (0 && !type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_extu(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853228 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081776wrq; Tue, 24 Dec 2024 12:08:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXK8AqpZOusGuToR0sPKqYc56XQ1mxZLf4U+HESqH6oM8QhMoIAHRtM+/5H15vljA+rePRuGQ==@linaro.org X-Google-Smtp-Source: AGHT+IHzFXqvcZmy3NOI7hsGzdMnneVk3wQdXLuIqXE1vRtQaIXyljSF7t+3l0Ts5jjPbefrLzVG X-Received: by 2002:a05:620a:4116:b0:7b6:cbc6:c87c with SMTP id af79cd13be357-7b9ba7a55b3mr3278624585a.30.1735070898959; Tue, 24 Dec 2024 12:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070898; cv=none; d=google.com; s=arc-20240605; b=M3fTa/tTymDSO9X33h6D1Kn1jVtXVI1ylfbiF586lzgj6hTlKMEjIA3TEMFzHm0dez 5fCBaRJyTna18JmpWmHKiERHa/r7V53WuhvGVUz/niEl0G+2N7HQRZiP6PMVezc7CH2y GKEaU4sY8cBtaBVZZPZBaQSTm4IrObEczRqstY76TPgEJJJN6iZPR412hoANaHRRQ5sl /Rvz7JFJZ+oRg0Z1D1Sx+qBH6pPcRh03Ia1Gdwi2q3e+HoHpAWQ74EWwnh/WkubWgLD6 6tcaQEO8J+084o0UjHqrASSQsa+L7LbuFNJMOzuiFsrQeQucDAjIZWlXObwsrgCd3xwm T1Iw== 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=k8tsF+Zaln0GqZenAMtz/m3flCsE/XhQzYQ3qzfdH28=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=UdYgc77EPqHRZHWosYA8m5KxwF0YLfQ+caSb2JTfRcBgjD77Cq9Rtv2av+N2gaUrI1 GNQ1auzDUD6uzQqCjsat1OXHP51mAi91gTsRh92je0zzk9BPTQkHU+hNtzBovXOCrati Hs7gTeCS93xqWY60lxY43Uhlei9DUfBn6YdTCXTbNC3kntCkHOFCFsT2q8KknDtMeelt xKgnDQeJb1bModk7RXlJEYxfBxIZLzTnKzuX4A7SbrPrhlTRrC+/LnTGKtIW5HB3msFX T+vqUllkAHWcGUYJ5/89RA/oIIKNXr9Ye60f/IGvoIfz32YWsCTmYrCWXwcK7kXvnolW WB2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bKaTgyP7; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac53e8c2si398239585a.667.2024.12.24.12.08.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:18 -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=bKaTgyP7; 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 ) id 1tQBAb-0003Xd-6r; Tue, 24 Dec 2024 15:06:21 -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 ) id 1tQBA4-0002pA-Aq for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:48 -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 ) id 1tQBA2-0002aR-QI for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:48 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-21644aca3a0so65832075ad.3 for ; Tue, 24 Dec 2024 12:05:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070745; x=1735675545; 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=k8tsF+Zaln0GqZenAMtz/m3flCsE/XhQzYQ3qzfdH28=; b=bKaTgyP7Uf1ixVkraHVLVwoDQadqXJJMeULt8uw9PwsoU01ysFu67Tbxo9wcZZ4+o9 lmBXCNMav8qy8PhuAw62nmRZWKQ9Cud+4hTz7RMKznRHGaldsWV1X4P3OvOR25+3Idlt PH9CYFKeyuoffwYMyH0TcUB1MOUI+R/dUzthSoX8Qg9FVzLUfQkTUyVtbqzX/sReaQyM aDHqOMLq5hWFQ5dfWvNSoTQbxzyyj8qaPx8e9viRftlTe+oxNxPtQHR8vwArUFOB79Wa tIYvf4YU+60XqjFLZvuM9PR+rRBn4K9iK0QiZPolRYt1d8D1foOh+4pzr63eP4YjfTEd kcPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070745; x=1735675545; 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=k8tsF+Zaln0GqZenAMtz/m3flCsE/XhQzYQ3qzfdH28=; b=T/siqLufsk0JvaEqLR/tNGC82pbbOHu//Jz5gHt0eIAbEZt+dypEEI50UgYpyZVVzT zZ/rEKI5iAjBhmyEB4HwwxcJUakWYvvTlZj2YqgQ7x8Soz3hRq6fJ4EGoezBH9DKsmzL DqnuGDoOuQ8vXFP2rBV5n1GDm8Ez3IBIgid+klYVVtA2Gx5/GyzUWkLLeIOxKxyCSYDW 9yJBjELQJUiMplZtySAeE0OAYthw+OUa7oDD+kWFhogZaBwSPH7HeXUlDP4+s6a/S1/B gZK571yHdyrmpObkmMlu6zozPtS914OEWKr1BRFMRDotTYjGbnrpkQj7jOusiEv4rYbc octg== X-Gm-Message-State: AOJu0Yw2KLNwgJERO5bSc/1oHqTMumiQyXOi2jkUnJ8eM3Y/uLbLx9DG K0uqn7H1MDoF6oH3Gk6CXsh4uLAF2ACWAW58rATp7LAA/h/2t4UBsYITrtTCWk0C9LVnL8t5F48 n708= X-Gm-Gg: ASbGncvUDHhZxYS2orJ4QxjXLTvE+HsV1pgcHRgr0LCfBySCmNV6QzQtnvBE6TVBWZI j5fz5FFmJmKEVKut4cM7oufsS0BoFcxodx11812qvc0S7aL/+yl6XEZWcDwkJ82c/LqQr2LpfEm N0gx0xMf0ha3plDP7ie4Dajc0z9W7/y1iu8i37dMZwT0MdNFbc3d7cm2zyb8pIX8gNA3hN88/HU ZBlziKRU01LX5B4UBykeIcplxs8aN5ZJSxc+RDMS4zBL5u/QUlNWkd0LY/HizCDG+OK+SFEMVa0 oHPIGRMvHjHYPZd/1BOW5WPKAA== X-Received: by 2002:a05:6a21:2d05:b0:1e1:a647:8a54 with SMTP id adf61e73a8af0-1e5e05ac4cbmr28870806637.20.1735070745152; Tue, 24 Dec 2024 12:05:45 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 24/72] tcg/optimize: Use fold_masks_z in fold_extu Date: Tue, 24 Dec 2024 12:04:33 -0800 Message-ID: <20241224200521.310066-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 3aafe039ed..f62e7adfe1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1851,11 +1851,11 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } - ctx->z_mask = z_mask; if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } - return fold_masks(ctx, op); + + return fold_masks_z(ctx, op, z_mask); } static bool fold_mb(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853211 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081179wrq; Tue, 24 Dec 2024 12:06:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUvdYxoyMamN1k2D3zj6pQ60NMQcGVO8y27IJ5QI4rzzrRSjRvP6pLYaQ9PVo8SVpTbRK8lLw==@linaro.org X-Google-Smtp-Source: AGHT+IEOX4CoNXEwQg802cAIDeEfoHyLxhXw0kDIleqc4LLR2VRiGQqNKzzbJo5oDsE2TgpPhc8v X-Received: by 2002:a05:6214:20aa:b0:6da:dbf0:9640 with SMTP id 6a1803df08f44-6dd2332ed7cmr283890306d6.7.1735070786601; Tue, 24 Dec 2024 12:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070786; cv=none; d=google.com; s=arc-20240605; b=H4Y9/5zoA/yw/CX0igMreZf4zBqcyb6BSv7tw/Ify2I1HFAZPtrZGuRfcZRaO52/Ht 99/3wi/1PSgzqHKfCGLVaDd/86umcnmJRpNbmtAnyXVb6gD29IPkDK2NuHVzFLK2a9BO zr7niyJO2z3ROkWW6s62flR/fdX5vXkWtDfK/Pb4qbdk8qaq2dbSwT0VysF20oZEb7tL gfmDcm08BH7Y/IsAepbeW1X3LxMx37C6CqUiq3CbkGQKHX0Yscj4ZTjKd+o35SyoIpfX ktxE0dvf2nuRXFyqhL0F9Qzb0JC25mQvYBfhrnPPapH63XO+SP9VXhQfpFZveWRio6mS XrdA== 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=MFhNaTorOWcHDFv/B5ASCBB74fNXcu/plUbi038NaCk=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=B4RV1mhHGSBSfHLpe8GRNtF81fTjT29PCOo6yhx7Sj3xo1PGO7so3latffwe0jTJIC yMA+9VLUOzZhuvwuY4yRrhTifFX7NKFyAtOTR6XJBHQkfJ+r3wo3w1twmwDHJGV5hYPD uGpvacWJupxjPrKdKRdIJ86X1jpkG46sTl0Sy8dc3a5lHqAE6dj1MXCjzN4DpOD5zB8Q Bn8wqCQIUX3j/LMPmsY0KM7Vybcb8w46U7OktbL66VnRjD+YCH0x6pT6fs3i0skzt8RD QMFrlDlakBpOKFZw0ezpDHwpVSRWS0S7Uw5QC8+sydRTOdB+erLiNnqzRJ5RYmwY3uZQ Cb7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j4tSOPVV; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1835fcb1si137818636d6.476.2024.12.24.12.06.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:06:26 -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=j4tSOPVV; 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 ) id 1tQBAI-00033L-Gi; Tue, 24 Dec 2024 15:06:02 -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 ) id 1tQBA5-0002pt-If for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:51 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA3-0002aY-C7 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:49 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21670dce0a7so73888595ad.1 for ; Tue, 24 Dec 2024 12:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070746; x=1735675546; 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=MFhNaTorOWcHDFv/B5ASCBB74fNXcu/plUbi038NaCk=; b=j4tSOPVV+oTkrDAZ2wkTvij8JL3aoam2F0OcLOEEVmlUN5rGTHci0u/5rm2usrLfbc BqOJ/jJoULvNYcA/tGZuTuoFun+tME1L+JcYCgIC1rAUoQ4DubhQa5+yRhDQ8GMUjsnF yu3cnSjPKoMWXS78uLK6JHgtB+MNL9ow4Vf3FXDE6QZPDiFySpiuGc3egYfxYeQZiFSz q89ws4nAGmV/FpGH17P6tlkaOrnVF9x0OrLM30MJvpQhusPDvrIznAcABpLWLz75UObE OAKkk0jP2weDXRbGs6j+MxD0vVoLXe8TTlToRvuCytquSrNLk98CfpiqJaS2jrMLnAjT O78g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070746; x=1735675546; 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=MFhNaTorOWcHDFv/B5ASCBB74fNXcu/plUbi038NaCk=; b=wMuOcVtZ0a/QxvN3DxBTeEAJqlDKCMUwV6gelFaYSYU72HqVxt4WJL5n+AxhOXK1Ik R5p79MEVA64TDnVf5vccAZ6KjAi1vvo67LXkehkpmJYX5EhUvqrDIt7HMOONBbIkrUVh Xp4oSbDPJ4JFN6i42PCA8OFjYl4NMVxNrqJmtQrDU7jNUAJQc9uu13QXYLxwYsu9HZVp tdl6/KAnj65rZbVDrJIS/WKn8m+XnPfgTzzV7XlqW1XdABQTqcxZbU/r3TuhKpnkiA9E ZAX1Qztzb2MqU0HGc5ni0AGmJ7ZVOXXRG16VtIYe/0mB9azz3jry/bPd4k/kXs2CNEaO ibow== X-Gm-Message-State: AOJu0Yx8IfHxBU1fnmiGsKgCVB1zvVgKwq2eG+AYEHYGNnIUEPlpvK7y 8y35wcqtj9C2Pj6rGG/Y7l9bA2g/UsPl0Oq2pMM17Rd7dz4GTO7DAA+i3lG9/4te/ub/BDsbHcI kocA= X-Gm-Gg: ASbGncvyemmWPZyy9dQvICRsNyB66TzU/pkAf4LAdlGVvOlyGuyeWbbXas3K67rlerJ 9GrHqcIPIxKyPjZbccpInXbdqEZHzQbEU1UYQj5hzUoHeCBAgNoq1ITgUsnjYEIWtTInJn9dHFC ApGaKcQWt53zYsJ9MtCYdvKMe6jcGDp427zLx6aPErd+WeZfYJQzj21PO4Yb5eodK8b8OPGiQgu 7tn7TY2zrocv04kqgSstMcHkmEaP2qQPbU2hvfx5EbDdg+lStHzrQUFBd8Od/hZkjayKQjSA1is AI+92aD9yRN3JeSM8JvZ+OC/ZA== X-Received: by 2002:a05:6a21:9017:b0:1e1:a434:2964 with SMTP id adf61e73a8af0-1e5e0459369mr26829413637.2.1735070746221; Tue, 24 Dec 2024 12:05:46 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 25/72] tcg/optimize: Use fold_masks_zs in fold_movcond Date: Tue, 24 Dec 2024 12:04:34 -0800 Message-ID: <20241224200521.310066-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index f62e7adfe1..0104582b3a 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1889,6 +1889,8 @@ static bool fold_mov(OptContext *ctx, TCGOp *op) static bool fold_movcond(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *tt, *ft; int i; /* If true and false values are the same, eliminate the cmp. */ @@ -1910,14 +1912,14 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[4 - i]); } - ctx->z_mask = arg_info(op->args[3])->z_mask - | arg_info(op->args[4])->z_mask; - ctx->s_mask = arg_info(op->args[3])->s_mask - & arg_info(op->args[4])->s_mask; + tt = arg_info(op->args[3]); + ft = arg_info(op->args[4]); + z_mask = tt->z_mask | ft->z_mask; + s_mask = tt->s_mask & ft->s_mask; - if (arg_is_const(op->args[3]) && arg_is_const(op->args[4])) { - uint64_t tv = arg_info(op->args[3])->val; - uint64_t fv = arg_info(op->args[4])->val; + if (ti_is_const(tt) && ti_is_const(ft)) { + uint64_t tv = ti_const_val(tt); + uint64_t fv = ti_const_val(ft); TCGOpcode opc, negopc = 0; TCGCond cond = op->args[5]; @@ -1956,7 +1958,8 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) } } } - return false; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_mul(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853232 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081954wrq; Tue, 24 Dec 2024 12:08:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXG9QJqlg9vBxDo6eoYbzLJgWMxsJkXMJExY7WsE3o6TZSk6AD6GDEkiJJY7uYTfSgXpeeHEw==@linaro.org X-Google-Smtp-Source: AGHT+IFf4/9l+8o8jMWfsc2MUeOQ7S4LV1s7HsOQegBMlovLW2lVUdAxhvofRc1/zllk7OEKSGkO X-Received: by 2002:ad4:5cee:0:b0:6d4:1d7e:bc72 with SMTP id 6a1803df08f44-6dd235c48aemr320523256d6.12.1735070932376; Tue, 24 Dec 2024 12:08:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070932; cv=none; d=google.com; s=arc-20240605; b=lgwmLqgSNmhm/oZ/hRhFekMHxiZOAR+CvLGk3EJfX5MP4jocxBQKSrsm2khyS6Nkmf uXwxUu3jViOdDbRA22dmecBVWszT7Xt+RGeZ1KsBHJWl2NftjxrcOHj6f+R/w2wtyjPK EMjiTrVZPQsMI96tOhU1BMThqLK7qXMjt/bo0RJBb3W7sWSjrb+yKmvCiFnYZ8aq4beq 5Fz6S7QWIo7ZcpyZ4jaEfJVabUTZKV3Gh/NLotEB7NoQ2i59S0cnZWu1KeCbQOXYd06S YXIM/f8c8ix+dFDwdMWEDHihgGm+MUygvUBcK6f9DVutbCaTUQH6ch/PInaoAFg0MKJK zCIQ== 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=8faF0oSE8gzDQC6SYYBtFIF/07pdwecYEYpdE3G9skM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=C5YlgzK2MsBg0jYqIi78pLmwjhWk15FTfjsDYL+0d1imHYfMyrUAbM0kkVlFIK8K0e AFHt2twy49InMPqOeUXDacs+x0zx3f4upwNAM5/Eykwkp1azZKXejunjvJ/mIYy5wMTm /uaeqnDHGfc6JK48lOBcUKnDvhVRoVZ1FNI1EHH05ndBIgCpn+W3SeuhMwrNE1k/CZWY uewyJhJ2Y3ctMcm0qnVWhAqrJuIMxQcJPEsTcdGBV2bw6Q5m+6XWABVTcscILVuFPTlL O0zrjbLzvyTyjRYvwwNuYOjk0XmjbgoOAEm46nlVJqApT5BCrXBfHulaFxjbNbJn+ZoF Bxsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KYw7HcC4; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1836ffd8si137067846d6.542.2024.12.24.12.08.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:52 -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=KYw7HcC4; 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 ) id 1tQBAT-0003Mm-KJ; Tue, 24 Dec 2024 15:06:13 -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 ) id 1tQBA5-0002pv-NF for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:51 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA4-0002as-9S for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:49 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-21631789fcdso46982955ad.1 for ; Tue, 24 Dec 2024 12:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070747; x=1735675547; 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=8faF0oSE8gzDQC6SYYBtFIF/07pdwecYEYpdE3G9skM=; b=KYw7HcC4uVKEqyhythEKIVNaVlby5crkZqqj5TY/qY+5khpcQsasQk4hAI3DBLo9rz ezHNhgGlnbnEOB7RPCkRc5Jpf9cTnIWj9FLaLl3s6SVndAlyXLkowpDiSOnA0aao8Ki3 SQMpWuIqjh8MR8ciIxjGWPv7/J8Ln2UCrhdXnIgXOHoiPU7vljH/U8/p9js+ZdBm7lO0 DI89uOJA0huyivYIsJHyDE++BLhxXZ6mG8VXCA6TdrU600Kvu5z8aAvrLhKysAFCqg4g TXMTEhEOewyQy0jE56CjDpJSR1LOdQg8v1/eiyE7H+BmeXPOD/Q4Mf8aF5pb5flLmYZ9 JCgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070747; x=1735675547; 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=8faF0oSE8gzDQC6SYYBtFIF/07pdwecYEYpdE3G9skM=; b=fq79QT9AY/H98kv/WQn2dYEAuXLeXUJGLwKvdvLo17YYbyE7JpdRQRxUKfFde90Vcn vNoja9/ZNjOXjT23cKHsMqHucz6Y2SkrCieGh/yO3qDG6nP9wdqD2nOob7th6UFWqj5B pQJgvkuDWkv39FTJd7d54CeHNJs8gwVjVzjy9YT+9ohCqCeaQMBaIzTH27PwaRSA/y07 yYwDeOYQBapnKvb7G2H23g+PeyHD/R2sD4zPa4o56mE43CBKSK8l/eyFaEbSRJnoNbHl Zom2S9YTOmRTslHp+pJmBvvvZwLIo+1HPrnj4K8UhTic49IkewHWqyoWzVbcZJ8hhQIu KUIw== X-Gm-Message-State: AOJu0YwgSYdWAH7dV9CAEKFSuwg5zMDKf0T3EKOZnZdaYSG0ZSaT4IQ2 bEeuAeBiS9REWbgFPmSCkx/h17b0KsMmE/czDJKfcRzcI7Enp7mTB9Qx8Vdq3zRHZFYL9YAaPEO +hrA= X-Gm-Gg: ASbGncswRUiI3SC/bzGRNryVwRl8Ua6fO03EJltNDtR6AtiIc9x4DeZbC5jjY6oM2E/ 3UV5LBFWyXOMD64qSVzuoitKoS7608B+tbqI6G8QY1eeJcN+mWrm0LJSRzPfJCFSsuDlll70gzW +BFdOxc7GgxH31Gt9vYc0+0HZPQY5zZFztRDFdNOHXCoYOmjvu5JxStaX3+rdKodwqoIEBveJGq GfKcf1xG98N/Nq6VKsChr8XvpSmANOLwM5iYcasBwkajCmeNOxEJNfj26HkOIGmBN+gXA6iGJZe vAak9XVkF30ABgyPLCRy6gsj3Q== X-Received: by 2002:a05:6a20:7484:b0:1e1:9dfb:2384 with SMTP id adf61e73a8af0-1e5c7001f32mr29900262637.22.1735070747065; Tue, 24 Dec 2024 12:05:47 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 26/72] tcg/optimize: Use finish_folding in fold_mul* Date: Tue, 24 Dec 2024 12:04:35 -0800 Message-ID: <20241224200521.310066-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 0104582b3a..10d1376f62 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1969,7 +1969,7 @@ static bool fold_mul(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 1)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_mul_highpart(OptContext *ctx, TCGOp *op) @@ -1978,7 +1978,7 @@ static bool fold_mul_highpart(OptContext *ctx, TCGOp *op) fold_xi_to_i(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_multiply2(OptContext *ctx, TCGOp *op) @@ -2023,7 +2023,7 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *op) tcg_opt_gen_movi(ctx, op2, rh, h); return true; } - return false; + return finish_folding(ctx, op); } static bool fold_nand(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853221 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081621wrq; Tue, 24 Dec 2024 12:07:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVpGRRPagekgIM9TyOx2cMNSTnv67/kUI9OptNgXHO3RLIb5BBGGYlTAy4KyQUxVcci3/Aw7w==@linaro.org X-Google-Smtp-Source: AGHT+IEs/S3WSSbw1sfwn2tpiO26z4U9cceqEAaW0Q4tXTyOGJM9HcuWjRxT5yGS+RjuKbP+X2K8 X-Received: by 2002:a05:620a:628d:b0:7b7:106a:19b8 with SMTP id af79cd13be357-7b9ba773fc1mr2900403785a.20.1735070868159; Tue, 24 Dec 2024 12:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070868; cv=none; d=google.com; s=arc-20240605; b=XBo3bTRECu2k18vZWD4CXYP1BhsAIjjnvR6HrPMhlaCkOIYEIo0L3LTdH8xvoJY158 DZXsGBp5sLLY09QKkOkvOz1O8apTepGjU3engIXdimdwlAllOCOIEHgDREXOPQ9Ns05m CFZKYoH9GPeECnxX/mPgPQvBLK1LdFDItuSCTl8TzvFq/NSdj9iMHSmeYg9eXlIG/+9/ W6ZMM/y5L+W9pQccpoB6v7JSocUj2fyDbuYCn1hXqVlEMzNZOfXdubtMaFIYAe34Mwg2 DSkRLSJzLDuEflv1H51KErI+0UGcBX9KmXfG215G5xwunKC9cnKm7PzwEZ5c6FiBuxar jWSw== 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=wktipe244FoeFQSExHME3WY9VZ8Aio+GMnAonDh7r1s=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=FzB0NaiuvhgFna+3xycrAObb06IX4TYcQUYXkhGO4C99ghw6kN1vVL+lyUpk+RCEjq NaM3aDFHPgh1CN6+9guD0Ixl6LgvpztAglky3glM9B3Bqy0IY+Lu4KCehOWATJZqC/oz +5Ok+cuk/YuePY5xibgW0hxUkThMuNlOL+39yDMmCVd1JiTWE/+ur5vHLs3klzQ7jX2r OewyGLN+x+L5DKKhyErykKwX3ds0qtz1WyCINWKTX748qiaGv6207jfGInul9Vw+cYMp SQ3KAIRxPXRD6FSdjb93J/iO7m1fBhmq9vK3tTEcaq5o9Ssbth1uK2M3P2WREzfJB45X nRzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BnOro3oG; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac53e1d5si1408551285a.612.2024.12.24.12.07.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07:48 -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=BnOro3oG; 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 ) id 1tQBAn-0003ly-QC; Tue, 24 Dec 2024 15:06:35 -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 ) id 1tQBA6-0002q1-Si for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:51 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA5-0002b8-8Q for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:50 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2161eb94cceso39841595ad.2 for ; Tue, 24 Dec 2024 12:05:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070748; x=1735675548; 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=wktipe244FoeFQSExHME3WY9VZ8Aio+GMnAonDh7r1s=; b=BnOro3oGB/Td4mAwGj0+5N29eIiGPm7Hudg9feDOWU4skGkuEX1SzDGrKD7pY1Fg0/ eRLqX+Bg8OMVStcLqn7kw9xlcRZOcc8bAH1Yy79EP9KIcd1bg1Z63PYADUHGm94PBuzS aUxqqDGyWKlMENtCt6OFxqzBvPMbU777fVPvhwq23pU/qZf8fHZnrqxT/i0mBZ7j4w2i +NdWe/rAssPvk2w5+ye9uP2vG33Rt1tPPMpGYs704fP7EKG89HPX3a6CgCZcwTTM5te3 dQvzcmJGFIR2BSWVessEHgnWiQlfd0Uc6unwXYSVPOycwPSM/2biabI+eQyXK/y7WpPb 0vLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070748; x=1735675548; 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=wktipe244FoeFQSExHME3WY9VZ8Aio+GMnAonDh7r1s=; b=YV9SdUR+wvs0nwa4yAPOwUw4MJOlBJVHFIDJapbZ0WoxJQuuiLpGfR8tSeU2Ihz39K Xd0U2DqmKDutFTPY5+qRY+wJiVW509Oo+qdtKoSnuTQOsVdDt+JpIqMGVOsX+/mDtA9K 54H2BjwT+HJfGqkj004ZMj26nEEUCl8frndy5DW41zlR/814DjOVxVrNewYMBKP+gG/e mFCYpgLMxhVg60+SjVKHjqqJiCUwCOkM8SUeRGmzDl+SSkUVPOY4GthXXp3oH+LiSRDf zkglCt/Nxm6NSJ2Zsu5bha4ZW5DlmziKSGSyQJGC0CR+3fM8YSKWPQlhTfCukQXHUzLU rwlQ== X-Gm-Message-State: AOJu0YwWVVke2Za1/eul70N2BTBcSfrhz0oD3mAnbIvHCp8vkgMueLCn xwll/Du7zh832q/BKhQbK7Ya/IVdPP6L5zFyLwqqwY5Y3IgQjAsFtQ7OHw1e+XDj08MfSp1CGbG hxG0= X-Gm-Gg: ASbGncv6JY7UzsyenMAOUrl3DgSXLcwZd47OKhQDkb3IreX4dCEwtKzUY4MH7RFJm0o 1Y7iBXs7hYZtVEliBlV0Gqdb1jTdlehYlyuGFVKW1DEAc24JnJL7Xbgv7kXHNtvcg+U74N7u0xy dYYKUK7M11Hq80IjLSU8RcF/ffBfaO73TAODdidsou4J1DOqfoi7HNLuUCucN2mw+Ur8hz68hUC lENcoCmRShsJkA/8UziexhHseeVHqXBWfKaZMhHDY0wqnQFWBBU+f9eSzk9hxukFMHs+EUJBzPs Qvc642himYfOMttYoAfBwhMx5g== X-Received: by 2002:a05:6a00:cd6:b0:729:a31:892d with SMTP id d2e1a72fcca58-72abdd9603cmr28693846b3a.8.1735070747929; Tue, 24 Dec 2024 12:05:47 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 27/72] tcg/optimize: Use fold_masks_s in fold_nand Date: Tue, 24 Dec 2024 12:04:36 -0800 Message-ID: <20241224200521.310066-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 10d1376f62..7fe5bd6012 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2028,14 +2028,16 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *op) static bool fold_nand(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2_commutative(ctx, op) || fold_xi_to_not(ctx, op, -1)) { return true; } - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } static bool fold_neg_no_const(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853225 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081682wrq; Tue, 24 Dec 2024 12:08:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXyoAKDRATfDYjaDiTtcRK7zMGpKp8m82dBneulKWVnDG1N8PcxF378XEyqH676vlce0yAohQ==@linaro.org X-Google-Smtp-Source: AGHT+IGYk/9QOMV53z6jn2qa7Vqy9iZj3DH2+RG9+Nhpg8nLBR7f9CFLyiZJYG0jswuVJg2Jxm4r X-Received: by 2002:a05:620a:2449:b0:7b6:f6ac:60e with SMTP id af79cd13be357-7b9ba7b059amr3287727685a.36.1735070880250; Tue, 24 Dec 2024 12:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070880; cv=none; d=google.com; s=arc-20240605; b=BiAks+H+D+jL0WJsaCwhdLSXGf1tO/Te/9qc48E7Ez1RtY9A++oqV0ncr2LVyeRRGm zOQEUqvSv2D96CSbPds0K91P59N4Ue39PMBUKOay/+PLDyEoU9fNRTeimrsZJdwPw31p UOaC0jBWEYVnIawIf1daJ+D0AxmHXncchA50Mh8NVWWfMgggm2m74waLD5nLQg2OJ3g6 oU96WIm/dnA/LhgSpxDQvQ+LSLPjf3Apgk4hEEVJemK5G2Z26hVgK/VWLQO/nxnycsgy V6Fy46z/C3GRdmp8G8AD726cO7M2IZ6T1RRZG0njqzOb3QWImyXwGparMBIUggRsQn6J q8SA== 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=lQGEeo180Fb11kHp4BmckzWOB9pBkkJv2EtGQzoK4ro=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=JaIaglKIo4BFPu1eKT2WZ+n1eHJJXZQYfgG+B3KLbOOPf19tEBjmy+L3SjoshYaYjS DbCUfqGqeguZshpjng7JAy7q52JibSQIyqhId/q/tdra3RRFrNXnXxi2ta2sBC8T97Fu PwCZOtrMEN9k1xsdPrUbjyDRrVWLS6bACkCQxVY7m0NMKOolo0lmE+mlNcKELGAgM0Rs oc9eXDodqCs1peoATM3Gr9FjVcAgv7AD9wpz8rJ6bjJCHyBJkCU82jxXMu36R3yjoBwl 4laIiFWk2ri9K3gF6ZIBK4rTYlFTtN5WdvU9GdeulZPAsjS6rlxD0rQm436Q514S1UFh e3Pw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZH6XJrll; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac47901fsi1547262385a.311.2024.12.24.12.08.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:00 -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=ZH6XJrll; 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 ) id 1tQBAS-0003Hf-Rc; Tue, 24 Dec 2024 15:06:12 -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 ) id 1tQBA7-0002q3-Cu for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:52 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA5-0002bN-VG for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:51 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-216281bc30fso65719345ad.0 for ; Tue, 24 Dec 2024 12:05:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070749; x=1735675549; 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=lQGEeo180Fb11kHp4BmckzWOB9pBkkJv2EtGQzoK4ro=; b=ZH6XJrll+RXihC94LDnpleBZwZ3qCRiiBElFVLz1yVHpWZIHJ+iAkVQlcpyluGMKSM XBQvjWJJRCFGgZQ5fVLVPUUwhr2V/ML0cU6sPPSIH6ua/9oqZXEHH7KMGI5is2oJ0Uu2 tkspb14X2lyQ7texRD0frOlYXTj7UJBomfJkEroBfwvLCHeRjaWL/rBUnUtg8RZX4jcR ciADGLmJOXSkCqqT2EuKjQNFjJkbM+lNgysXtVXUoTX8sC2qIm5Kik1PjWZ3gtpZl43h wdK/8FDB2/0JXj6QR8H6DX1ZnXxvMEM2xC0DqBqRooeniaDNF2mS1diJO7IxPyTNdzMI GU1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070749; x=1735675549; 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=lQGEeo180Fb11kHp4BmckzWOB9pBkkJv2EtGQzoK4ro=; b=Z3O50nFOywAghfXsykNjJWsObsZ4YBIgNIMg8ko2qZ5esLDmdZX4mSJ6TR8vVuKOjW oIL5X9ftXSH9G9ob0L5yixI2DnxM7xa0LjhFpFULmqlxZqfFlAn6MAhdZD3QS4bqNT3q 783sHvKdsT9M+Uhs3qUyO9nfpEeKM8j6tJT8FC/folxO/7oNoEByaMJVt2Ukq0kjRKJv NQpIeuFRejJShq3sWqqpfJILyliXprEeHz0YdSvjEUr7XkF4Nlph70ntH77/gfw+eklH Bd+1UtDQ4at28PKzplFJuv90JSzEAYa+nNN7Lm0NKp+FQTVz3XnEfPzCm++/bVoM8W1v Ow/w== X-Gm-Message-State: AOJu0YwSta8Sf1DpkjYxxCzH8eK3B7/8ZHA8bhE/xVSNTtm5H/cpGZ7/ mV1ToDf3q/UmT4zxoIBIiEQovMGzQFDyx39hBAoTXbx8gU9aRCdamOZoBJY3PPKN8gw8WjiQbji bT10= X-Gm-Gg: ASbGncv1SaGEQzXoYpLlHlACn1eBMof14bBcdwrYxlMF3i+YdcsHwzGgl+DYYNIQkRp tl0Zzyd8MMhJOYCQH+lJJMVLcs/R0nZV9EykypDkXRSYJYDg26kJoCsHLMd13cfl+dVJ8BTaml/ 6ZMCcOzagqFhDSpMiUQslbHl/MKUlA2q8hlM+TRyXE3xteF8x9D846NM4pSWmYKnLPY2Rh+s/1f zhIj7J1BQe90WmUZftOUnqN7VQwC1aUWFsxDOG9l1ScCKkas6lS1fmQ66fum1whYUqLV3hjwa7n fhbCR5GjVJAWqLKa2Ups5tcZOw== X-Received: by 2002:a05:6a20:1596:b0:1db:e0d7:675c with SMTP id adf61e73a8af0-1e5e045a0b9mr30610557637.13.1735070748808; Tue, 24 Dec 2024 12:05:48 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 28/72] tcg/optimize: Use fold_masks_z in fold_neg_no_const Date: Tue, 24 Dec 2024 12:04:37 -0800 Message-ID: <20241224200521.310066-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7fe5bd6012..fbaaece152 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2044,14 +2044,9 @@ static bool fold_neg_no_const(OptContext *ctx, TCGOp *op) { /* Set to 1 all bits to the left of the rightmost. */ uint64_t z_mask = arg_info(op->args[1])->z_mask; - ctx->z_mask = -(z_mask & -z_mask); + z_mask = -(z_mask & -z_mask); - /* - * Because of fold_sub_to_neg, we want to always return true, - * via finish_folding. - */ - finish_folding(ctx, op); - return true; + return fold_masks_z(ctx, op, z_mask); } static bool fold_neg(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853238 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082214wrq; Tue, 24 Dec 2024 12:09:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWfZzSgJ8oAY8ylgrnE6SC/RNPP/4dCJDk3MvDvmJjMMjYpMUdK+wdqBxmtholjdZ1NzlE0tw==@linaro.org X-Google-Smtp-Source: AGHT+IE1GpFys7od1PkQUP0gAWWEEVEvfmWneaqpNCqWJ2+WTPyaZ3ktjzd1Xwm5rAiPvSB4eaD3 X-Received: by 2002:a05:620a:3915:b0:7b1:50ba:76ec with SMTP id af79cd13be357-7b9ba84ffdamr3110845785a.52.1735070977034; Tue, 24 Dec 2024 12:09:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070977; cv=none; d=google.com; s=arc-20240605; b=bUbInhXtIDls7hIiE8Oma3posJiAlJ0jEl8bp/XMPTwCjRLhF31wOQlpVy+SES08Lk 8daIeaeD3gXwvYYUxfsAnmZJgMP5kXCUhbjk7WM8NbymRwfcuVeFyXbn2iSdP3Zz6BiN qv0ucpakTPpi7kQQmfVVOHaGHH+F495y0wAMGciPRIC+ZVAXmfeyD++XF5LPUrcLMz1f xDAbL5wjHFzPOpN7+1C4l9pDRDgOxDdyE3w60kaXICMvNWyl9YD+s9vaU7FHSnNCE0Pk jNl8lvv2FtmjG7xSw4a4b3Mj6/1PQoU9noO8xosvkonyafIzGFY5jk9kkDvsL8G/FST1 b95w== 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=m+KmIKK5m1+rAgUJimrheKhjHg0Yeug9PGMeGHHJk+c=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=WLmTg8BX1JRuT3rLgLmBNyVljCe1EJj+wL1kjkweGYjS8vZkpbW/2US6JnSlWYXSNe LHIEf2b0AR+ivxrDdag5oqUfU7hLcuvLKyKp13a9qP0O+WRPoM5MHqIjKpBXzG3gINIS ofG0YgSGFA9YT6u1n3HXEF1TNn6WPT3FX5hkxgZpFOfbwj9K0JCL/JP9tPWR0Isgdb1L WNLSECOtosGt7wR2rCgcUqdoQe9d8G1L1LcPW63z5Q1HFNVOLQ6J0EYcY99XoFlK7hUU rBNQ7lW7iRAQB4Kz33yAPu23M7qP/Ef6tUb4o/2u2uZ61hoiN83d8PCdvMcueUfnJLSa B0yg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DxNMIBTs; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e6ad760si148898371cf.210.2024.12.24.12.09.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:37 -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=DxNMIBTs; 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 ) id 1tQBAU-0003Nk-0o; Tue, 24 Dec 2024 15:06:14 -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 ) id 1tQBA8-0002q9-Dr for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:52 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA7-0002bb-07 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:52 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21670dce0a7so73889605ad.1 for ; Tue, 24 Dec 2024 12:05:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070750; x=1735675550; 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=m+KmIKK5m1+rAgUJimrheKhjHg0Yeug9PGMeGHHJk+c=; b=DxNMIBTsVmglyud2RYa5k0KvGaynqdLFy5i3nu2C3Cau+wcI+LgJ34k2nVQs3F7Iz7 OU2+KVNwcySRn5p6Yoj3U8DBpi1TcOuptWyG8UV0+uAKAZPr8+XUDeZwTsrLamFbmOLj JeZPVj7YYdSBiBvLHcrlIf1KYg50yKi5LNstCa07TFxSnJh62jkM8NywfBqpGm8ByZEr 6KY5b1Mspx+qAPNYfRWgpl1eHuWslC9zrpnQbXEo4OBXC+wLTdJER9G96Y3hRKkhchWd Nd3hky6HF7kcHxFak0U9JKzOQEXigSSdF5pQnw93iKaIdXs2cnCQ5wpGrXpEj3CjD5vj J2jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070750; x=1735675550; 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=m+KmIKK5m1+rAgUJimrheKhjHg0Yeug9PGMeGHHJk+c=; b=fTz1AXmxhgGYeyj3vKjdWnDFc+UJ3inJyQ8EV739DBgNm0m2FL5RNzkNNiYtBLdZQA Smzc6V3qUpAKTUkIp/QEG1BhEw3gPI7J65nztQHyDAzVE911i/Z4SoT0AefHPEYrwQpr 9RLz3lEFNglEZaq5xWU6m8ilxXw3luwxWZSOyZ7IX6EQYYvZ1NT9aDUeDSA/XKZ8W4ZC S4kILD58a9vdIYtGZTk+Sqz4YEKk3O89pMRYXLSKernyZRpYa7/9VMKu9ZCzM38vAHnJ bnVQQVUnFvYAGBBRF0nMxcA1UPzJKrNf2sPKcyHTTItbv2YFbejTrowH//SJUF9dDVOS BvKQ== X-Gm-Message-State: AOJu0Yw3NdLLwNagEKr/oe0qjaH685QOKfV1M8aEapFfGWTpA0gbvEas ss91WNi09NBbZHNd31KSEF8192CvZ07B5ajVxARIHhoJ5dkWyLh2pC+WyDlPZR/Vc8UB1Ct98UE 5EVY= X-Gm-Gg: ASbGncsoJS5+F75B5j3YW/KP7ZEpbTdL7RIupITN9VwVjNz9CMsRT3Xj4cDZ17Fu9gL PhAx+ADfMTUejpIWsAd3aFGrAEgHifJDQQ9029F2JEpAzRtWiyx54BV8wa1Wwn5atxfQp4eXHl8 6rRQDnFSK8wFjw28H8c66fHFMvxOHNWSIvTD39PwHZpBhX8A9oe06pzjdCyAnfRXuS+/M8wOwi5 WpJg1f2mfgsnkuRubw4S8lTemo7liZyQhy4hiOlp2nokaWV9KU7IxrN/cMrDRg1d/p+IsPCrFq1 S7xVHKeDAH4BykS0EmDlk4GkMA== X-Received: by 2002:a05:6a00:8d8d:b0:725:e05a:c975 with SMTP id d2e1a72fcca58-72abdebc11dmr26292281b3a.19.1735070749726; Tue, 24 Dec 2024 12:05:49 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 29/72] tcg/optimize: Use fold_masks_s in fold_nor Date: Tue, 24 Dec 2024 12:04:38 -0800 Message-ID: <20241224200521.310066-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index fbaaece152..acff3985f3 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2056,14 +2056,16 @@ static bool fold_neg(OptContext *ctx, TCGOp *op) static bool fold_nor(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2_commutative(ctx, op) || fold_xi_to_not(ctx, op, 0)) { return true; } - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } static bool fold_not(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853229 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081785wrq; Tue, 24 Dec 2024 12:08:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV11gpl7cDgXaSi5vMa3kJ+z7r6DEjq2f8NQbiNUHxjBPGbWCB/R9QY7lrFET3Wnh5hFz11mg==@linaro.org X-Google-Smtp-Source: AGHT+IF0GPOiMzv8kqTfwr1HU8piyKdto/TLRSNH8XEhfmb7KPAUzMifu5qRbx2N0n4if0P5sC8N X-Received: by 2002:a05:620a:3950:b0:7b6:66d0:5abf with SMTP id af79cd13be357-7b9ba83a77fmr2303404085a.59.1735070900656; Tue, 24 Dec 2024 12:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070900; cv=none; d=google.com; s=arc-20240605; b=PF6Cy4KaPOFhat6T8RiuDI8QlasRrH5mmkmgocU1yVGfA7VScreqvMtWRK5hYiovty /v0rNxD9LKAuAxcdFUqLSzzvwAaq5HLDOKfSfble7oqYNJKMHY0eZLNbaOYGBR1WlcPy gkj01x3rW+ZFiZw5S+PloTGSe8R9pumLjDo3eayAbNz1IItG1XOzbty99lQHFUGHaUp+ xtj7E8dLD00saS6XZNVqQGQnRCfdJfNsGWduw/II+7BK21lPi4O9qGLjC6+xoxM1fLoo aKBKdp4Y45FOk1Vynl+amnlh41Sk6wAbthHPjreyHlP/JfFpeusgWgJuTumlkrumTvRU U1vw== 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=aEBTSGoKSzGGXaHrfubxIygx65LoU6vieRsyMgqBwp4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=EQxEw9p3ViCxxESnq88vPdMQrDD64sJrK7ipj5Lu+SVu7G/avdguh2rtWCftU+0EHN Pc/Vmv4soeaqrKGeuJNWyUsWiNqN/k5Q6Ct8GAGCy2PEBwstCF/+ZRUYJey2SmIPNsmo r8dJSOSZ/jAQYKnGexUEImVxSJl1ZakMVI3FVhLQLE/httLI2fZzuKJa+E294W4MuaU9 6tzAMI73f4avJ5nYLrPutWpQlfDaLGJrhdb6VFdpLUfB/jHtva+FltjnXTSVXkGAVK8z /67LlOflWQskK6IYMnQfDbfcMLFzL1ybesr0pB6BAJFMUt1Ek/1sn1ZD69Ud++Bpomsr eobw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lFcTcIBQ; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ab6fesi1383009085a.10.2024.12.24.12.08.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:20 -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=lFcTcIBQ; 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 ) id 1tQBAw-0003yG-EI; Tue, 24 Dec 2024 15:06:42 -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 ) id 1tQBAA-0002rq-8Z for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:54 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA7-0002bq-Uv for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:53 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2166022c5caso50537755ad.2 for ; Tue, 24 Dec 2024 12:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070750; x=1735675550; 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=aEBTSGoKSzGGXaHrfubxIygx65LoU6vieRsyMgqBwp4=; b=lFcTcIBQJXQDmu+DRM8Dq/vAGqsOVTeVbv0Zhb8Uka8sudJIjgE5sDpGjUfy5Mh/pQ XwA82NceN6g4fBnncYlJeA7euIvjwSH9P5Ys1pVSELos5iA93LIDLN3j9igSzyGmBGkG rgnffitgNduvKe1J2XyDv8Ojc61bt5FFg7XZ5NRgyJ2UGUdCvtqm0rNMiidbbxG6Pt06 Zqm/Fvwn1cCJ6RkVBRN2zi/+0lFyj2pdX/KNNlB3UfzZgh7G0jBYuhysZTOXcSlxKCN7 SSZqtGeYcSXsbdFtw1THIPqf+svJArd4NknTuKBOlKWdUQ3czuO9d6/kbZLMUnAlE/e/ aCtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070750; x=1735675550; 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=aEBTSGoKSzGGXaHrfubxIygx65LoU6vieRsyMgqBwp4=; b=njzQPvXBJKq9aQQulckqunPEluRxWOZILhEu36rmOF8AFrRCdtrCvfwykouthqAey4 69GdM8CtymvOaykvdxp6kGJ4hXXOui0lcXeVRydES8SJEf+9tFgrbl2BUJkowpvcz8qg xRR215XOXCxy+VY1ewieustedXMam95vq+C3C72FWUM2/eQuJFZ08usyRi4TUyIclK8z EfnFY0ODMa+WfYFII32jiFmluZ7wWqKtXTsG/EEL0J7OW+lUMH4zQTFNPYZMCSuc4eBZ qkY86xj/Dxt2dW5uh73sIeH8km+r2YRhY+N8o9NGjBV9aglvFH7FAWZL1fyLigB9MWEn QFTQ== X-Gm-Message-State: AOJu0YypS5skf5xZBbvK7eHGo+PUpx8zoT3w6wDUj1fu/ZfzX9HtGdRh jT6M9fuL6m8iret4mRaJqP7Tme3pvk0Mptf7D1peNPEGqpgWoijE1M3UPIn0JR0DsyDugUUEVvt fHdE= X-Gm-Gg: ASbGnct/aBsdM01/op2KLr+rJm8iDvMcnpP1YQni97Rp7hJk3egczm5WwHJWzvQwNuk 7OiCjPvUjxaFBZHMmxmj9rOChmjbkJNdU+hwM2yKv2irUT0ylDhapRS1Ny/mnaTb5o/OMf/ileF crey4Sxb2ZcSN+uQS2NtIqzCOqZd65FPS3tt+eQ2ghKSalA7xZNR0PU0F9TTM4ZXgwHrUAgdtOG cSJJqUB8axjm4PvwXf7WR9seMrejYcYlc1RlvuO8Kex4MrGwhT2Q7CBA3rtY7u0n/6LJ8dygvPF sdIXqI41OiNcEwbRad8k/KevGA== X-Received: by 2002:a05:6a00:1702:b0:728:9d19:d2ea with SMTP id d2e1a72fcca58-72abddb2115mr26199908b3a.13.1735070750645; Tue, 24 Dec 2024 12:05:50 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 30/72] tcg/optimize: Use fold_masks_s in fold_not Date: Tue, 24 Dec 2024 12:04:39 -0800 Message-ID: <20241224200521.310066-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index acff3985f3..4ede218bfc 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2073,12 +2073,7 @@ static bool fold_not(OptContext *ctx, TCGOp *op) if (fold_const1(ctx, op)) { return true; } - - ctx->s_mask = arg_info(op->args[1])->s_mask; - - /* Because of fold_to_not, we want to always return true, via finish. */ - finish_folding(ctx, op); - return true; + return fold_masks_s(ctx, op, arg_info(op->args[1])->s_mask); } static bool fold_or(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853231 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081912wrq; Tue, 24 Dec 2024 12:08:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVZ+FrMcIuMQzKSPKyRcv7g205joqylmuC0NYDDJ6KKlr+sD00W1UGig25bLCLrobvTOu7yfw==@linaro.org X-Google-Smtp-Source: AGHT+IFe0pwyXq5quRwO7GoGZ4B3zRVNL4gEnmRdTtHKPGYoI/T+CfHq7ayEksepqs7jlJrdQkh4 X-Received: by 2002:a05:620a:1995:b0:7b6:d7be:2e4 with SMTP id af79cd13be357-7b9aaad5e09mr3054889685a.26.1735070924871; Tue, 24 Dec 2024 12:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070924; cv=none; d=google.com; s=arc-20240605; b=drW1ZRWKGZ2EI4b/aYgVv9smDA8tVK4nfopa7FGmE295G7toj/7uOPwqbo1rjAoSaQ g0rkWH1RcNYT4VJec8LAi7nNrrv6/PUvmpQeUTVhM0I0T446xnCgqT4PWMbSrk3zkLe5 1sBTq6jiimR4sfprUTdVXXwedQf2OctwLoH6bDAb2kR8oN2wfOGPuroQJwfgP+kxCk0b uaxgRL0zF0M+aVB29Ko7thu7g4t7OAIhtxTLyohrDXNImAxUA+2j1A8xIFWCN8EQpxlW UH+Cg0A/xTKkby7IqLp6dpSOqdotLc25fZDUoItSpZooGPIksZZlfvMDADw2b3xuCNQ5 pZwg== 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=RorC+bNoeysLqpLQ03oC4wLhRH1BlwQyizXHc+0rwk8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=DmNbKXj2Z7k3oTBzhUvKllm/MjF/0n6zVQ73caYBda+Zeywinu3qzKayPfwTzCgIm9 I1pnP3T0AtWOLJoqbOITX8S6qzRvPxT9aJpMd1TS4q0gNtbdgHHihdrCF73Zd+WiZI0z BtMP8/OBN+tLaXqJDZOf1sID7LscND7PZbSVeck7WPlrfKHotUAkag5nHRZ9dircnYVE vMvoHS8T5/slwcm35etoMccDv1zWoDBsP2zbBah1LJmibCVswelBpjeNI8qJ5aWgXZSs fe0jNYwzjfUU3/puc3m/Uxwd3yZ9mei7BrApmNUNZchk2oQtaH02vkKN+SSAFAZbmLN1 6fvg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UIgayo6O; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac47a3e2si1451140885a.217.2024.12.24.12.08.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:44 -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=UIgayo6O; 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 ) id 1tQBAx-0004CX-Nr; Tue, 24 Dec 2024 15:06:43 -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 ) id 1tQBAB-0002u3-KW for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:56 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA9-0002c1-Pz for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:55 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2162c0f6a39so64870885ad.0 for ; Tue, 24 Dec 2024 12:05:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070752; x=1735675552; 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=RorC+bNoeysLqpLQ03oC4wLhRH1BlwQyizXHc+0rwk8=; b=UIgayo6OoaZ0+wtR4EIj1hnV8r1YZ04K8KkVNP+rkzErNcB3Lf7WWEFyzUZYT1aFzb F5OdkE3ZmlT6Dv6ADlpdcmxarVsnsrYw871lGzD81bozwOkOfmYDBbfxVhc52R4k199A Ka88K02fo1FfcKg3TLLEqupf2jGb//IIpViwNWqEhHgxJ/oN1f8bUytrJIJ1CMRJbFNd MET1h4LsPIwjAM+HtI4WcbQxbQoDTNixRT5MZSnuMRoI+g/JBXIy9Zkek6OFEw+af2kS /goYHbB1Gr94KGjXrrGDJKg/cTe1Re3kJ+HLhW6YaXgR2sVqq+Mt+EzAJ+vlclNNH5oG h1VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070752; x=1735675552; 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=RorC+bNoeysLqpLQ03oC4wLhRH1BlwQyizXHc+0rwk8=; b=W/DQNwL13ChyhHAeiNjvUvEygSXsvE5oquyjCdrb+rdrIiO2sh4yxZ7Y1rmPm/9M1i ifkApQgFOo1iKhVXxYXYiKl5fGuJ4/tv3OBk1gl2YBvY5+w0C67QYEP91jGqm/1hjA4J VpyaiBGMTfIE2QP+rzgDT36VBhNOKIJIebw+1iRZ/Bq6HqffrfZunJw2dxUvGhIr4SbS IlgVOoD2+YRBgSm7vHOJhkqAwUSLXlrL0OZH6XGMfYUfDSOwT1ONFj1lwiwC+lXCo8FF IcjIjmGctgLQeg5kyU1RUFaxRASWCCZttFAXHkvAg34MJ0UFXiqS8cIMrkHp8c+o8EVs bOcw== X-Gm-Message-State: AOJu0YwMZiCe7q6YwTufzssDLm47qvC/4Fh7hsn6lPBrGQXvHZQx8LHZ Auw0Zwt/u+S2/6EdlcaJ3eGi8YijK9eBiVHLUEEgX8yAaKhz5e9FMA6Ea+P+YS6d0BkYuFXsrUl 7l0Y= X-Gm-Gg: ASbGncvspHigelU6DEmBpWyPeT2Syqxn7cvoDgcOVm3LtUKpQvVyEiEDLOoQ57ABANx J58Ig0X0nl1vuSH6eR1HvEPeOGUwQqMPChBrW+NKZZvi26+P4mcSkttlyuMp1GbvZVyfpTC9XvY ppIwnHCgBcNC9/dibsHrZ7t+d0VYZuXY0SmUei3XvCmSqnYdHwjGFm+NyiYMNSe+xXDrhp/mEC2 aORGzG/MiTCGbRysW3DMvJN35/Vurx0736qVpvJey4IRjxrO/wRn01DM2r6J1eGh/rVA0n2F7Jk Xb+6eBoiBNDzupdUZC0w2gqnSQ== X-Received: by 2002:a05:6a20:914d:b0:1e2:5c9:6831 with SMTP id adf61e73a8af0-1e5e1f57c6bmr24704790637.14.1735070751644; Tue, 24 Dec 2024 12:05:51 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 31/72] tcg/optimize: Use fold_masks_zs in fold_or Date: Tue, 24 Dec 2024 12:04:40 -0800 Message-ID: <20241224200521.310066-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4ede218bfc..e284d79fb1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2078,17 +2078,20 @@ static bool fold_not(OptContext *ctx, TCGOp *op) static bool fold_or(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *t1, *t2; + if (fold_const2_commutative(ctx, op) || fold_xi_to_x(ctx, op, 0) || fold_xx_to_x(ctx, op)) { return true; } - ctx->z_mask = arg_info(op->args[1])->z_mask - | arg_info(op->args[2])->z_mask; - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z_mask = t1->z_mask | t2->z_mask; + s_mask = t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_orc(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853227 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081735wrq; Tue, 24 Dec 2024 12:08:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWN2SJjstWc+LRGQ4LclboWFlx0K00niQrdWBpbjkoal6JUsNq/PNB0/E3kGwbCF29C0ZkaJw==@linaro.org X-Google-Smtp-Source: AGHT+IFUBxki3BXa42amwoMwLtoOCDuSg3lY3CByTzJIz4QbfpV1kQOof6vFQXdw1zLr9wwMCoaH X-Received: by 2002:a05:622a:2c6:b0:467:70ce:75ea with SMTP id d75a77b69052e-46a4a8f9543mr276659871cf.23.1735070891220; Tue, 24 Dec 2024 12:08:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070891; cv=none; d=google.com; s=arc-20240605; b=Vh3jR6SfSXp6eUg5e0DS6uwVx5k60dSIB2ixVJ0yu8OEMjSBZ0Jvi2RG8tUvXJnxGk 5AcC+ZGBa8LmsVcudBgp0y7pWvVp2BniYVoExHNInRBngukXPA6zleQZwXV5YwqbHv7v 4hye1LynZ1bYmOjhS/2VSFhvIyd/vSG7PsyEAKgd+8pAz4x8IzvVtTDdSRmwDD25YC5k lLieMtUhQoow60ZRvXTh4vdCE3h6kOZ8kUi9c5jlCCrRVE+HJJdNIFpUswDNd55OOTZR fJ9tE2DmT3fWzxOMsRxs1lk23nMTeQC9NeFQlF3a3Z/lwB2QLjz6+mCL+bAdnwN3gscE rbmg== 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=9gMoFC5QlvVuVHKNivgLi3juCNFsVMGqn8yIw/qWmEY=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=jwOGWVlEYmgkEP0wOOOLWQykaqVDKaMrUbONc/GAeTEP4gL7lqMigpSg/g6cwJqgsA BP/t8U7bIRaF/cKchG1RKxWPpCpQj9FmzDLV0cgozKBP+Dc1ka2YiCVT2UTyrrGZOM2s bcx+rDE4GBgeGDUrn6ExBeYucvHX8C7WFumsBfpy8GMggxGGlcXgcjxbi+fYwRQfae26 oad2I4mQ1whgTuni9/HYOSqWQhx6suy4Em9q7q9p4V9PWmatcGLfhkwZRdRRtmd7n8MA YZ1lGCOyNh+2Z3GwQS61rjEOLJG2Nv7ZKVRS16v4MSjz2Pk/9uz39FelYPDMgUAI6iPD TseQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u+nEM5zQ; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb9a06fsi156140911cf.321.2024.12.24.12.08.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:11 -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=u+nEM5zQ; 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 ) id 1tQBAb-0003YZ-Kx; Tue, 24 Dec 2024 15:06:21 -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 ) id 1tQBAB-0002u2-KW for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:56 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAA-0002ck-00 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:55 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-21680814d42so52214545ad.2 for ; Tue, 24 Dec 2024 12:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070752; x=1735675552; 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=9gMoFC5QlvVuVHKNivgLi3juCNFsVMGqn8yIw/qWmEY=; b=u+nEM5zQyp0opjAYM8ZpROoLeYAc/0Z3y1x7BItmYEeBW/dpOBd2jmjz2p5GfdVF30 7dkSFLMmFOndD6qzhOfvmiSddHd8Pt6umoQEPLj2LyI/wIUb0+dZbbQ+Q5AlsVVBiioL otTyToerjQcgB3ZmjBikYtJ23hNMDEp+3ybwTPS3lqKEUn5itXfQGwOp3g0zrowhkWwm dV+9pQ549U0qRZUTE7Yl/lZHXozxmIFTo0t1K8IjL3++ehqpRBoef66PI/MappFkAisI p9hGMIkaBtTvaoE66u4+2MqP/6qvuNkmQTWAMcOfSF1hyZRessa3redlVwDvtcbj0PJD XTKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070752; x=1735675552; 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=9gMoFC5QlvVuVHKNivgLi3juCNFsVMGqn8yIw/qWmEY=; b=xU75hziDRj8LjCpjCZkM/V1bO0Xe+lHCklqffIi+LEAaC+0iFOvSCbbF281yV8KbQg 0N1SfCvwXmUK/KtOxqpDFvJTF5C7r4O85W5V7wfUBuvuVy1RTWsVpvoev82VrlkU6uNM Dxu5LD8fNjVPjhbSqw9A06KwZEUE804EdIK37bEHHgfsOGbDb3sfArNbQLVce5iz7kpT KA02B1AU4WV0i6LbmqGGWKgIi+q4JZ926IgL/7bv4gRavWS77eJMw4JBFhgmUNnOwuJ1 +OqcVOYynDZi+zC3F9zNdVbV41lO9jzcQk/dlMst1dla4YbiSfKTBrscNXEQmn8KO6YQ 705A== X-Gm-Message-State: AOJu0YxpyJrKdC9NkSq+TfEIUKEp34yRpmshq34Imhm7Dz4usURf8h/0 Hefn+DH2wc/4dnAvPwlu2ncWNPN0ZadaspBBV8fmhD4eHstpc+Z4IC1MfIBNfVeNTRdQXLkUjh1 HV10= X-Gm-Gg: ASbGncukLmX8SjEzpMejrRPWC8R9zvVxMkPZ1bv755HzXPGepjJb0oAvq4dgv97AAWJ SP7DYykia/TYkYixSBcM0NzvB1hmLQzYrzhFaTHLHCCxW9O7DQURoW2+1ntLvT2DVZFZzgdSpXZ tpIbmU9SHgEi7QfkY128WX+tL6UsCasVKaRxWF3cB+WtHT7XoX1pLSqhG8l1jjMTrGG5RZFZFoC WWboYjJ1J7zauWXINrLVOhiUkaRBZYMfzkbjCy5Pp+R5PPIlws8faPlPE8ASPZwptDNIZMl2z/C TtuOyPRuNT6EjS0ZpiAWjslS6w== X-Received: by 2002:a05:6a00:ac2:b0:72a:ae66:3050 with SMTP id d2e1a72fcca58-72abde40466mr23461730b3a.1.1735070752542; Tue, 24 Dec 2024 12:05:52 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 32/72] tcg/optimize: Use fold_masks_zs in fold_orc Date: Tue, 24 Dec 2024 12:04:41 -0800 Message-ID: <20241224200521.310066-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index e284d79fb1..81ed26a376 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2096,6 +2096,8 @@ static bool fold_or(OptContext *ctx, TCGOp *op) static bool fold_orc(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2(ctx, op) || fold_xx_to_i(ctx, op, -1) || fold_xi_to_x(ctx, op, -1) || @@ -2103,9 +2105,9 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return true; } - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853219 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081592wrq; Tue, 24 Dec 2024 12:07:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX9roKCeqfx3GT52DtILYN4sP28Le2yPxSUCwwxu4eTTR1uviiUPTAZ8FVOPcMjtMy8/2Oknw==@linaro.org X-Google-Smtp-Source: AGHT+IESyuiv2Ax3E0jAq6n3po+2mL9y5dvzfGnPQQDPvm7aAYDOW6fYa3ybtuBmi4eKLH1vf+sv X-Received: by 2002:a05:620a:3914:b0:7b6:6701:7a4d with SMTP id af79cd13be357-7b9ba8349d6mr2602510985a.56.1735070863710; Tue, 24 Dec 2024 12:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070863; cv=none; d=google.com; s=arc-20240605; b=i5EnxO0XTcoSUnZnNe2LUHhOMMtAndz/Cin0k4rQ7svk5teTid55HkXTgjEdyqzbMs oAwAm7rzLuFwYk71Wd3ufJW+iOVjYl41Yvzpi7Y5tdCVc4BKEGKOjNWn9Oir7nA42a8Y 5b9DL8iWBirr0LQSp+rc1OQhaTZ2p1rH5FGddN7zSXTxtlWrkDeZZThueQiiyPgGiUcv LBsx6XSxaT/WCaP0pvhrhnCsPskT0KpW+o3hSiDgxNiQ0PvcIV24bAKLakK9eDMFI3pg lQrEVXYekvoT9wFkO+i1iireb6dK+0Ek0SBofYGRQyvDBIslgj/j3bmZD93dyC9zyVE+ ftKw== 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=8qWTPWB/56xfTTsmE3Xx4A/juxFvaZTioQPwMgdB9OQ=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=cPbo2Rrl6+nT2dPAFuu2dq9gLR9ZkQ6DkkMuknk5CDiTbk6CnkGBJ/ADWQ7CTkuOTt FxB/W4rfVXChhNw8Y4Q7qM25/w+Y8XJkiJbmga87ZyEzzTeykf7Nzt/ygKb135lKa9N8 juFes81aGy+L5oz3JMeL1c6GnJ/VhkdMx+cige2IddFZyLDHPyGCR9nwHEtzLbMbzELU QjmpFyhcJwc5bCxn/VdcYXz04n6Rmbt9pcq9TnCs2FiJju5BjKunFTjiyVXgslhk7GGc doTzcUFyfuD4uMGndPvet3PvC19ZaFy2nnO8Ke48aXnjuMA5Npae5eEnPgbrsoq9ZEIb ZQ9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ietb1wX8; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4ce1easi1423452485a.428.2024.12.24.12.07.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07:43 -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=Ietb1wX8; 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 ) id 1tQBB2-0004kO-Ou; Tue, 24 Dec 2024 15:06:49 -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 ) id 1tQBAC-0002uo-UE for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:57 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAB-0002cu-Bu for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:56 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-215770613dbso41197775ad.2 for ; Tue, 24 Dec 2024 12:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070753; x=1735675553; 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=8qWTPWB/56xfTTsmE3Xx4A/juxFvaZTioQPwMgdB9OQ=; b=Ietb1wX8M8okc9D4fxzI64eMDaEgBb2ZkFENW/o8wSE+iix8ijO3YqhAB6xe83gPGN hj+PL8V8y0rxk86/1Sd9vFGKzqj6yms0j3mi7SYyzb4Yq7tg1rnLyJGeFL5F/TT7RDBC gIdynvtCa1h0w34yeHVPUjXYw71yZcHmvdmyoaYWuX4yo15NIkaMAxorPjyXlPnZWZxp WarYdPKGDMTEDYJVK2WuJoM3lriVR15R4nYeEKu9eULOoAwHKu5i8SuIgQA75skkuTlV W2TtHwYrPJ2Og2TLOd02/cYXfJUMWwBxMQinI9ltUliMnMKjrQGJKQUP9Vdm/nCT9/M0 4fTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070753; x=1735675553; 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=8qWTPWB/56xfTTsmE3Xx4A/juxFvaZTioQPwMgdB9OQ=; b=Tr3YzTRGggNBWt2teifUYkfSjGPZVhs1Jbvg+i+AtBNmhPSLq7oJcIs0W2JUAAyAO+ 8WXMEpH6Z+vJj3U7D3viRO/eLueEUEjrflvugJF9AT+nWilRrUhXZfU2jqXL0PI0XcDc aJRql7G9BRahNKQEpekYLtHZCA7RjvF2OXykkkx+WOn33zlLm8HcShWXiBWAGbnKTecN oyn45NUtqyHqCTJ8o9P0Rt6aDgY/ILZrlrjMqrBpkwz1ISmahCTqOKrt0UcAhBHBMetz Oung5pdmszFZibgnQC9cTrgXbGh29diXYYOWx/bGl4+Tmb0jU6IIS7yO2aja7EwWGc3J k4tw== X-Gm-Message-State: AOJu0Yym5dwBgkYL5ep3IZCJOPaN4V+wpGfKEWQzJ0eVq5GFlrje9PIM msMRrZ3Ig8FSQlYz+Kb5H32uQK3XJ0A7btotDbPkOD+hTkCAM15HmbDW1/+pAbeug+E6kPaSsvf MRD4= X-Gm-Gg: ASbGncsif1J9Pb4AGTRdR7UtwOU/qS4gNGCPNrj6ckhLziq18qMgXT2LX0WOlICsGLw 1KxvoYe5enFadg+d4kMpijtuvkyAyNmAiw6ujaYJxFpWKsWjRb0MsofA1yhWCizl+8lvRYQ6TS9 tPkgasj2Em3gckelWdFMPirZoCO8fieV8sNCUCCBY1rCeNMmjx6Q1i03uFGEZfMMrvTpIkJx244 nFH9GmRHTQz9DUrL+ectYUnOa4YcJnCDEpeFOWCKT04vNz/b4enutGrYApDiRXzg2cVzSpTt7S1 Cbsa5juTd9zU7sURSESjydCWHA== X-Received: by 2002:a05:6a20:c705:b0:1e1:afa9:d38a with SMTP id adf61e73a8af0-1e5e0447f45mr27489075637.1.1735070753476; Tue, 24 Dec 2024 12:05:53 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 33/72] tcg/optimize: Use fold_masks_zs in fold_qemu_ld Date: Tue, 24 Dec 2024 12:04:42 -0800 Message-ID: <20241224200521.310066-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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 Avoid the use of the OptContext slots. Be careful not to call fold_masks_zs when the memory operation is wide enough to require multiple outputs, so split into two functions: fold_qemu_ld_1reg and fold_qemu_ld_2reg. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 81ed26a376..7bd17a36c7 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2110,24 +2110,33 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return fold_masks_s(ctx, op, s_mask); } -static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) +static bool fold_qemu_ld_1reg(OptContext *ctx, TCGOp *op) { const TCGOpDef *def = &tcg_op_defs[op->opc]; MemOpIdx oi = op->args[def->nb_oargs + def->nb_iargs]; MemOp mop = get_memop(oi); int width = 8 * memop_size(mop); + uint64_t z_mask = -1, s_mask = 0; if (width < 64) { if (mop & MO_SIGN) { - ctx->s_mask = MAKE_64BIT_MASK(width, 64 - width); + s_mask = MAKE_64BIT_MASK(width - 1, 64 - (width - 1)); } else { - ctx->z_mask = MAKE_64BIT_MASK(0, width); + z_mask = MAKE_64BIT_MASK(0, width); } } /* Opcodes that touch guest memory stop the mb optimization. */ ctx->prev_mb = NULL; - return false; + + return fold_masks_zs(ctx, op, z_mask, s_mask); +} + +static bool fold_qemu_ld_2reg(OptContext *ctx, TCGOp *op) +{ + /* Opcodes that touch guest memory stop the mb optimization. */ + ctx->prev_mb = NULL; + return finish_folding(ctx, op); } static bool fold_qemu_st(OptContext *ctx, TCGOp *op) @@ -3012,11 +3021,18 @@ void tcg_optimize(TCGContext *s) break; case INDEX_op_qemu_ld_a32_i32: case INDEX_op_qemu_ld_a64_i32: + done = fold_qemu_ld_1reg(&ctx, op); + break; case INDEX_op_qemu_ld_a32_i64: case INDEX_op_qemu_ld_a64_i64: + if (TCG_TARGET_REG_BITS == 64) { + done = fold_qemu_ld_1reg(&ctx, op); + break; + } + QEMU_FALLTHROUGH; case INDEX_op_qemu_ld_a32_i128: case INDEX_op_qemu_ld_a64_i128: - done = fold_qemu_ld(&ctx, op); + done = fold_qemu_ld_2reg(&ctx, op); break; case INDEX_op_qemu_st8_a32_i32: case INDEX_op_qemu_st8_a64_i32: From patchwork Tue Dec 24 20:04:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853239 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082258wrq; Tue, 24 Dec 2024 12:09:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVtQrYvNZOeHMMJKZiW6WpvJqHlRnhd9FA58+PD4odR3cqU4E7ZJTvHlH5rWHWLyD9eb1MnbA==@linaro.org X-Google-Smtp-Source: AGHT+IF48Zc0XFPKdQEDw/kvTeGdoCt8sUwtk2YpOVGGhoi5jnyNjofiwnZPnu5wpXUlnhuywrXV X-Received: by 2002:a05:620a:1a91:b0:7b1:ae6c:fc60 with SMTP id af79cd13be357-7b9ba6fda61mr2381155885a.8.1735070983624; Tue, 24 Dec 2024 12:09:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070983; cv=none; d=google.com; s=arc-20240605; b=cBfpWVFoMyvvY4pX0vWXYDq7cZwGvvqUdvL+2wQyD9hyDmN1gAWHrrG6Rm0SnoIgfx HBGkvu02SAt3nbuof2yngViiYHxFJGDJDUjgGD3sT0/uWGaqeHC9ClqyKQPC8MLZb5O1 aOdG1LPcsaRPxwsUZmWy918HfJQFyHoiylAw8S73pvtqjYrvl/Mze7m0Y3ntsXX0emKd +U8SNurw0WZCyHwo68jvtG5tVMeZu3B88fAt8a4VkcWGd9fx0oIXM/dVZpe5PxIB4dfG QhFaJMDmWUWR1xRCOw5+eORbJVphmG8xr24CFO4oRBBwpBL8BaeUw0fd1RXGObuiBO35 pjmg== 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=/BIzmSJg2IBNvRjDTAJOD5BUlfsyyTZSbfZK35bezBU=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=ir3oVYC6kJ6OsPdTO9qohaLUshwviPehTpKR6B0aFMkZtD3+f98F3OqHU8NdCU5GpC TMgK6iJY/uVo7wHU5CvZtYdzl5sa205tQ1MnFZP4coobCX2yTXXW5ugZ/6rRM+hnUYWO SDpl5ALdeA3CUKIdbDpI72guG2TStB440N6TRqHcGLNJOzZrLk0P29JO4XEB7GIzQB17 MAMa3T76Y2Vzf5ezY52m+ZH04qg/7hhPl4UMOvlWnJ88SZ6ssKOl79XBHnqHcZGQYJIZ 2vxoHh4SIDDSnytc3dvDqhtykcsiVz6LAIkUZi3YApYZ3wp3DTSNimLE1LVddqWLMhE4 1nFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e9O7fo3m; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac55776asi1493305985a.687.2024.12.24.12.09.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:43 -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=e9O7fo3m; 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 ) id 1tQBAy-0004GW-DE; Tue, 24 Dec 2024 15:06:44 -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 ) id 1tQBAD-0002up-4m for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:58 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAB-0002d6-KQ for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:56 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21683192bf9so61844195ad.3 for ; Tue, 24 Dec 2024 12:05:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070754; x=1735675554; 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=/BIzmSJg2IBNvRjDTAJOD5BUlfsyyTZSbfZK35bezBU=; b=e9O7fo3m2xxQZD+MrWBnhPaYYVk39jM8kNseTGCP2PwzAIGJxHz6wzZCBlwZ2pknvH ftr8dAVn0GL/BxsbXJJPagP6xu9MPYRKpGgM0fZY3al0hy4r9buDBykwWNdTgG583gW7 VFvGfkYXgTI6CEsWoHHn+H7j25Gni/PLg72sOFBMLZeEHNc9xH3TpKJK5UQukGYCuvZY efSC5KgcEZ5JWbFnn1VTwpadJ+cUVIgG0YFzafUttIedmNkn9xz0/G8peH54AqgSBWz3 4nsVOSHmQHH5/hZLT/o/Cmbv0HuyWpVNkJ1g71OrZE/jiA26egFOvyLrG3bFqXwInje3 lFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070754; x=1735675554; 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=/BIzmSJg2IBNvRjDTAJOD5BUlfsyyTZSbfZK35bezBU=; b=jE3+F7T7IfIrLoemcrBTBuosM18mJtTPIgWI2KKGWCknws9Y5n3zdl+YC40kYgkD3Q r17DJHGrBmEHYO7P83QsBLGyNrQM+TIJpa+VOO9XnBaMAc01EBPoQm+chWRz0RAQKaCm IRTIs6ON4UJBJ2Bl0IkwnarbdpCiCEcw03wLp3fObD98TnYNtoqZoqhIOVETMNG+HBLI RGcEzjfaGtSkB+Qa9dyzqNrOJHAzAYE8bvBTa6jIdFBquqiXVfkJkaxOo+FEhgVRYWBu 4H6EIgkGnLOy1jOAloZXOjkAKkzUSV8H2Gn82GRk7NgCeIOPi2zUr87dUBlRcZPrMT7E 1Cpg== X-Gm-Message-State: AOJu0Yz2jek1ZIK6Yabuz3QBwQmJdlG9r9hT1fvklhO8laGZjY8O2b79 k0W/UlKdwbO5+EnC0d9X798gH9i7JACZt3PtGusTk13ZA8qF7ohWbQxMtv0SWCOutDyXtuDylIr 4H84= X-Gm-Gg: ASbGncumC008be/FFVDPpKvb6jZlq7adldF3fHLgHj32b2EsPhgRQmFHSdsT0P6+25c B8Ga5ty7Z5nK3NzrjZft8mcWHB+SlUJdKbWd0fDGpk2TzOT/OoClFUMDwsZWDPmMdCaJfN4KfN0 ZcivGcpv/TcbKGsTH2W5UgsTHIQjkKVKeVd5EXsAYiKvw91DWrQUDAZObkqZkSe1GOgCfGho4Y3 wdwCr0PF6BxMtc84HgdESbhD44ldc3cW4+3XtVanWjk0Rh9LY+OKFsdLti2wSLGrBckNyv9ZnRa L4EtWKPV7X89o8lbzgUjLfdviw== X-Received: by 2002:a05:6a21:3987:b0:1e1:ccfb:240 with SMTP id adf61e73a8af0-1e5e081d78cmr29133019637.41.1735070754356; Tue, 24 Dec 2024 12:05:54 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 34/72] tcg/optimize: Return true from fold_qemu_st, fold_tcg_st Date: Tue, 24 Dec 2024 12:04:43 -0800 Message-ID: <20241224200521.310066-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 Stores have no output operands, and so need no further work. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7bd17a36c7..07792c5351 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2143,7 +2143,7 @@ static bool fold_qemu_st(OptContext *ctx, TCGOp *op) { /* Opcodes that touch guest memory stop the mb optimization. */ ctx->prev_mb = NULL; - return false; + return true; } static bool fold_remainder(OptContext *ctx, TCGOp *op) @@ -2706,7 +2706,7 @@ static bool fold_tcg_st(OptContext *ctx, TCGOp *op) if (op->args[1] != tcgv_ptr_arg(tcg_env)) { remove_mem_copy_all(ctx); - return false; + return true; } switch (op->opc) { @@ -2730,7 +2730,7 @@ static bool fold_tcg_st(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } remove_mem_copy_in(ctx, ofs, ofs + lm1); - return false; + return true; } static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) @@ -2740,8 +2740,7 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) TCGType type; if (op->args[1] != tcgv_ptr_arg(tcg_env)) { - fold_tcg_st(ctx, op); - return false; + return fold_tcg_st(ctx, op); } src = arg_temp(op->args[0]); @@ -2763,7 +2762,7 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) last = ofs + tcg_type_size(type) - 1; remove_mem_copy_in(ctx, ofs, last); record_mem_copy(ctx, type, src, ofs, last); - return false; + return true; } static bool fold_xor(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853244 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082352wrq; Tue, 24 Dec 2024 12:10:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXhs0zyyzoaDYhOpc5L8LfUIxG0kqn5dQI3LdWZmxj5FNngSKA3M064KFlS3sQ43jgdVr18SA==@linaro.org X-Google-Smtp-Source: AGHT+IFthgi8EqSaoC1OerVwe6ettjh1ONvtQxYN8LI3BLyGOdRHB4scfOsyohszF/e2JV6dKgiP X-Received: by 2002:a05:620a:2444:b0:7b6:eab3:cdce with SMTP id af79cd13be357-7b9ba7e60fbmr2519433185a.40.1735071002024; Tue, 24 Dec 2024 12:10:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071002; cv=none; d=google.com; s=arc-20240605; b=eDo/ZQwaenormsIPKCmPr2qw+9iVp4IOkglAdJphgCiTYJPhpYyrlsTxSVQDJp2Yzg Ue4LhfXInWyO73W/gxzvRCHvZXxvNhbPfTHM1pt+4RctiSnVEes8NtPNqttr9uHIH/+i izSH/5+GT2ToPUxyp78mA8Ch+FYLBbxhjcMSInK5vedzeBiEFMoSIq9A8NCPl9ZaPuG9 i1OlVWQcwIDMZ0tJh6Gi94G3jDxThm4INg4+nVBz0ETbhuIj2JIRlWZixl2aZ7m+vRTH wXtWV5BY0aIMANvuYjt5zcLKdgoojVPuPFkfseFaHBhHCBfM8PTKLK2L+fjVSkuq/+U5 wqQA== 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=JbV7ezqIGFwEAzD5BKNZbxFvhvTByi12RrhcY98hJws=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=M/a+0CG6ZBXf3ByKniXw7wn/q0mg1ZhFUHVEGy4eTH3nRgATf00fhSDBvJzKl2kSQ8 KBDZGw78HoQE/kuI6qXeZvxmSZHqEyNzoYZWDsEWR4YYUCHaoE6orK+umpJpXSvjFgna vggtxKRfj9rK7xxoRmDMNm7DS8IlOKlLFtpkXjljl9+J+lKqXyG1/cXL/nvh00GZFpdq zU4pOAxEQCq0MhdY+HqL8r/R3TvAFhkwGrWLGOUUpmtQcbRtYioKcXOmPro5Eif/QI4P U9ZzyexP7XytpZHzmAqvTBKG2AWF+BFA6kjScP0j19Wnv8WiApB3VrEGrSDO8Wficpvm CVfg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xXLKM4kF; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebd835csi134275361cf.595.2024.12.24.12.10.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:02 -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=xXLKM4kF; 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 ) id 1tQBAx-00049j-G2; Tue, 24 Dec 2024 15:06:43 -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 ) id 1tQBAE-0002y4-5h for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:59 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAC-0002dP-Lb for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:57 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21680814d42so52215035ad.2 for ; Tue, 24 Dec 2024 12:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070755; x=1735675555; 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=JbV7ezqIGFwEAzD5BKNZbxFvhvTByi12RrhcY98hJws=; b=xXLKM4kFYrGX7RiViWCzc9XzH6BfI9I5Ylrn6AicxTBNZaCcSGkYP46lQcDrtG32Yz DH2cUbQPkgXNLSra6hk3feMcx+usx3WHolQvpKOIacr6sPLNTOZt35CsjcbbLcgRxbwP 4leseye2NBacgwfOKzje5DSwwDU8Rghh+uxR+KB2ls6jeJYWwvkZh1tg9yTmEZyMOtLW BB1BSUozwzEy/9ecgixvXiMv+X/mVN4IUT+83ecwu1kWW1MPIx5RNF0uDIz9CnTGyVe5 3okr02jBf0OlKsmVvz3kk7Bpnz57+p2/PlvEXIEYZ+takVJfLzWZB+Tq5vuzxnRGAbVq Ifgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070755; x=1735675555; 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=JbV7ezqIGFwEAzD5BKNZbxFvhvTByi12RrhcY98hJws=; b=IHS6eSk/IxSYs0vImqaNGDzy/TCvLvHIL7OiWdMAlHt9A0A3/3MUsSYuwvWDHWDU5T An9tdViURx/KuvhyIoRLtJ4QLqjykCXeVA2RV4MttZMHTZ6hVghrbt3mz3IF+JFoIow6 w8lagvSaS4EX1676P8E6wIC622QzvpF3+YXs403A9KCMkNKz30KXGz9M2NzsMuuDVhaC /ReQxCl6z9G8U7YQPrDgOQW3S8izDz5MSHR9JgTXZm76MAjYbWCDq8GnDnRkY0U1TBuJ zpDubeXDv3zsGRGA98c50lxi74Dl6L5Ljc0NRUTYvvZtUlnB9cMGv+egF++MMMG5/win WbHw== X-Gm-Message-State: AOJu0YzNInejlDakDVC0L2j1s8Pp5zXqs+TncWVlEtLRGp4ReBcNqABi QQEuoZ/2zU9dLhmzA/tL/G1FODVHw89vNNcuTVjhBgmyraZJCpipDEtRiDN3fIvbHXx59RcaC/z MY0o= X-Gm-Gg: ASbGncvG4BT8g/1GLv0ov3r6bDQvSTR2J/Pw/dgD/Rhf4kJbW3AQEx8qCcr6syBQYBB D6n3DelXK5g3lKqO+po44PFrb0d6d98xHaEcfB1vJruNeSSgd5sIE81krZyskbLCbAbxviwatxX 6evy/cSKzzcuu26rWG1h4uUZCe4sXcyxoQu+8uGCZTwkWZxMnLWIAf5Yx897t1mzLNwmuvoRem9 DyphBANeX/jhWhAl0YcjGPE2fGV/lKTIvaQ1V+Nv/0zRuG80eqk3BsrkWAg7XCc7l5KoVVNF5ob R13vWhbDdX+dcsq66/KhXDafDA== X-Received: by 2002:a05:6a20:1588:b0:1e1:e2d9:307 with SMTP id adf61e73a8af0-1e5e0802532mr22399254637.33.1735070755101; Tue, 24 Dec 2024 12:05:55 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 35/72] tcg/optimize: Use finish_folding in fold_remainder Date: Tue, 24 Dec 2024 12:04:44 -0800 Message-ID: <20241224200521.310066-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-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.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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 07792c5351..e78f5a79a3 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2152,7 +2152,7 @@ static bool fold_remainder(OptContext *ctx, TCGOp *op) fold_xx_to_i(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) From patchwork Tue Dec 24 20:04:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853236 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082118wrq; Tue, 24 Dec 2024 12:09:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUUNbVh5hncnNgRLjHSM/D+SDAzqqRiTWCmOlMobiKsLyOE6/4A+LZJlcCQPO3VHPHBmPBFcQ==@linaro.org X-Google-Smtp-Source: AGHT+IG5wOH16Gj0zr42ILrI1JjmLtSBbgOydXmsvdq+cEU9vF4ztdfGNSUqr+5vzSJz+gL7QIIz X-Received: by 2002:a05:6214:5298:b0:6d8:8a60:ef24 with SMTP id 6a1803df08f44-6dd2331e572mr284185456d6.9.1735070961716; Tue, 24 Dec 2024 12:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070961; cv=none; d=google.com; s=arc-20240605; b=XewGCjpyk1pOAhvvPuP1qNmd0aMeR1sDjb9rcLYv0c3tgPqnMXHpT5SqmEQZpYvq+2 TJ2wQh0AV5vlPFt5/PGvrIXJof0YtxlMOjfxA7i5c12wbcAJUJjcQBK+4eEzGHke1xWI 5kBg0gWtwanWc4kWR8/Nl/OBjs4ZpJ3M1yecstCNdRpJ4woga9AwgQU0suCO2gssR9d8 m/1fEX65fNMpdL8GGDG11t9Fo11+yUwagrYMciDFVWLDM3QAJo7m18LH9ngI3NbZ/6Hl wPRc4/csr5WqH5vGUAT0xevT0LAC1bRpyxlIfcQMcAW/yaC3LLTCiMX3DQnFEH4g+lY/ qMpw== 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=KTUO0uF94ggO8DLruNGc154B1KXBI7ow/g7ffKKGvr4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Wv61sWtji/RB8WDwFLa+aYZX7P0BgozTJIPR4rsTwof6ErxX/b0hQvXMDx9HYdGcUP WyWt3WIkHMNS3hph2ivpw/y5A6ah8IDoxFHu22yE8XZdA+bVxmFKf4wVqrBgUcJr35EC NWVP4drqHRuHtr7qTH3XwuTBvn8jgVpMF11eZyX2thrwCmGddeKrHSvezAG6IRky7L6B xSbbCrShpfKMBPo58wtWNYW7O1Lz479hBqocDoORk8p/4bsJV3fFbRcfObPj1Pr60NPB oqn8jlQhdqoQVmk7wZdiEgR9M4uBdffrvi9+VnYu/BoIaXBvE+4q36u+fmYKYKDUoIoz LVNw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aeDKKiBs; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd18233555si150177466d6.238.2024.12.24.12.09.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:21 -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=aeDKKiBs; 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 ) id 1tQBAz-0004Iw-5U; Tue, 24 Dec 2024 15:06:45 -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 ) id 1tQBAE-0002yL-RV for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:59 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAD-0002e6-8r for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:58 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21634338cfdso79720935ad.2 for ; Tue, 24 Dec 2024 12:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070756; x=1735675556; 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=KTUO0uF94ggO8DLruNGc154B1KXBI7ow/g7ffKKGvr4=; b=aeDKKiBsClZ3Hfde1gVNPsU5MzqNr+Sbe29iQUDirxarUNVY7EEbpnjgRGu/g9Mdj6 Qu3AMohNY6S7piJ5j4jsLCH1vnpoQfCySit6B+dbVXlhSko8pAHLwVfHpaJGCjRTkoGM EN/Xyd41y6uCf5MW1hmRX97kHUXx74RfqsqPLQyUph8cLQa2aEdYQxfV+9kiFqXLTbdn JbEgyuPSOxHbh40kKK8is8eXilYNPp7XUPpkBxN2ol7h5B/jf70VXqAP/Vi9vq2tf0J1 65dwl9YDV2BGr1L3JUuicH5mLq3eX2YLH/SAojMMxfaQn+mBbTPLaYLnTDXXneXhWEbO 38gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070756; x=1735675556; 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=KTUO0uF94ggO8DLruNGc154B1KXBI7ow/g7ffKKGvr4=; b=UbV9Vbee4u1zvsnyFLallbkmV1gKKIpeJk7oUUu9j05NKnHFmHBEejucG+LLq7SBhQ J939gWCda/mWevpRbl5eA+AmU/Zuk7zNKR2G68bojUPxSe2Xnrt5ciCOfjCKT/PeAmrR 0JS5Tynnvy8QzkerhNSFd5fiRJ9nTB27e6yCXvhdxVZhy/Qh1Yw4XIBXFa7h4P0vk88k 15cZ58E01L6eNOyka1fvNBYd3tFhRsZXO3ZIe4VJoOX391SvhMT7Ae6uWyFw/r91U+bQ ZEXO+DG21L7r/u4hd+b+Fk/9XUf6R7A3lj7WOdE0mhXm49as5dktMgD5HQUs68jF3CVr LUYw== X-Gm-Message-State: AOJu0YwQ7bF4iBJBGMiplS0tmBxP2S3ugqF+sK2+fMNhDDZTc0RSeo/M 3TkMA6uysmXmlRXRVPXnr2Wyp5Paf1S27z+fmxDo1ZGRUDpVUOsl4YmsIrNT2cE/6SShbP7HvPg pShA= X-Gm-Gg: ASbGncsgt8JHsAS6xa9lLro8Zmr8cqSN0fAInlTQQtpVmBXCjTZl1+L1seGN6H64lX1 lCiz88KSbm1Lk66lJHLkabEpu9q41i/oTkO+JrFNjiPMj3SSDpLZeyva2L7mmsNszVN6U1Fl3kF 8itnHnjmiq2dSDn7yYyy/JkBch6E5zSmyHDPMwlV78RxeDLHRz6h9PnqgSpvO+pEBC+xUR+npCh k29o5tD710C+8rUboj3YpLGk5U/FihUdJcx9ZHNX8i8F5KplWgH0TqKGlbKEi9z68AlwXBjIj0U bWnA/8ABsRtNhbtfNnx0BK0o1g== X-Received: by 2002:a05:6a20:c907:b0:1e0:e07f:2f01 with SMTP id adf61e73a8af0-1e5df939d84mr25801344637.0.1735070756035; Tue, 24 Dec 2024 12:05:56 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 36/72] tcg/optimize: Distinguish simplification in fold_setcond_zmask Date: Tue, 24 Dec 2024 12:04:45 -0800 Message-ID: <20241224200521.310066-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 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 Change return from bool to int; distinguish between complete folding, simplification, and no change. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index e78f5a79a3..678015a94a 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2155,7 +2155,8 @@ static bool fold_remainder(OptContext *ctx, TCGOp *op) return finish_folding(ctx, op); } -static bool fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) +/* Return 1 if finished, -1 if simplified, 0 if unchanged. */ +static int fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) { uint64_t a_zmask, b_val; TCGCond cond; @@ -2250,11 +2251,10 @@ static bool fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) op->opc = xor_opc; op->args[2] = arg_new_constant(ctx, 1); } - return false; + return -1; } } - - return false; + return 0; } static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) @@ -2359,10 +2359,13 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], i); } - if (fold_setcond_zmask(ctx, op, false)) { + i = fold_setcond_zmask(ctx, op, false); + if (i > 0) { return true; } - fold_setcond_tst_pow2(ctx, op, false); + if (i == 0) { + fold_setcond_tst_pow2(ctx, op, false); + } ctx->z_mask = 1; return false; @@ -2376,10 +2379,13 @@ static bool fold_negsetcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], -i); } - if (fold_setcond_zmask(ctx, op, true)) { + i = fold_setcond_zmask(ctx, op, true); + if (i > 0) { return true; } - fold_setcond_tst_pow2(ctx, op, true); + if (i == 0) { + fold_setcond_tst_pow2(ctx, op, true); + } /* Value is {0,-1} so all bits are repetitions of the sign. */ ctx->s_mask = -1; From patchwork Tue Dec 24 20:04:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853249 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082527wrq; Tue, 24 Dec 2024 12:10:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHTiWFVr8UWVFqVZ0290vyAu2IBGE4yoJMzzGKgBre7jtN9Qlvwt+oWAh4UgjkBR8NHqjyVA==@linaro.org X-Google-Smtp-Source: AGHT+IFJ3Y5lXp1QxOGQhlw2ckEQPjup6gVr9fFr4iZJDKDfaWRNo3CsHHFedleI5RwSn8U0bhgF X-Received: by 2002:a05:622a:2cc:b0:467:864b:dd79 with SMTP id d75a77b69052e-46a4a9a2aabmr309531671cf.49.1735071037025; Tue, 24 Dec 2024 12:10:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071037; cv=none; d=google.com; s=arc-20240605; b=Tn1mnYvQ4Hb8ZNLvU+YwhYMjalrRfExJTdnY40scqWbdpxa4ke8lymNzMsHfgpPb8W eU4CfKmpSPVQ57+VeWjYa1WnBLm11YH4sfHIq35qjSAhRljHgH9nMDULZg2U6Q2Y9lTh m9BZsavXzT1o7HZKXvvpUp/EncVrdhJwSM/Br6fZdoIhlDNYrW1suwwouThsXkUpgy/P D9ok85uWFIl0LePC9vPgWG+Pu5PgdKvpQi2f26CaExKv5Ydob3zCp/rFHyf4IqO80jH9 DSXltkIbQIGwsLCY0Tgbry/6YghjGix0M+ao5td/TSe6rPBUVjMpKqFv749Jz7P6GEAs Ez8Q== 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=8h+Y/eSzKzpzMdEwoTVhqBqG5Af8LUZfpY4qbcHSiqE=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=i5Y81Lodh0madA9nVQI4aajzEcaAttDrcA4JaT2NdyO4JhnGDRTbBEaVvO/HziCejf pRMzqcsKdDTzgA9ICTKLA49L4B+fYITo66cRoKdP+IZ2yVd5r2WBHKc3ZOPhzX9w4YRZ xMw576xsFDArH8HAa3P4eO+/8oiBDO9QbZn1jzVZf44Knnd/eJy5Esy6JbU0JC+8DGzk wQ6oKKdY8pR2R67X3q1SuEWCpd24Lk6C+bHo5qpzUnNogoGELHHDLAuQg4wmIGThxCv5 U473/y/wohrGXvba+9EaeB2kh3A+tT6EgW9bhsuq285iAPOwDgQeb2rpYrjXpQ8Tk/K2 f3sQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vCfSIZC6; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb9a641si156272711cf.316.2024.12.24.12.10.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:37 -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=vCfSIZC6; 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 ) id 1tQBAy-0004E6-5N; Tue, 24 Dec 2024 15:06:44 -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 ) id 1tQBAF-00030W-Vh for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:06:00 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAE-0002eN-6D for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:59 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2163bd70069so55721945ad.0 for ; Tue, 24 Dec 2024 12:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070757; x=1735675557; 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=8h+Y/eSzKzpzMdEwoTVhqBqG5Af8LUZfpY4qbcHSiqE=; b=vCfSIZC6J9NwykaRVy+M8ysarYmX6Zyf1VpYCvABTbrg55FyCNHiHO4WYVFHhZUY27 caZPspqae65GbcmJigVlqDtOg0mGhrVcwofLY0P2DMnbCYY2LJpZAYIY3buGfo3wDUAB 4qjJioIMcZAO62qo4UG4LaXkjj0pSDuhiVdGRAjkrqBx6r+c43NxDZCqrebfUOYOUbdB VY7W4VeWgMkvCTs8qC4oB1ZA6zD8Z7hTGIEJjHuOHkPpnaLQIIg06U3cTYFoIcg9ipJb R/lOUY7eYG8aUiXicBt++OXddAQ74g3GsIOM7Tt95wSgMYLjV5/nGWv9Gx2ZhJHGeU5f /mqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070757; x=1735675557; 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=8h+Y/eSzKzpzMdEwoTVhqBqG5Af8LUZfpY4qbcHSiqE=; b=HIwQz/jxnK11Rep7l9qg2DFJ2VZoUizVs8gffuJ8OjF16Lb4vRDESAzuMrEYPkXYrM OyIbBgcd1zdPM+MyX9mg2oWTBJlti1JiUm7tk0lqMcdBMXZ+idEcuD4CAC7hZoUNI02O XOtphRAz6jKmoS6P6Vl/CVyMUJFpobndnYRvaCk7xekhqaAHA8CbC11kL2C5hE/X9fIh jQQ+4r+jD6NmP42r2xFvmR/jAIqopeJyR3TRzh5DqCNXfgeGmuh7uA/xGBzVJ/WIbNpE qdnoexdEHddtB35Xuakw1j3o/BV19ISTywHT8pvFQssiZRcw7UHF5UyUJQjHCjN5WM86 KBQQ== X-Gm-Message-State: AOJu0YxOlNQXWhj+komtXWLQ6MW9hRepA0cLNQm4pw7ZSoazRH1beT0U btiLq3sadeuem5uaWBqI9xOlK/71JzQtubSDlIJvpRNUNSebOw6FpjRiZA0Mv5gmkn8KP0PPRvc SkGU= X-Gm-Gg: ASbGncuy+XTkVgEkDql5SDDvup6QL2CoI+/21FzBBGjvsy6NBhvc9WhyArLhJwCTIs9 yTVfLbmlKs3HkJcrq7MAbMsSmwJTbsfutz/OtAZjELmb2oiTubxr+/sDEtifyR+vmYZsdXoO5+D u6dl5KEe+Wxqoozzg5V2i5fT6Mabl8tfhY7iPKq9RDP+b6dfYVPAiap95i3BPdKW8pysfGM3Lua toXE7SVzBr/8ztOgvt1fvJkxURJGjA5FAvPECK5TEGmmODiaGwnHRR2tlw+oVHXQ5VzfXRr1+wO UEr5SN/1JeKdVcugcEBBJVdNpw== X-Received: by 2002:a05:6a00:3996:b0:725:9d70:6ace with SMTP id d2e1a72fcca58-72abdd8c362mr24044015b3a.6.1735070756949; Tue, 24 Dec 2024 12:05:56 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 37/72] tcg/optimize: Use fold_masks_z in fold_setcond Date: Tue, 24 Dec 2024 12:04:46 -0800 Message-ID: <20241224200521.310066-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 678015a94a..74be827f51 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2367,8 +2367,7 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) fold_setcond_tst_pow2(ctx, op, false); } - ctx->z_mask = 1; - return false; + return fold_masks_z(ctx, op, 1); } static bool fold_negsetcond(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853233 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082005wrq; Tue, 24 Dec 2024 12:09:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUdJp9QSWafoQarRQOVS4iculG8IE80Er3JHdVxWX2YfliHkTt1fB+PnEkDBt+ooHNZZoDnJw==@linaro.org X-Google-Smtp-Source: AGHT+IFhe3oYVl8r5KbksZnAq9Ti/y45dMso7hr49mb7/md+h22VX37wsyVW6OM4mUopV5Z/8x/J X-Received: by 2002:a05:620a:3710:b0:7b6:c92e:2e74 with SMTP id af79cd13be357-7b9ba75773dmr2899233785a.20.1735070941650; Tue, 24 Dec 2024 12:09:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070941; cv=none; d=google.com; s=arc-20240605; b=cUlBymHqzhthTyWEWAbTv7wXROzHDQGk7coDwnbrAIX6ccfIon5x/D6eRzJbF75vwA /DNQUUtUIT9iBmGqraC0ZBwG0d+gNogz8nk+n69JcuwCmyUshRkdQ4x4WKk1XTFIbF1N pRTkXZwKl1IH1kbh9av1PNQkd4dHg0Ws/P/hEjRyGn5WThju5CjGP4BPsilT1n//+m/w oQlMxXEQz5AIXv6la5iqnzATVvFwIgyvqioaZZcKersJsrluFgFbUiYdl8QbO7mb4lz7 L8+mF+Vl7s0MsKldOgJY4Yye3ppfrTAh0D+2MDNEA60LTNjJZtMLLausDCwERSQa6g7M vXpg== 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=BQkzcdNzyFSe25Uj6LgRouwEG7p0lTXXdxR16Ve6oxQ=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=NewW021+HZcE1xhXN2rXkXm5HiYIa0skaptTsnFTdZeNDmTJLxfAV3FEvh1+pBYqZe 6ffveg+6TQ++KxYkzWATwbCTfZnSy981LRpGCmuM8wGWJQZaoP1Hto/qUN5LeSekCpTj Y/KnChBKI0gTOi7pp8o+qh3Bcpk4Wi3yuz6e7kJb4BQiVn0HL7rlq01q20HOwWD29WJv f0tB4yskKxiPVsCkJy0R6Z3a/mVTkK4A1kFGT+90pRvdsdGGV9/8iaqXIjaB+sTno5m4 TXYO+9Oy8oiTtf74xnDswoqNgler1t5O9ZL7zT+6vDNBD73vZphY7Q10Kezjusv+riba 5XIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NCkHWIK7; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4f089csi1407347885a.509.2024.12.24.12.09.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:01 -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=NCkHWIK7; 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 ) id 1tQBAz-0004Ib-4z; Tue, 24 Dec 2024 15:06:45 -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 ) id 1tQBAH-00032U-4u for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:06:01 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAF-0002eX-OG for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:06:00 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21683192bf9so61844775ad.3 for ; Tue, 24 Dec 2024 12:05:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070758; x=1735675558; 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=BQkzcdNzyFSe25Uj6LgRouwEG7p0lTXXdxR16Ve6oxQ=; b=NCkHWIK7DrSu01sUQ0JRCv9jgCZyJ6R3JUX5oJcIn1KB9US/EtDO8e2yYceI/xIYrY 25QgfSxI3HYw3NYlQKE5upeKNTOCvSY1UeAvnj4WfvwDCLZyF8S9JYMOIy4T9YIMxP7d Owg1BV8Z/kWL4zTB9gw2dCUIf6cvc7qG8iBTQ/37tJZynFvfuk5GXXs2TxQ9/1C7g/Dp MVLwLYSxDoNa3pcEcSdRWPfnMuJHYoczLWrd6nlTM9rkVVnoi4gErJ6Vfru87JxhQ9bX FUfaS/rp3IojAvjL/XGNbhiH24MoeN3n1q5rZ5M7EDbCZXNMXwDpwOt5I8MQfUNALGko 2TOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070758; x=1735675558; 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=BQkzcdNzyFSe25Uj6LgRouwEG7p0lTXXdxR16Ve6oxQ=; b=emVvF1lp9NcmhV6Ste1wcg2g4467AsuQRwYf8ekSsAe8SoIwwWd8c0G+56+jBIjQjE f1EDcLSUDfgXQXagY4mxbhuurRVnp2l0FSSDtdq7cvqDYf9TLIC6AZK3UYfBZ/zjg2n5 Iw+t8gccIB47R4ItUE15B1rlYLFxU5QY/E/pPMDx3W8O0VSLbqHE5FVLjkMG3I2byntt /8r3UdWefAlBYtGe6krSFLOljECsc8wpZNnZO5irz9gHOwcpwZ+7pUmKmEhHrM3mreAJ /5OxAunu4h0JBjNmaLWMW744bc6+S0XA/7acrzrLokV5APXl9jgnWzFL8JB3gRxF2Spg sLiw== X-Gm-Message-State: AOJu0YznA2C6LWvJsYDCYuaoa3LdvJCYdc9/tI2orbEr2Uk0IhK9zo+O 4B8F34XX7vC0G1IJaT0/rLIOJOAcKEEolQud1QpH2h8OZ3jGyh11bH+dvqHc4HzrjmQNBb7HqOl V51k= X-Gm-Gg: ASbGnct6ODd9S2+pxrssoOJZr93fd9NTpErSVe7HckZW+93tOogK8Q+9PmXJ0h1OTFt A3zzJY9Lub8EhLe4Cwwc7rM3qJs//eFktU4DT1vJyYaw46fKt8vPXNZHtJoM9NLuUks6lBUaPdh qS8JVBCipQIcAzKvn96JRkyEJkZdUjUZulrPnkRLmVz0G6/dxOFH8DLIlPrJoN4bG2HVyKCayez KTKxVgQcKNWjzb5B+z8PabYCFG0/ATNMPd/l1+nCxDb/H+i4+mT4t7Ys2Yhe9q+UOqmPmmvcFbG hmZmbKqVrIc+AYuLk6dUnbZLvA== X-Received: by 2002:a05:6a00:35c9:b0:71e:6c3f:2fb6 with SMTP id d2e1a72fcca58-72abde65a60mr30910900b3a.8.1735070757848; Tue, 24 Dec 2024 12:05:57 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 38/72] tcg/optimize: Use fold_masks_s in fold_negsetcond Date: Tue, 24 Dec 2024 12:04:47 -0800 Message-ID: <20241224200521.310066-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 74be827f51..7e909791e1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2387,8 +2387,7 @@ static bool fold_negsetcond(OptContext *ctx, TCGOp *op) } /* Value is {0,-1} so all bits are repetitions of the sign. */ - ctx->s_mask = -1; - return false; + return fold_masks_s(ctx, op, -1); } static bool fold_setcond2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853230 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081894wrq; Tue, 24 Dec 2024 12:08:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVXKz5km0i1tpYu+4df74D8yaqUgHvQkRQ1Bt+NxAyBGvUTD17IXCYD9pMCAAzfA2TXESts/g==@linaro.org X-Google-Smtp-Source: AGHT+IGjxa2e2+QW1mlrcrpqT0vLEViaJtakYqhzALhIwkenAbgrt0wE0XP3xIh7mBxz4+LJkhq7 X-Received: by 2002:a05:620a:1aa0:b0:7b6:67a0:499d with SMTP id af79cd13be357-7b9ba716853mr2698898485a.1.1735070920335; Tue, 24 Dec 2024 12:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070920; cv=none; d=google.com; s=arc-20240605; b=URb4qG0uNVi+QLaUpgYNSm1+x9N9ioA9tM4e083pLCoyodsMxR/lJGOnqOdxsTGBqq QWvwiYCSX/s22BAGzLKwzXzqrPnzr4gzZedfoNIZTAoptVystWvceMV2UMpmDaQSyp6u ThDqgAy65XYaKdluTSWp+HMrAOTJ86x6u9HPZA0I94PbR4X8uPHKTl2txjawGM2KYQb4 c6XL+r8TzJfmEE4TagPq+s23hBtcYeyPyXi0uAYLCMb9qGQlG+JecfxGjfbEqpTasAGt aJ49m88W5tClIiUEUhCmVr1r/qljRAhMqjEt1d2SIZPc2CW6HIg6XqJimqP3pfKUZ4Gv 0hbQ== 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=KrkS8wtDk9FFk+ALiPIq/W5dXJBRwDqMCYe2mtixhBA=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=h/mJLFSlyYwOVNO+GZhoMycqGogwQqN0ZZzbVaqrmRTl/Aof38LdXGcQ8dqA19Ch/S 3g1R1tN9cNDnhUHfYk1VGqjhGYN9Ig7VbqLyZF1s4gwFDI8BAWdQ/ieDTUATvUoAWfwl fvD78iT8O+YIL7at1qC7Tbv/NIWG1rtXECmUEA5W1lsDM7bkGsAggJmh3rNVb9rzLlrA KjUcFUtka+x15rhLSTYcs9AwI1Zb5UYagb707EGQcdJVhdfFdftpOrpbWIzds615yjU8 HWNLB5yUH+XTAQy6niBjNZq7T8Y0R6B+VZgOkcMYSqpo2ACfLk4WYE/13h87fOpy6ZYL thzA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="t/9xYq5x"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ad69asi1477240185a.125.2024.12.24.12.08.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:40 -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="t/9xYq5x"; 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 ) id 1tQBAz-0004L2-Ls; Tue, 24 Dec 2024 15:06:45 -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 ) id 1tQBAH-00033V-Bd for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:06:02 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBAF-0002fc-W8 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:06:01 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-21654fdd5daso55266095ad.1 for ; Tue, 24 Dec 2024 12:05:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070759; x=1735675559; 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=KrkS8wtDk9FFk+ALiPIq/W5dXJBRwDqMCYe2mtixhBA=; b=t/9xYq5xwkghOjepIImjrfYpyRW5mIwDzW9VzfucK6X85BXlqV07sXtO++55BcItgr aGESLnYES/BazxV2DkS3rCJJrqdeUbNG3XX3gcV3nna8BzOvPzvtBhcphek67OshKAWt /3Q0rCwlO39rJsZ4gkWgOrUZ1hAU6dgyIrRvQJ0dF+4r2amKRdgweehM5LsGYa5b8+CM hMRNXFPMr/NrT29wbnFmtd4BfFKjmZ+6N3PjglviLKSSjlFMLmkAjKCXDN1IMTCy/6lm TKtA+pbEEUU+E7mwpsR+wkNBTKB/jun1O5GhI+xq+NEMO4elixqQOmUNjjcQLmEQLaXB oOGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070759; x=1735675559; 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=KrkS8wtDk9FFk+ALiPIq/W5dXJBRwDqMCYe2mtixhBA=; b=pXSlF1hlIGeZxX3gQ8Pbi3/jB5BSk7f+rinSVnRjMwx8FdgQatiJeqP23CJ3TSwvDV 0QhB028rQvsm6tO0bjifx52acJ72AiAEzjjaYmaPF9cGpWLjjHM4ZOrfiVnYJktzIydu 25zee0+143wjFn8/e0QXfH3/X94Qxphqz0xb6YZG9aYo7t1GQdQj+vr+nOZZpT5xJCiE bCDiTFEOMzu2ZyOA3nk1VCzEcFlsA+/5rrFF2ocbx+J/yyilfFDtheVl3x042G/pMwEx i8aklLwMv5nx58+XiIY7OjhrB6wzN1uSH0pCpwcjpDQ8qGsNqHY0fGu07I0dTHL4Cjjt tIag== X-Gm-Message-State: AOJu0Yy0YYgf1nFgsHzukBB1wpHJ62RnJlhTii8/D/xC5ztBSP5lKeRl aZdNTTz/Zrf7eVEOxDK3lw5Xpr46wDzCaOSL8ryidSUQftSuWgLwOFZQLMQm4OFzxMxdo304zKe MPV0= X-Gm-Gg: ASbGnct56ucb8/Nssz0xs74t5nX2loOcHAioN1OpiYhdVgpfxiz+6swlJao5U+XreCW 7skRkoBp7LGFBt0Y1WKVEO5BD8v/A8gPykqywVYmgLsjUJyXxChFpRynEUhXfIn9vPU0leDceYU 0XKuWA51yd0xBxQxQ6rkP/rGTPyJQRDzsmiim6nq5sZGA5dq9E6pDdIymRiuYhq4zYLQMNMk5GO WcpGud/gWrObtSlKALCVUWx+gLV1AgDpLChn/s4hKtuftbjiq3oAAjEUUMRRRz40qUjGX0CGQDQ dWbzdOrFjudeJ4TlotOhiu11iQ== X-Received: by 2002:a05:6a20:9144:b0:1e0:d169:ee4b with SMTP id adf61e73a8af0-1e5e045d6c5mr28075812637.12.1735070758676; Tue, 24 Dec 2024 12:05:58 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 39/72] tcg/optimize: Use fold_masks_z in fold_setcond2 Date: Tue, 24 Dec 2024 12:04:48 -0800 Message-ID: <20241224200521.310066-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7e909791e1..c61d0eae4e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2468,8 +2468,7 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) return fold_setcond(ctx, op); } - ctx->z_mask = 1; - return false; + return fold_masks_z(ctx, op, 1); do_setcond_const: return tcg_opt_gen_movi(ctx, op, op->args[0], i); From patchwork Tue Dec 24 20:04:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853241 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082319wrq; Tue, 24 Dec 2024 12:09:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUEuJZKFD6N3SD79iMtIAmmiqH8ExwtDyheCYXNzDduMl3zOQ4ObwpYSwA8mcg3gT2x24HwJA==@linaro.org X-Google-Smtp-Source: AGHT+IGB3GRJHqLmRaj9rWaKOM2lGeeYpfTAehun8t+yrSHxj7Y+UAzMVr4rg6BTO9ej2fWk1JP2 X-Received: by 2002:a05:620a:4711:b0:7b6:da2d:73d8 with SMTP id af79cd13be357-7b9ba79af04mr2615151485a.28.1735070995646; Tue, 24 Dec 2024 12:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070995; cv=none; d=google.com; s=arc-20240605; b=AYC1cWmlxHbBurH9hELy5B7vywGgDSZSanMUJEccbRZkUHuuvbjQsFdtk9PadPReEW O0YHTRtqY/37QVl5Hwgk8YafHuK/m1aKPUJatviwgGheLo1DfE4U/iNpN8QthU9SPG1C iSFQvoByDA8qBLHnpjtjyrS6lzx4h06893/4dB0FHiX3XP+eAwnxyY8Q/zYyfwwxq/QD qyr/Rifoio6UE3/4LbwtyE2HaPMVH2JzZrvfQd5osL0Tu/4Gtgt7TpXajbz3YZJx6zMU OOg9e8OE+5eFwIcEChPwVjLdaxCw0FMMWxoEMoSjE0eGGq/d5QJDK5awwXcxydA4hPaq U7WQ== 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=1RODzffUtUxINNUBBssSAHn/zSJ6hm+VWiAhpzm3k/E=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=KrbZeZ9v5sFPrUr0u+X2euXv19izv5M2cWtUvrnP/UgYWzOnlmITn9SpwO/8fYx3QW X7+rrCmX7MAcp2dMZfIr1A6QAj+TUySbQMpP7qUgrVlB2pUMOElaDaSzcapJwbYoV0Gn xfOp+sFj/CtE2sLXZ4U0gy50fx9eQLxOgN6KXFNRx8TDG6+a6aEfLR4rxDQ6NZJt684L 7er6virPadiyAfw5pw6BZrrNZi2tSjYR7/VLnQLOn/117uJqh+IS9K+ikuwUht6fXQlW DPNJEGF3WZ11/Oce655EcOvaFnQj/TSR7tLlL/6A0hb7MFy/gjyKh66kdq3Dtm0YNKo7 zkmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wDVo3/t4"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4cc783si1571166985a.353.2024.12.24.12.09.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:55 -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="wDVo3/t4"; 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 ) id 1tQBDG-0005Zp-Ac; Tue, 24 Dec 2024 15:09:07 -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 ) id 1tQBDD-0005Pp-J8 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:03 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDC-0002up-3i for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:03 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-218c8aca5f1so66387505ad.0 for ; Tue, 24 Dec 2024 12:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070940; x=1735675740; 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=1RODzffUtUxINNUBBssSAHn/zSJ6hm+VWiAhpzm3k/E=; b=wDVo3/t4PYaN+gxajcQ8ppA/HJBzaJTrRYsijcfAoM5S++EmUwb4rfybtBGHa3NFGk jMErJt6uaknxeY90otCUBRZYs+PvYAlnmppVzIDNxroo/qE2C9aKz0iuL7ACRZspzjXv w6lHzH2PnF6OPk+KpwgtJwJC/TcQIGOTldn2fFPr78vPi4CuVZwhxifCOG+v45clkdfB ytpQPWyS/TExyTJr/afAm4vp4icbykTiX8R5+F4gf34FikrRjOsju+wKUcwG4HgcZknN EG1xW7F4gC6O8oKjzzlFbcngSqH8j3JGUUBonocZAhMOYXDfxVxMg6HS9j6OgaCsKNZd Hphw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070940; x=1735675740; 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=1RODzffUtUxINNUBBssSAHn/zSJ6hm+VWiAhpzm3k/E=; b=NcMcXTCnXzjkePuZqHd6feFW8uyGIU+axkbWglQq6aaBMPuI4L60I2nZi+0SVrtuor j01x3AxCIPLVuFHrqa58joMO9+1HgLzbYPKH7yG17GEGCg/pem5IEpwoFuNqbEKCaj+p Y7XR0ht2/0sL58iuQOUJh9POAEgALmctO5uvmdAnHO/IeGgWGrg4/ZsdGxpEadHaw614 D6O6CrcBQkOoGrBQf0Sf9v5Be5UkveQFcPtNw1Wvyzh3GzXXRrdxzpxWoEvjEO+LXRxj nYbRVRBc9zKuJGG8dBkJTdESVWp5SdL3ssHq4RL/IC8gOBAJjodUlgd5EiI8k8Kd4PpP 5yFQ== X-Gm-Message-State: AOJu0YyLIA8dp7uY8OHBsPh43VJlvn0nsaQXACcDd7UhN/kTeTRt555I 2h/riwbMd6VED1ggbBqB6AQo/wyMLZst0jy9ygve1nkj/yJT028TdHOX61n/5ecSfKh22ofdIqU 7KTY= X-Gm-Gg: ASbGncuED/uAkNk1JrhO6HyCVX5hJVwUraAmf2wXvKzoG7QTmVs+jEDIwQPz+OyvWag Brh62HcYj+Dq8OEzkQP9HqKY+FH3q6RwnuV3Xdi6apflaXBxL86d61cmEbprq2ymLhnx0WOGyJJ V2IDSJyeGIc15kfj5YH4aaxooAB/zpxqn3ujbUD/mwcCXDrkcbthdRcWIp1401RebYaf8MP8mvQ qfd14YjZoz0zOHJrHWqZ3jaYkOI07C462DTpSdah24Z2OxgsAW3MnpHqSvOiygJY44jXwy+lzgy smkr6D/yzzrMZtIZntuQbzsM8Q== X-Received: by 2002:a05:6a00:1909:b0:72a:bc54:84f7 with SMTP id d2e1a72fcca58-72abddbe0demr25550027b3a.12.1735070940413; Tue, 24 Dec 2024 12:09:00 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 40/72] tcg/optimize: Use finish_folding in fold_cmp_vec Date: Tue, 24 Dec 2024 12:04:49 -0800 Message-ID: <20241224200521.310066-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c61d0eae4e..ccdac7b7d7 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2480,7 +2480,7 @@ static bool fold_cmp_vec(OptContext *ctx, TCGOp *op) if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { op->args[3] = tcg_swap_cond(op->args[3]); } - return false; + return finish_folding(ctx, op); } static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853267 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084609wrq; Tue, 24 Dec 2024 12:17:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXFbIqeaEs29Qq7wp3tET53WQih5NVTT+PxRlBZ29QTS8SvSm+RulKivAH2ppE0SIKRwp1TAg==@linaro.org X-Google-Smtp-Source: AGHT+IGFmnNVszshpuOwZl81V7lASEuPoqbHTab2Q4OBkJvyLTwV+B5/t/R8DmgbtEAXEoyA6YIx X-Received: by 2002:a05:620a:1a06:b0:7b6:d2cb:13ea with SMTP id af79cd13be357-7b9ba8363f7mr2744280885a.60.1735071446627; Tue, 24 Dec 2024 12:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071446; cv=none; d=google.com; s=arc-20240605; b=h2lV0QqoitH7pIUmPxHrB2h5K0urkmQD43dZmwOKO+BdEiELaDdE3OqKpp4gbb+9bb RYLqBzrvzYr7yFpjN1sctObyspUC5eprLM6Nms1QCGkSVvgLJnKBZFD+ZxTcM8Wufymj KAF5/6nDpV2/2sQt+ogg7rG6IuG9sfpbc7tuNc4SiCHDmIpduUNo59PpU+IoBeYwOoot 0gUGDl7FcLis/T5Ks1tiLBSKt8001WiK3dhLEvZTDyQzk6qSmfL9WMDJjr7rMhr1fuvG Rn1h1ExHcUbaQKYae3HVVIRp+eSTwsoV3QjXz1EK62ffWbtoVHSqMsjM4lkrWZQ+8WJk ZnjQ== 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=KwVb6jhXptH+wLf21qGtM54iqz3y5j9Rj2TRVse+NVA=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=ky8cmwOckYrlQT3s87xsCEc7ATV8xmkK5DSpnxMsZwwZHK9ohSXjDDrseoCa8HqH3g MQYvoYC0gaOJdYhYo6uGu+/593QGKz4KV/rd01He+km/bsGNp9A7sG022hduD6FNJAFM e8uSrrLBNzeqYFu2iO2glMwBQRpXZXsbxRPGbUVLfjVRs6C+/rlf5t7572nxuuTwzU8g AMPrPHuYmRA1/yqqBMOybHxKZM+TR3SD0xq2yLeNTjh7OPfCWkQo6i+Mw6DRFD//LzTY HlJUYcg8oPYWPoPYp4JespNk1+AfqgM1+8BHc8zcWDj20IqfALNJYMfKKV6B6hm5JEgD Xtwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WWeS8WFU; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ce346si1442052285a.165.2024.12.24.12.17.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:17:26 -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=WWeS8WFU; 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 ) id 1tQBDK-0005yA-RA; Tue, 24 Dec 2024 15:09:11 -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 ) id 1tQBDE-0005UV-8C for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:04 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDC-0002uw-Nw for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:03 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2166360285dso57567695ad.1 for ; Tue, 24 Dec 2024 12:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070941; x=1735675741; 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=KwVb6jhXptH+wLf21qGtM54iqz3y5j9Rj2TRVse+NVA=; b=WWeS8WFURnZjaMYNS9eNduIxP238ZCMB6E05CnUMKBaWPFgE7Ujcus8iZX7mvjcbIu eqyXxUdRLuOW6k0T+QL4fCeWvv8yiL1+IaT8DbDlm9u6YToTr5A49GktY4EO7hJwXKaf 8TQwvqy6sFjQgxhLE163FpHn72AmukUS9zrfhwVenCcwC2CPpgrq2F/ae5RpATIGHL0G o9RjlS22hLtD1RlvxXHyethbbHkFmGR2Qi3BozoUqJB+f1kIW/OMcKcbWEVV6VppzHZO WhROEYNk5VbzbEfvipXrJWdLwbn1UWbmI6fzYZazjqHSR7nzcLMgEVtbJ+80hh/ln5X1 bmuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070941; x=1735675741; 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=KwVb6jhXptH+wLf21qGtM54iqz3y5j9Rj2TRVse+NVA=; b=scP85/MniSCP9rM5rtmL0cBfW5orvTVK8jfy8heNTh7vpzQUf1sJ+1O8EaTBbq9RZx i+ygo79AiGGo2amIbEJqV4h7krpSuxx4tF7EDe5bV1+PG3Vt6kpmMoc4p6nWNw2bvnL5 ZKLkTWJVVszokVp7GYXUyLwwQZKMOqaMyOr0rksmSvPjrn4L4iFFnq+E2DNiiWaPWQ+W M2fnVAHp0u9geRUknZ2EvMpB0nk7gXj55caVHaXuwDUxttInAPXTMSxeLaVFV44lDikH /dagoTmN9rTXbzdU1N/cSkaSIn8Y+8INi/KEit8h+I6m3lVLdev6tsesiAfSr2gvs59U lrwA== X-Gm-Message-State: AOJu0YyDSrJo+npDOgAhLBgAavFBO4WBnO1bqWVwakEKDFji6swpyZf2 um4C5A+sDsLwJHEdvhH5lthpI0x6xpH9JIpltMuvPSNv8m0B8tnYh3EAWRqYs0fPEzJBNcvkFJ5 +KLY= X-Gm-Gg: ASbGncvqLETjiUthTBKrAmsQMWxXJ+XN7P6FBWl0RiPX5A2uyMu3Hyb1EjRVmVRXsll 0SgiMQjq4NT1i5za0INGYteEVFVaKsFxZGenoJV/jH0EqH4NCziB70m2aeS4Jr/kvAONIfglB9E aWsrI4kz3kUBO9s7T7Q155aUHVZC9lfJuIiF3ZYYq0zl1zy/aLe0E1uDcCOPUNbOUS9sIOAtyln eTG+eVF460vpskWJNsYWKp35jEAYFINHPeCivTfLqqEdjNC8wd6wF7oV9hUizPaKxxNOkHU0hdq qoBX5KNMP/+FTgYbIr0P6Bqsjw== X-Received: by 2002:a05:6a21:9994:b0:1db:ef68:e505 with SMTP id adf61e73a8af0-1e5e05a9ef2mr30884582637.20.1735070941285; Tue, 24 Dec 2024 12:09:01 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 41/72] tcg/optimize: Use finish_folding in fold_cmpsel_vec Date: Tue, 24 Dec 2024 12:04:50 -0800 Message-ID: <20241224200521.310066-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index ccdac7b7d7..4090ffe12c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2501,7 +2501,7 @@ static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) if (swap_commutative(op->args[0], &op->args[4], &op->args[3])) { op->args[5] = tcg_invert_cond(op->args[5]); } - return false; + return finish_folding(ctx, op); } static bool fold_sextract(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853260 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4083764wrq; Tue, 24 Dec 2024 12:14:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUIOXRX5sCuJV/syE1B+KcZFHo0pBSlP/OB0aciKdstaOCF1elqlVSrDBMqmkGseYK107tTiQ==@linaro.org X-Google-Smtp-Source: AGHT+IGF1VDP8PRzPaw7Ac0vDkcLfc5HTij/AXr8/Fw7oJVlQDZt33JFwXOYzBO8/5c4yLQa0Lx4 X-Received: by 2002:ac8:574a:0:b0:467:50b8:63aa with SMTP id d75a77b69052e-46a4a8eaed2mr297584551cf.28.1735071281938; Tue, 24 Dec 2024 12:14:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071281; cv=none; d=google.com; s=arc-20240605; b=ZvyXn2OxQAo2C1+T2ibBf9JvRZjRaVDd3a3uo56cPISuD0OEbmgIxKidMjr0KhqsBn aJnYbjIu+GFf49R8OG3r0sddCN+JYCs2f987SolYMNou23NB/iO9xGC6THvkI4perxlm WEFKPCqPFlD2RImYHEX9xXf60w7W9WAU3+DD/uOGyza8sH/MS0LmZ7/nlzGOe9XUjnF/ lwe/YsSpRSTpjwGe0hj70ev+7B90B4epjUSVDrp5CHrk592nrwQMYW9TAXmPM1YjgnG6 kkhmp2jCUgXYxdxR8CwsXSgFCh8oPL0rysMX/8TwpoVUQMq/B5GQN0ERSkr3Xaf6xmKN VvZg== 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=Vqya82Y36HRWm92cvOJyTlH+EENkrrC20W65fSXxCcU=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=ByyAYbQfL5U1Puq3coaMTAefaY2i/Dhj59pryrypteugAFTdBJS9iRg0n1RRPHN9d0 CDBtLQ6NmUmH6FA+HmzsO45yQAjYPeN1kX+JbLTGU84j5XUktsDyWmyIJw87m+zEwYde u9yd/v5nCUDfQ8Yq0ZHq/OWeaJAhnOSBQc63JcS+5W2qUvydghcllHZKKaSlJVQHN9k3 fNLwud9PtdT+BlTmF0nfZf5lbO92vIoylirGXDtmSPManQ5THnLFxMonCVrcW/JaJXqT XPlf702EOH0qDgXxLqHF3X93qI5+Neg40BDK7m8WL4zx0sPtNE1QsYPITYaNkwIy2m91 YelQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eXpTnONW; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e6816cfsi133881521cf.18.2024.12.24.12.14.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:14:41 -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=eXpTnONW; 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 ) id 1tQBDm-0008QG-FC; Tue, 24 Dec 2024 15:09:38 -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 ) id 1tQBDF-0005kJ-4v for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:05 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDD-0002v6-KI for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:04 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21670dce0a7so73943235ad.1 for ; Tue, 24 Dec 2024 12:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070942; x=1735675742; 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=Vqya82Y36HRWm92cvOJyTlH+EENkrrC20W65fSXxCcU=; b=eXpTnONWs0aX4C+2om94tOcjCyePDt1LgYEhQQs857PlM7M1IQBcBiiTwg8sR8CUav mAqiLCPE0pKSgmz7kgR39LHUFDmxnPpj5sPqA6ie2vM3UktJjlZ4Tlwrf+Zx+cVNNVl0 +gDDXQ36xC8P45AE0fpfOxudjSb+B0eNCqU5mquJNyA/7EOK4wYf/YtFX3uscW5vIUxc bLDPwLdf369O2wvi4TJjRRni/A64yXrvT2PmoxPcRIu/kSOc372TUs0gTFGb4rKHyVkL rQ5HjrR6ZjWpoTwxQS0x9ZFbdK3vy2KBzmX+BzQntrzpzTjnDjdz/LGdYoYOrjSwAfrI WrsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070942; x=1735675742; 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=Vqya82Y36HRWm92cvOJyTlH+EENkrrC20W65fSXxCcU=; b=RkuhOUzHOkKYARblQBlZEWJQa5CTXvVMXgBEPZzYdCOOg961rwoNV0c1vP3irmHBMi 9Z6nZLU+x0zPZvkcJLCT5CbEts8A8X+XtCizSYOQBwDdHBy1FfEzi8fjr0gNJoLijuRn 1roO3YlJnrYFN38rpsbZ03CjdXZH7Utcy/tFJvMJHdGGeTML105co7EbRzraJqhL/95B cvZ8pcSssv5+65mEi1Oo+Curuax4GWkYoY/A9mNO7kQaOx3OfwHljLeuU2hX+WD0NQ6b D0T8VivNjs4ZVGR/u8pgnyzWwG6i6j6kGhLMALLAfFMBrzlfkK74sn3DSm4St0c0yQgN 3Whg== X-Gm-Message-State: AOJu0YyqQ1ynORIMTnsmv1x/edLdVprbfjCx9BHiMHSwMd+5fdlRU0vc QPvOFM/3pF8IggWlzG3XrdmvzAugZGtr17p/WpC2+zUkzVDFh3IjV47HgMfbP3OpcM2dKE2RVCB wpzk= X-Gm-Gg: ASbGnctjq2RaNYr8xHn5cjBOihUFyV5GhYpQhl14lW3sOOAS6fLYpAIBrbPjD51p1mR x6wepr3HIjYvUD6hARVH5PWZQdw5joyaplB9iLL6YDmvWK5poPsIWgwk5bLWvHdkZoBB4zPl5FT k2UzG2N49X0eE3FsFKjXQ19RA+n/BKMAp3gAA2sw3fVZW7qUXXfm7EZxQx5LU0Ux7rTTQBcuky0 OYZTrhcdITXUx4NpHv1iBNDcAuk8qNegeEP+OY3wIfeCE778yxScX4kuP4zLJ8VX/wkT2CQ3dGP TBjco0DhflFXDoSUiSG3+4E9Ow== X-Received: by 2002:a05:6a21:9106:b0:1e0:d36b:ef5e with SMTP id adf61e73a8af0-1e5e0869165mr32263993637.46.1735070942351; Tue, 24 Dec 2024 12:09:02 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 42/72] tcg/optimize: Use fold_masks_zs in fold_sextract Date: Tue, 24 Dec 2024 12:04:51 -0800 Message-ID: <20241224200521.310066-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4090ffe12c..2d634c8925 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2507,31 +2507,25 @@ static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) static bool fold_sextract(OptContext *ctx, TCGOp *op) { uint64_t z_mask, s_mask, s_mask_old; + TempOptInfo *t1 = arg_info(op->args[1]); int pos = op->args[2]; int len = op->args[3]; - if (arg_is_const(op->args[1])) { - uint64_t t; - - t = arg_info(op->args[1])->val; - t = sextract64(t, pos, len); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (ti_is_const(t1)) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + sextract64(ti_const_val(t1), pos, len)); } - z_mask = arg_info(op->args[1])->z_mask; - z_mask = sextract64(z_mask, pos, len); - ctx->z_mask = z_mask; - - s_mask_old = arg_info(op->args[1])->s_mask; - s_mask = sextract64(s_mask_old, pos, len); - s_mask |= MAKE_64BIT_MASK(len, 64 - len); - ctx->s_mask = s_mask; + s_mask_old = t1->s_mask; + s_mask = s_mask_old >> pos; + s_mask |= -1ull << (len - 1); if (0 && pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } - return fold_masks(ctx, op); + z_mask = sextract64(t1->z_mask, pos, len); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_shift(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853257 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4083274wrq; Tue, 24 Dec 2024 12:13:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV7utl/Ru+/xqU9tZ7Ysli9cVWoz6CjtaIpulfoEZQe8+7SlgXPMH/rZhpsRXoQ6owp6AjsPw==@linaro.org X-Google-Smtp-Source: AGHT+IHjCzRJlA0plwJuemRsVf73/NSiVP+Wg1vd+UxYwwwz4DRaHYEJ9I/gm4a93RQlZHBkyFgd X-Received: by 2002:a05:622a:24c:b0:463:5cd7:ddd3 with SMTP id d75a77b69052e-46a4a8c5bdfmr280636101cf.11.1735071182621; Tue, 24 Dec 2024 12:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071182; cv=none; d=google.com; s=arc-20240605; b=TYnxRmrux5AOVEFRFR8KnTN8oImcNX57iXA4vJo8H4met9s5+wRGVrp/xMaCrQJqaa pCpZOx8lvoLA9HLBcX8MRr8xV/JdXKhTyuzRcKcbYjdRl/tWhJS3B+k0GTKSepxF6k13 ZmiOrGQJXMZxyhHax80hzyWT7PGvQCRh4x/L4uHtrGUDgx3xnB2sWAoldOhW5cy0/w9X pQvdtJQZfanaKyibzSPGnJZgqYZEZQ9FY7nkA7ylsbk7lpCNtpisb8p51+zBknCtPZMj MxA96o8Bu2Sug2XI4wor1x3V2KV5pQR6GL46NEcXV3glX5Y9VfDqHYu06J9YAenF4cAz PkLw== 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=iOuFCqy4nAJ5B7qZ12n5+XuPYo2SCzX8rn+oDAFQ9fE=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=BsjM/dQUK0kBlceh5VH6MWL/LRcXApCn/Ta4xqHN5eo1zVb2J/oeaP+ye8ruveKBFZ TjvxHPN3Z0F8dfYIlfHvuo0WZyMn3jTb5FJne7NdMAmC+PD73GZjkK8l0Ll9o7KtWnES iGJweArn6FDbOJsC3dm7DfAjAPeR0LLOgEgSUp0x0WQp/x8iBDcYuQjtfc95XgN5voKM j2CZ299sVuGYDQM/4X2L3KOnd7igqRzMhOSRTxdbGyKMR2Pkmatyu+lJGL7XkssQss1S qt8Zr/9NWuxMir8mf6WXBtQ1vpVv/9xM2PW7B+j4FPXL6KAKjtpEXYhK5d2oC8Xl/erR yF2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oN17Czdv; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb9a64dsi155636071cf.268.2024.12.24.12.13.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:13:02 -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=oN17Czdv; 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 ) id 1tQBDY-000721-CP; Tue, 24 Dec 2024 15:09:24 -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 ) id 1tQBDH-0005t9-GX for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:08 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDE-0002vK-LN for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:06 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2efb17478adso5478252a91.1 for ; Tue, 24 Dec 2024 12:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070943; x=1735675743; 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=iOuFCqy4nAJ5B7qZ12n5+XuPYo2SCzX8rn+oDAFQ9fE=; b=oN17Czdvk9dIPVV0jH99tNlm2bltHi20tbFnT92jSnuvEdyMsuTgT5GHOZ8ffOjS0Z zKfnvNqdFKIL0Jpvii8dEpyNT06d0c4otsyFWDsm4BUTtoLM9eFB9cAx/X51eMcyPpz/ ueNJ8f4bJII+C57gw+oaRjkUWyFFknPCQloxIF+vVqzWQh0T2xJWEDds+xiMpMjscvyi gCizhItnwmxRs80qu1vuT1uHKJdn3mBZrJ3wt2TdX6OKvKUCajGziExo/RMVQOxcZCly 5dYEsx0JVodTQSjsdwlhrP+XWntY/9a56APAleqgfKSzcw8JM+vDlsESbCOiiDSd44t3 5PnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070943; x=1735675743; 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=iOuFCqy4nAJ5B7qZ12n5+XuPYo2SCzX8rn+oDAFQ9fE=; b=Ptwr3+kesQO0oQxoEV6ZeNGJMosYOjrlKlGy/7beZb40EM8kDXhO+o3HB69e9sqfVW X9Rj7xUifKyJegJhYw+lfGczBrSmziP0ofz1t3TV6WUaasg1kHggfukkkGRy1rXsQLv6 rgmRr+0GqREBNNlMCXDT244AhRM7G03v8sv4nK6VKkb7MRHsox6iLmFXlNPkT05c7Od+ E4GyQnR/2Wwy1tmkBYpjvSMtAv6zOWF7kEztXNUULW5nfxLN3HBoyyRr561me5NZHp+e 4c9jrpOSrMwKsX6Sd8qO+bdQ7GiCGVtudTW0NPg0dRYe06mzbJT6SpgOMHkankXt4kSX 41Jw== X-Gm-Message-State: AOJu0Yz2Oc7d0JmxtJygW+Y75AlWPgh1qEzpvwJfOHULxxbP8zXWKQwo I2E1U/lbf5jqnF9P3wPKYojYV27XPg1EfxCeoHHa91d8KdQAEOt/J42wuF+t+da2h0xPlJn4a7v G6Ec= X-Gm-Gg: ASbGncsPQL4fbwO+YTDyqq72CjnQIH2inAN192c6vHFpdp6YG2p+hKJpgZWb3tBn2Ff dJTsYWcf419eaE74/uzm3QyrzOeM/vkuPdRNeW8COk0g2vpjyPFoUubHaU9A85pCzMIuiQfIAHx uzRpY1CqE9PDhIP4TBoI3LLMu1scrQPsD3utkKcehwLwi/Xd02Q/HffM+d6tMN21+BSdqYS1HJr qiO70FlbZB3TFXNoKykGmx3EFR/OFzgHkEa80xOSAzaIEwBAYt+id6ESjMf2QMGW9R++LPEcXxz EJomaIVTW4HQmNnIN8GFodKAaw== X-Received: by 2002:a05:6a00:3c84:b0:725:4615:a778 with SMTP id d2e1a72fcca58-72abdd7a148mr20442194b3a.7.1735070943279; Tue, 24 Dec 2024 12:09:03 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 43/72] tcg/optimize: Use fold_masks_zs, fold_masks_s in fold_shift Date: Tue, 24 Dec 2024 12:04:52 -0800 Message-ID: <20241224200521.310066-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2d634c8925..b70e9bdaf5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2531,6 +2531,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) static bool fold_shift(OptContext *ctx, TCGOp *op) { uint64_t s_mask, z_mask, sign; + TempOptInfo *t1, *t2; if (fold_const2(ctx, op) || fold_ix_to_i(ctx, op, 0) || @@ -2538,17 +2539,18 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) return true; } - s_mask = arg_info(op->args[1])->s_mask; - z_mask = arg_info(op->args[1])->z_mask; + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + s_mask = t1->s_mask; + z_mask = t1->z_mask; - if (arg_is_const(op->args[2])) { - int sh = arg_info(op->args[2])->val; - - ctx->z_mask = do_constant_folding(op->opc, ctx->type, z_mask, sh); + if (ti_is_const(t2)) { + int sh = ti_const_val(t2); + z_mask = do_constant_folding(op->opc, ctx->type, z_mask, sh); s_mask = do_constant_folding(op->opc, ctx->type, s_mask, sh); - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } switch (op->opc) { @@ -2557,23 +2559,22 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) * Arithmetic right shift will not reduce the number of * input sign repetitions. */ - ctx->s_mask = s_mask; - break; + return fold_masks_s(ctx, op, s_mask); CASE_OP_32_64(shr): /* * If the sign bit is known zero, then logical right shift - * will not reduced the number of input sign repetitions. + * will not reduce the number of input sign repetitions. */ - sign = (s_mask & -s_mask) >> 1; + sign = -s_mask; if (sign && !(z_mask & sign)) { - ctx->s_mask = s_mask; + return fold_masks_s(ctx, op, s_mask); } break; default: break; } - return false; + return finish_folding(ctx, op); } static bool fold_sub_to_neg(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853275 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084973wrq; Tue, 24 Dec 2024 12:18:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXi6qIEo4hGkpVjf9qmixCnZJMHFHOMGpyfXWs2owevUZiyEh1Xxydpl/CZxM6MgCnHe+Df4Q==@linaro.org X-Google-Smtp-Source: AGHT+IFI5hK+6ud8mBsAswp87rAwx6bEITfmCQOnaVcg4fpfB2rIFFD4C00xnOAZlSK7QdTxY8WP X-Received: by 2002:ad4:5bcc:0:b0:6d8:8109:a547 with SMTP id 6a1803df08f44-6dd2334d8aemr255351226d6.22.1735071524340; Tue, 24 Dec 2024 12:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071524; cv=none; d=google.com; s=arc-20240605; b=YVx62jCuq7E1Osy1z5wtslHZszccDe4dyrZC9gO5s9xHp4YetIBDBjUI6ymZ18nx4+ hgqeVUNXDyXrAdd0XisTTsMua9w4i5WkXCCNbXxROCdcTDiU3EdexK6XzIhB3WlqB7gF VenhKSMDaGq68auwSDHTHhrPvolOGJsqm1XjtOGKUn2EfAQOXfd1GWcwVoIhRaNuNJVx fwmnTjNWM3AesQY/piUSFVAZ0+BNbbC3dn2BT29MTv9gElnxr5Qu0U2XSKVXnkgDGuvj WAgmIUXHVrDCASgerPFFR+f1iHTV19rPKlq9y+6+ZycFmDBqdiF7lhCtIIkHFrLd+91f mQ8w== 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=fWD89RQ9Sb2UhObXSAa3h+FC5JlParE8myCYhh3ZG/k=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Ld861ngTAlOFYC3pLjVEILdXIm4oBBfJutRUdEcwuUpbvL5Fi3EmW68zS6pKv1W7du BNaTf4B3+QurPPr60/QjXJaDOFKoYjOHfP3A72JmXEJ488X0uQQbarzefbxghdr1BScf k2ymjPvYfR/pCrMPEEHDhqRNguaTc7VGb/hXy6c6qVkEzg2MZQWJEjH28dKO7M/h1Qlz ZCp4it0B1LiQkqTo+OUBUJKi82k5C/pfxAXk0xQ/glEgxbl6IhL8cpSq+rUo45Zf+fPA aiNI9V5b6T+UEVveiByrNhdAR26BdIRYVxD4oNlW1jhR8y0RpAM9tlMkCDcLjWfRvk3E vQuA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bq1Tqnrf; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd182369ccsi145565646d6.244.2024.12.24.12.18.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:44 -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=Bq1Tqnrf; 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 ) id 1tQBDR-00068F-1v; Tue, 24 Dec 2024 15:09:18 -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 ) id 1tQBDI-0005zH-Q2 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:09 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDH-0002vV-90 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:08 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2166022c5caso50556375ad.2 for ; Tue, 24 Dec 2024 12:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070944; x=1735675744; 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=fWD89RQ9Sb2UhObXSAa3h+FC5JlParE8myCYhh3ZG/k=; b=Bq1TqnrfhldLnw+FKKsZKyIbN7U4gy5OzmmWatzQiW1CsPK8qltF1bx277PdTFEHEi o7mYtOPCi9ro3+MY88wHSb8W9ZoQIOow0k+if/YdNK9xgsBNNR8w2VlWlZY+4UuAmp8m MX/IzYv/NIpZlRjds9DxjZuLpiES5sbM58dFCYb5BNOElhpNyLytPZHVNRWyB+vYCtvX iDhDTrMYDnLIPNbdMkZLAvFKpfIhscGiiyQ2hNl5exul9QY/DgD3hTbSO98CGHss8ky2 D7SbRd3FJeydqrLe1BD+Nvvo/BPRKXeFEZgEtUSTjhxcQwLbVI8aHV+NGENOd7HyXMzq Ho/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070944; x=1735675744; 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=fWD89RQ9Sb2UhObXSAa3h+FC5JlParE8myCYhh3ZG/k=; b=gt9M/mHhPwpDcv96kCS66V4XwMQiCNQnyzfksDOVlZdSe1CpgbcfxlSfZ0iNAHMW3S Kh1V/wD5wf4AUHHSE360LHJMUx/almn8bliPJ7Pf4j5/rAJEmlLXP9lqlhM3Qb20+wAe kZXRPeqUHQtaSWuDPE2tvmxdkPZPm3ANgw9N8qYBWjkXoZSSFdXXbMeXqGVTRUr4DQ91 0gda4kpZquIqEf3nbuOMmEMO5dHcVhWF49ep6oCpOCCIlz4DpDLVfrbHlQ8mgZbc+4eO Ty/OOt5qTCfOKauTiU6GtbRZusT82FcCEUcyBtdFA0m2dG0G2umOXq++w2+zPI+4glAB ZMfA== X-Gm-Message-State: AOJu0Yz/hyP/In8uSVzGcqqKaZ1VDBMv+1/pHrLLYeHyev91t9QKOf3+ yTJGPwtLYKANdJjveGr9j+5Fvrn0542ns/d1GK+qcXwT4aM4pMCY8qbNjeQN0zqxP87sT3X8+E9 zOUM= X-Gm-Gg: ASbGnctNiaq1UHfD6jbbGe/riazny9FW7Iy6tkipkORPbE6q0aapLIF9z0JvoHCiNt7 sPbaq6ggWI1hVGSgiCMl4AafL2ePDITx1SIeXiClbF6OfjsNtJehbYBRFO56u5UI8P3SEUzHmMO B607r0Jr7V74jukw53vmNuY3uIGhQeQ0OasXDvTDXegskeNSb3VPwjMeJOamY8Ts4J5agLcHNF9 VEYuq5tj95hHK0MLi6FfVUwapS2tKImzGzvgMaIpQaR/00rPiJX57lVEnb6NFXgVjgKt2rslL3Y /yH26JbXEGfWyTmThy61QYmIAA== X-Received: by 2002:a05:6a21:1693:b0:1e0:d89e:f5cc with SMTP id adf61e73a8af0-1e5e04605a0mr28516895637.11.1735070944442; Tue, 24 Dec 2024 12:09:04 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 44/72] tcg/optimize: Simplify sign bit test in fold_shift Date: Tue, 24 Dec 2024 12:04:53 -0800 Message-ID: <20241224200521.310066-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 Merge the two conditions, sign != 0 && !(z_mask & sign), by testing ~z_mask & sign. If sign == 0, the logical and will produce false. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index b70e9bdaf5..26790f7c27 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2530,7 +2530,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) static bool fold_shift(OptContext *ctx, TCGOp *op) { - uint64_t s_mask, z_mask, sign; + uint64_t s_mask, z_mask; TempOptInfo *t1, *t2; if (fold_const2(ctx, op) || @@ -2565,8 +2565,7 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) * If the sign bit is known zero, then logical right shift * will not reduce the number of input sign repetitions. */ - sign = -s_mask; - if (sign && !(z_mask & sign)) { + if (~z_mask & -s_mask) { return fold_masks_s(ctx, op, s_mask); } break; From patchwork Tue Dec 24 20:04:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853270 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084714wrq; Tue, 24 Dec 2024 12:17:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWc/wJ6iXYXQQqWcPpdpbAWiQAAQAXJsLbpy1cbBzu60mCZdzV5CGHjm8ncTGJe1wiSQJrrjA==@linaro.org X-Google-Smtp-Source: AGHT+IG2rcyhYgVuqP6JE0LTN48MlH3AsIO5XWewKlBdK2Apo0OgraB3/k5mRWMbTEn6P5AozbAe X-Received: by 2002:a05:6214:2b0e:b0:6d8:9677:fbe4 with SMTP id 6a1803df08f44-6dd2331f2f8mr344827406d6.9.1735071469010; Tue, 24 Dec 2024 12:17:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071469; cv=none; d=google.com; s=arc-20240605; b=U08NIDEAZ4/ILynp61Mw0kmyW1YYLljt7qv8PB2rKooNv+3wMslfWEfk3vF84crLoE WRQiUIJxh3jYPqYf6fzHVv6438LrnTPeE024VdN8fPS7oJew91DUqtGPBlBGF2myCf5Q 925G2k1zsq5V79oBZd8oxMq0Cyi49xjCn/J7HgkAw+3FgRNXJH6YrFMgmLPXtD/3PSpf rQFElQLh+kacyyj9NIfCf5ncrJ9/Hwvxb7G+P/3+Hd8S2LjGgCEvWl51ss4B3iy5bt8H 49Xzrf5akW1tvqPWAdJKvzf7PzDBMlvo339WbhMElRVQd7TkaeuHeUoQg6Tz1eNAWCZF wAcA== 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=Fe/KzvBli4+DT+q021rXbUAcleZsNqwpOUiAKLjvzrs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Z0KwDArMIdr0mqNG6eF67ChrCyc6N54/p3xKbMOuZMDoFeIaPQMinqA9wZK4pd03Mx lKr1UIgMSQcf/V9WJKlX6un5q4sff0FkFkaS1GITrOnA2VQazJgLtiltJkoBRyoiaPCD TmZF7I6R6sC353KikilLEZ15TqlPRJeBE9PpBI1u6Phvt96tT7VIpWOMtn9Ki+kGHubO dp3kngv3bbqIt5Z3PHjLD67bjJ+3iLKEEx6UzsSPtSeJfljl2umGKwfrHoo0RlQ8kiTw zOBp2xU9HPl9BBpBXmxeMyf6Zv3bHYjF6CEWLJQjzRUm2Cx37YbXe4UxtHV6hm5kXtOx DFxQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nmiR9B01; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd182337besi151527586d6.279.2024.12.24.12.17.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:17:48 -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=nmiR9B01; 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 ) id 1tQBDT-0006VK-63; Tue, 24 Dec 2024 15:09:19 -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 ) id 1tQBDI-0005zI-S9 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:09 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDH-0002ve-9I for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:08 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-21649a7bcdcso57377605ad.1 for ; Tue, 24 Dec 2024 12:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070945; x=1735675745; 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=Fe/KzvBli4+DT+q021rXbUAcleZsNqwpOUiAKLjvzrs=; b=nmiR9B01JES9/PXH1gp0bzCPqexq4Kqc1ov0Ga2iareRJm10owzOa7M01jDGTiIAUJ wdNuRMvzlBL86KwnXAh/cdXMWKJU+vNV+arGLORhIm3jgW0fSUE5TiqAMSptHwBcwqKz UVmZ9Mpq8seX6veRznmM+S5VAnvx84kTsPqg2GzRWbvCqR4mkFyHxjRR8CVkAuu7QhNc DvUfW39luu2Bp9oOC/Og66f8QpPxApfEyWuiRdSe0W8Hl/FGV1d+6kfSGlb3snYKU4Ui bwFOcimtr2tfnueKlA7kag7VFtcciocbG3nAfzgi7NVqWqLiep4MjB+d1EvJNjEhk535 k6gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070945; x=1735675745; 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=Fe/KzvBli4+DT+q021rXbUAcleZsNqwpOUiAKLjvzrs=; b=qTULClORO6zWn4Heo1fCopGCQu9fEQIh0L6tjCCgvVF6NxGOiuW64Sg+Fx+J1g1mvh M/qzdL9++r/2LPxBx76Qa6kZdlp9SiLwMrOgxqyseM4OCYgP5nEEufZoHsCnqPJf0cIv Yv1ee6BNHFD5PKnRX3AblhmqTti4YwQNLsQd1HGvmUCtQsA7TIA6ua3Mg32EYH5wN+QZ kBMcU9/nRhdfVvZdYPcRxXrCEBGYO18GQIFUfW+0c9P7z1OPGVTzGas94mOLinXn1l/B GZdQFVwLt1o8jXA7hsIuV2Ypn42a9w4oJi9niF1MQIdwxP9AL8t7/GHlwZOOBTHOl5fh 4vmg== X-Gm-Message-State: AOJu0YwqgNwYgRhRH4k0VYS5DcQICGGnmAcFE8S1J9a6GuF0ehJmLITa Mr+L31jBKxmRhyxQoo0jomdQhVoinoyXGXyIBT1PD304rHWvd6VIPrDA/+LCDGJsuBhl75AM9rY 4yro= X-Gm-Gg: ASbGnct+VSWrj3A47onc34eBenqX6QtAyX7c68m4nLsw38xnUIvGPHLvIRZo/+S+k9+ SGCGXb1FAkJHSJNeLt4rZjeUms9mCHCwidrSXtkKOlb5TJJ1dD8S+y7YS1T7XGzcH0l3nNgaJss 006bDujkkd9fHAPPHOU8lo8rVx1IoaJsTDpLSzB+HzCO99ugLkbYS7UT2Jv88RjTq6tzp6yAEs/ zC6ORHZh1B+Vmdl1Hei6V9Z5e9pHyQQRY4IOD7Aj5Ky456ArMa9wf84KhM1RO7tT2kU+5wq1y3J Jgvhrgw+inBLcK+M6ITcCnzT4A== X-Received: by 2002:a05:6a00:3910:b0:725:e37d:cd35 with SMTP id d2e1a72fcca58-72abe060d9fmr25548964b3a.18.1735070945450; Tue, 24 Dec 2024 12:09:05 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 45/72] tcg/optimize: Use finish_folding in fold_sub, fold_sub_vec Date: Tue, 24 Dec 2024 12:04:54 -0800 Message-ID: <20241224200521.310066-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 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 Duplicate fold_sub_vec into fold_sub instead of calling it, now that fold_sub_vec always returns true. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 26790f7c27..cd052a2dbf 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2620,12 +2620,15 @@ static bool fold_sub_vec(OptContext *ctx, TCGOp *op) fold_sub_to_neg(ctx, op)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_sub(OptContext *ctx, TCGOp *op) { - if (fold_const2(ctx, op) || fold_sub_vec(ctx, op)) { + if (fold_const2(ctx, op) || + fold_xx_to_i(ctx, op, 0) || + fold_xi_to_x(ctx, op, 0) || + fold_sub_to_neg(ctx, op)) { return true; } @@ -2637,7 +2640,7 @@ static bool fold_sub(OptContext *ctx, TCGOp *op) ? INDEX_op_add_i32 : INDEX_op_add_i64); op->args[2] = arg_new_constant(ctx, -val); } - return false; + return finish_folding(ctx, op); } static bool fold_sub2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853259 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4083704wrq; Tue, 24 Dec 2024 12:14:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUh09qagCYTxFvGjYpE3zo0BT28mMQwuQmjv9dk59EeX+HC/1t9vTcO/Y+nhUYIsw8KE3GyOg==@linaro.org X-Google-Smtp-Source: AGHT+IHtxSn157BJWRdOr7V+ksZV03xegF8fJ2DXhu9e3USHM8tfzXONvKWr/0wSEUNIuAhWHdlZ X-Received: by 2002:ac8:7d4a:0:b0:466:9861:3e9c with SMTP id d75a77b69052e-46a4a8e8230mr251120041cf.31.1735071269766; Tue, 24 Dec 2024 12:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071269; cv=none; d=google.com; s=arc-20240605; b=aLZuLisHtKaa0+MPNZumjRmTaTBSir3aT9C0x3BPKDEafPD7QbLCSor1VumBKpwIhT jULHad/16skoNPTpX6GXHx62/3qI0sEeORhJwE7mvyKXUudJE5wzFRxfNu7KM+mRaKmZ LXlWLRTVv8J+qQeo6T7QcmgJyt3qFK6ea9pH03roqwj3nDLRdCt/5XzgFeeyWfJOTcS9 pw5I6QvmIWKptyQUlX1X4ljyD0Y1R6Qb71C8+7k1Dw9quLQ9/kDd9iV9/WCUef+mYG/C QjFb43COLjiCL/nV+UuD6nrpUC2O7FWiXkiMIBrvkhM0reuf7/Oy8unoYe+5nS+T5txA vTow== 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=IaOVBhCtGffzz8f2KF+gUKNW0uB05LssizAuZqhSk0o=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Rhu0N0n99TxUXgvuL0a74nLbGUNhfmIBUPyR+JhEPnkrnpV9vt25tjYuBNJ3jkr/+q QXH4NoiwZbQou1XMUOu0Z9nEt1Vqx5vAedw5RwUaGtcmhv2L/iCnhf40Y/N1X5PjnpSX 0Ie80o1EP7S+Ho4FQJ7lBJ84PoZNvJtGeL5gXf3o9FYMaLRX5GP2B1erBXZ7du5sR2bs DHQbCdGP8LX7VX65fz8+7Hx90Xd7zoR5bzOFRwXeKyaoStn96dSQ+ypAXz3ASzCAgtOH G9nRzW5ziaUilTiYRN+gjXUlyncKP2GDNI/iaOag4Q5+4JCl1famV1EKtTOBDStweVAN Ue5Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m62Ut5Zm; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebc5e05si133222571cf.489.2024.12.24.12.14.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:14:29 -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=m62Ut5Zm; 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 ) id 1tQBDl-0008Hu-Jy; Tue, 24 Dec 2024 15:09:37 -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 ) id 1tQBDK-00060F-Q0 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:11 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDH-0002vi-Me for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:09 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21628b3fe7dso53767515ad.3 for ; Tue, 24 Dec 2024 12:09:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070946; x=1735675746; 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=IaOVBhCtGffzz8f2KF+gUKNW0uB05LssizAuZqhSk0o=; b=m62Ut5Zm/lKIFsfrNtU482mx2TIgy6DpzQLEUslYMRMwPZRi1J7BVNG+VTpQ2O3kbZ wF35q24jpWHBsq7hEPbnTlMExzMu51188r6Ew/BYxbhFG6r35BFgKbd4wvOFo8RtVUnH REANyzsxvEK5JoNsPUegl8jGl3veYEiw41wk1V5vr8AtqvdEqDnQxv7kdOFanMD6SMKm c9AreYPcUL7ZTcWTl2rln+b/wTpE0AKvE2ZTWIc+kKfcq7y5L3VHiThJfTXAe2iyX+Y/ 6PIzrhwQiqkeJdeiFuBA8a7IXOKBF8fwrq7WI3tWSdBeVB0UTJ8q9J83QDKGIX4nGt3+ Rkhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070946; x=1735675746; 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=IaOVBhCtGffzz8f2KF+gUKNW0uB05LssizAuZqhSk0o=; b=nuPlFw6u1SxaM8Zp6Ttu0JcuvXP0wRH67LfcUmgJs2uAFddXAaqp/dUWdaBsFxVnMP /G36radPjq1+lu6ablUiOzpxtFHQiRrCmTGrPpEqNcTcBfPxs8ddcP99AQBna6Q1GW58 XvH8MaxP4Z7q0s1iputw+/MGTQ+bFb61p9QIEH+XJgYluNGdptLRk58A04xRBaBwPTrC UV822Rl80uieJSiifbMreiOqV57b5I3GU7j/c6Kfxl55iA54Ej7d6tWoKi+ezvugsSkG /wUWKfRJ/hMxCLukLCIU9w5122CFR7nQzMP6s4xruQmNmN6F1bN2RgHGEH88ReuAQwk2 Ue/w== X-Gm-Message-State: AOJu0Ywadbz2OD2Csqd3obEI8giLRDV+isnaDoLvidtkD+zaqt87zDpc wlgCgxhNwV7q23C4aEBw/6BLtkIl0sctpyPqSop58fJrTBHsNNMEQJY3qQp+mir7cAbw21yO9US YwZs= X-Gm-Gg: ASbGncsqPgnYfUra8q9fQjO+CQ80xW0BwHbpRnpVjOPZGR3aflc9DCSnNy45DmP0Jci OyYpOSOY1rtmQMceBEmVF9HyRg5SYNZyiMPzUv5TeJ3EdBWPDPsIee5v1pIWFqdRLGzmbDE7Sxj Rcs2HvQ2KLkci9KMefacXrhNqQLWds0g0mKWwqtRThZ1I79bttVzqYnprvGBnvy5w1kC40Tpb84 TNibZsT5ggFqqWmlmWdbIWbFnMuk+2cfrzck92N3Kvwh7UQhmWJuM59jJZ/vrIJdeOIa0mRpINe +YEEwFzCPj7B0rAQbT7gztUQ6g== X-Received: by 2002:a05:6a20:a10b:b0:1d9:aa1:23e3 with SMTP id adf61e73a8af0-1e5e080c43fmr32208483637.32.1735070946442; Tue, 24 Dec 2024 12:09:06 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 46/72] tcg/optimize: Use fold_masks_zs in fold_tcg_ld Date: Tue, 24 Dec 2024 12:04:55 -0800 Message-ID: <20241224200521.310066-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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: 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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index cd052a2dbf..7141b18496 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2650,30 +2650,32 @@ static bool fold_sub2(OptContext *ctx, TCGOp *op) static bool fold_tcg_ld(OptContext *ctx, TCGOp *op) { + uint64_t z_mask = -1, s_mask = 0; + /* We can't do any folding with a load, but we can record bits. */ switch (op->opc) { CASE_OP_32_64(ld8s): - ctx->s_mask = MAKE_64BIT_MASK(8, 56); + s_mask = INT8_MIN; break; CASE_OP_32_64(ld8u): - ctx->z_mask = MAKE_64BIT_MASK(0, 8); + z_mask = MAKE_64BIT_MASK(0, 8); break; CASE_OP_32_64(ld16s): - ctx->s_mask = MAKE_64BIT_MASK(16, 48); + s_mask = INT16_MIN; break; CASE_OP_32_64(ld16u): - ctx->z_mask = MAKE_64BIT_MASK(0, 16); + z_mask = MAKE_64BIT_MASK(0, 16); break; case INDEX_op_ld32s_i64: - ctx->s_mask = MAKE_64BIT_MASK(32, 32); + s_mask = INT32_MIN; break; case INDEX_op_ld32u_i64: - ctx->z_mask = MAKE_64BIT_MASK(0, 32); + z_mask = MAKE_64BIT_MASK(0, 32); break; default: g_assert_not_reached(); } - return false; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_tcg_ld_memcopy(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853268 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084617wrq; Tue, 24 Dec 2024 12:17:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUQCxTTxlXBciAftpDlHLD8gjYg7fZ9n4QotfNuGqrcXgz1+cY0UHTazQ9mnOpUZuD3F+ow2A==@linaro.org X-Google-Smtp-Source: AGHT+IEDxyTLTRH6z82i8umzgH926fkU0w+KPq+y7g8u+EoJ4w0hiW4oA/F5NP/VObBRZQ9jllxl X-Received: by 2002:a05:622a:254:b0:467:5e61:c116 with SMTP id d75a77b69052e-46a4a8b7e6bmr276993501cf.7.1735071447715; Tue, 24 Dec 2024 12:17:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071447; cv=none; d=google.com; s=arc-20240605; b=Q2pqhnWZnYwj4SYEZiR57a8OJl0AOzSJtKoV64qe2otzQm/lhPT5PDLWWT7Ezxcunq AoysVtfb2Ra5vc0HGK9FYay+ZExJO6HAFqKA02+wnk78T+XgI9cNG5g0ejuwBR8auvLc jtXcnIxjcHgxPnW3uueCLFhjSzc1vwzmk5Qhjza6PlcgZJHr1eKgH47RWkIFmf5QKTom a6YtRj61mbiNTxDHwYVMP1lPQ5n9y5ugl50O+CrlJ9QXHS0dfY0RpzbJTn4lDkdsDQVU bLxz8tfDs1qdgwGLSNiLeZLIke7kYlZTkNpCEKgxbiiAtHVYT9khIXfE7AW/CoE7I3ha Qi3g== 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=CAh6al20AnnURobHcMKk7qN1tHMzvpICfK2iYSPIwVw=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=QG6RC0qvDVsilZX9FWHilPM3yPjponSPn1h0S13sJqI+55ieGzR2bOT2eFJFuHJ8nm nsOGFNXYPvXzcPfh28xzGg+7ZxIu2JpfX+78dvVQOJj7i4Kg/46V0Qt38cQl1iGcUdWM 54U3+V4gz3LrhZkneX9lbWyGxup5hLVKiBuZDI5lSYEGTQXHfByCO1Q5dV7b9jMWWFLR ZJaCQ3RMyrQnYogi/Y1NywM2ZqZTwZxO+LyqtUeyJkepcQfHjbTNirmOZcuuF83qXBRl qLb9CNW95XqwvZ0znup3CH+6fr8doBGRrKz8+k6N/+5UhJe77QU8TCP5CgZVxuBC6g+Y PaAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A6xGeMch; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebc080asi138795611cf.475.2024.12.24.12.17.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:17:27 -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=A6xGeMch; 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 ) id 1tQBDo-0000OB-UH; Tue, 24 Dec 2024 15:09:41 -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 ) id 1tQBDK-00060G-Pi for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:11 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDI-0002vr-QE for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:10 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2163dc5155fso55566205ad.0 for ; Tue, 24 Dec 2024 12:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070947; x=1735675747; 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=CAh6al20AnnURobHcMKk7qN1tHMzvpICfK2iYSPIwVw=; b=A6xGeMchkoYnkaP3ifdjKYDdSQJ1WLSWwdlKINO8iZS09ZWNwRLl5iT9gylIvLIkIc 0mdpYPDsh+Et7IZFpfs2N8Gg7ZCbIg1QSV8u36Y4GoWhuJA9ELgJHVfds4AzzOGhQKKh qf84drDNDU8P3Qd/V9Mqb6FrqCUz3lWrZ591vvfE60cAWOUTP9CAHRpglug0+KLUYiaR meUSjBmmAdlzjCKK6QF5c+45wA/ZaSXOMbWgWE5pKgcl145v7TA+Wu4CPEnp+b2Sy8TR k+Rgls0z5D4YM7LfIoXLIlaT5AageuGkrlaLY+o+M8TNags5SY0KtqH32gLQVuWXQX9n YLhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070947; x=1735675747; 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=CAh6al20AnnURobHcMKk7qN1tHMzvpICfK2iYSPIwVw=; b=UCJ5TCNHWVyJ0UoCbRyppkWzSVT1avtRTtDWfSoJhQ9wYFu7KXZJO7uTqH6XPEI+cH eSgcqqO3Vocy2jez3gGs0fdTgJoU03w0TSQk5Q+PSi+UK4u2ux28O8gf8M8n2h/yPpaV qy/aMDBqzjJPfSqFvK8P8RiwhyA5XWrEImVdiKsUibRpmlWp9n7nWXLIoEUbf79rY9tq 2pg1pQKg+2dHIV776zK2tW5MoKZ7lOHl5b1zoWh5g+Hp+dO+CFSA+9rK+xioroBOKQyC UBn5YzfsZyRWL1QOsqxtoVLniF5bBHlje2Qumoa6onJBRK99BZ7Zk9wNPysf+4kM5CQB UnfA== X-Gm-Message-State: AOJu0YxDnsxn8A2gfVpa9e7u3x3rmLLmeutDNnolSIegajmoy2mX/PRC AtUZB+jSseYBChVSzh6wfoF6odBCmussb5XN88z4LSdTjY7Qb5oa8fylrMF24yqknXSrUIU8dL3 m/R4= X-Gm-Gg: ASbGncukR7g5T5+/W57iFPMpUt8jCmLl7SOj1Y1rjl59Rs2oY/2wsjFWMoMoACsbbm2 gb9fsTyKlVYFOfnylDV83MgsvhUBVhjvCE2Odrx6Dgeu9n4OZ0PCN+AgWXv7xo4FCP2k5Ph1JbL 6lHJ/BzUiqkUXBeVCArQvN9lTAWngpVrg0+1yq0oPL9pr6Npm8BPSEShIyxmhmGv1x1wAZ7PrRM SoVJl1Q7UeNjnXqD1JdM1TI8GBQASRJooUeySIbnEIE4rfEg3xpP9PDIYZeYRqKtmJBPDk/oiRR CbMHf/HjzO48cp40QeBXhMWW4Q== X-Received: by 2002:a05:6a20:c705:b0:1e0:f495:1bd9 with SMTP id adf61e73a8af0-1e5e04503e8mr31192399637.8.1735070947527; Tue, 24 Dec 2024 12:09:07 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 47/72] tcg/optimize: Use finish_folding in fold_tcg_ld_memcopy Date: Tue, 24 Dec 2024 12:04:56 -0800 Message-ID: <20241224200521.310066-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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: 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7141b18496..047cb5a1ee 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2685,7 +2685,7 @@ static bool fold_tcg_ld_memcopy(OptContext *ctx, TCGOp *op) TCGType type; if (op->args[1] != tcgv_ptr_arg(tcg_env)) { - return false; + return finish_folding(ctx, op); } type = ctx->type; From patchwork Tue Dec 24 20:04:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853247 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082426wrq; Tue, 24 Dec 2024 12:10:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV9apyeFpV18HcyVdF86EocXfO4dwlO2X8JMMPO4Mshzt+CteKzrAE2MTFb38lmb3NgkY0dcg==@linaro.org X-Google-Smtp-Source: AGHT+IFS17Q9qUcU6834S2z1MUH8l5yFIGqwQMkrtDVDHLayKvjZpvqYCI+jXeffyARD9lH0dCoj X-Received: by 2002:a05:6214:4188:b0:6d8:9002:bdd4 with SMTP id 6a1803df08f44-6dd23358724mr275432576d6.28.1735071015906; Tue, 24 Dec 2024 12:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071015; cv=none; d=google.com; s=arc-20240605; b=LWfbRGR2iSTXj8gJqFh9zj3UVJOsB6JniOSzF13G4iNVYwwYBS+4wLiPzmefZg60Lw IrGlkmILTKtJwuBoFUXGA0QvrEVI+XhzZrjWZyhFyxMxsrcq00jIEslr0citTbtg8qjl zKwpwE/cDx1lIS5NKCQni72Ja7s9Ai9wY0Kj9GH5juCkXQr53dDOjiiPHoQuLGh/OH31 vR+YOye5ZhnCS67rI6IkRwZyoexsJuY0KbHSBFI+CW15bX/TJar83rp8DlOs9gHoV26b sNBsdH+wrrhb7Aw9TLEOLPUXy23/cjCL5qa3xQc7eD89O7lV/l1cPeY/hFsCm1wUm27w BtGg== 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=o97JXDzIrwrMdvgcbM1yV2U/pc+QtaOODWU42ZGI8Z4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Nl4XG3ZPEohvWetpVAXzfYx1fIukzQfcDfFlYQB7LQ+2fIjuK4yEwe4Co8GcK9Ufqy JxLAJQVCxogLx+oJVk3I45tz7Ncaa8TFGIaejstlI/wRo29EGSJwY80pidD8KrlYSQxC 52kydFfkOlq+2FKm4YhZU+uL4w4CMkAGS0WLR9jChwxdyqLVv/v5CBGJXasRd568XpDw pTU9cSlDOL8IVvRkveENDQYtr59VCT3KLTQi1kQQP5B2krFv2YWEHhJep8K92WWN25OM sjF/geINxyhI2WKP3kY7sRKGwkhGQyk8HFuQzNAOWFrsRCtwU85lt73iQgmtNefNVHRm E/Wg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X1pJnsc9; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e680e19si139383981cf.3.2024.12.24.12.10.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:15 -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=X1pJnsc9; 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 ) id 1tQBDa-00073O-6Y; Tue, 24 Dec 2024 15:09:26 -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 ) id 1tQBDM-00063Q-1J for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:12 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDK-0002wA-BY for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:11 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-216281bc30fso65762265ad.0 for ; Tue, 24 Dec 2024 12:09:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070948; x=1735675748; 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=o97JXDzIrwrMdvgcbM1yV2U/pc+QtaOODWU42ZGI8Z4=; b=X1pJnsc9MweBqFLdkApwORk3nA64ycsiEmkDIbBjiLN8gsD9uQHta5UhVazs2iZhc3 DHmo3haQqmEdT9e1WKSCn/cuiDmG+r27owRSp/8ZoHRRYpv9+/V4aOT2EtFP9E9kZqk4 QArJJMR/kgoz78lteyXTyiepdDsZY4uYwkG3aOllO5wZQvr33kmAIKpjqXKnZcx37TQm fkuYsybDJVkYturOqRpQMkTqzCEaj6zzjBU+ugWp9j0SWnc5JIqZZbqSFT8Vq6Cdf5yO YhTZJd3IRNXv7WuBrITo8u/KlwX5z83PS5VjsatC0i09Bj2AaZLRaH3AxOMX164q2AT1 m1OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070948; x=1735675748; 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=o97JXDzIrwrMdvgcbM1yV2U/pc+QtaOODWU42ZGI8Z4=; b=avdvZI6ND1LBpW0N9F0CCAf2zX9Rt/E+80zfcYUIVCa8IVjAFtDanB4iGC5SVDm66R UoJ4FxZl6+dZo02bNDMWNlsaxpfNeq3hKKyS045ZxNGYJ92UNWWo3Gyzec8QMPJRlca0 dShqEIEheAz2y8UHNLcBiFcBIwA41jDu1f3z5kZthZAaUSuE03FvBAnV41UsPC0S84G0 YnKQC8o8aSODqWCIWvCGh/I8BhhcJdCMA/5XcBD8c/BZUExe8sjxvSiRgvWBL92/3CJq bYes/bH+1ht9+Va4ZYi1YU3EQUCGwQ7dHc5bmwBQk81685bzJgJLd8xFjM4sPvpYE2f4 L82Q== X-Gm-Message-State: AOJu0YxWCt7CoUl/66Dk+9iXgWrGOwvNHY9qokNQnAJhCC+Eicks79uw 7aYaXWQchanmJ5Xir5w0Y3eZLyTSelgi0H9wF1xonsVUWYFRwnkRivZT4SV77D3Iq2kiaUhXK/B Hv2E= X-Gm-Gg: ASbGncvEhSJ3VOv/fMTB/Aoti+2ti46674SauEGWAuPOV6GTKH9rpbhUV2UQVVAIccf dqBcfIOwBS5xqfRXGSpyP3WpWPSvrIBD59ZSnlaq3hII930D1cTd/Cv391RZina0NJgtznfg7EA NSV58k2EzF2Vl3wKgWS7Vj/gDwLucyvZ7rHY7es4kr61dwkKmy0RN0yjecz3eB5JV0xiQnCMpb6 0cZs3TJZW4EjfrzRlXXnoxPbn11eCVnmB4yGRmkz9L1H9+TvAVsLnVGxKkha0BfqeTM9zj1zA+4 YH6KRXvgXBkhlEh08TSsWp8fxQ== X-Received: by 2002:a05:6a20:1596:b0:1db:e0d7:675c with SMTP id adf61e73a8af0-1e5e045a0b9mr30625360637.13.1735070948607; Tue, 24 Dec 2024 12:09:08 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 48/72] tcg/optimize: Use fold_masks_zs in fold_xor Date: Tue, 24 Dec 2024 12:04:57 -0800 Message-ID: <20241224200521.310066-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 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 Avoid the use of the OptContext slots. Find TempOptInfo once. Remove fold_masks as the function becomes unused. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 047cb5a1ee..d543266b8d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1077,11 +1077,6 @@ static bool fold_masks_s(OptContext *ctx, TCGOp *op, uint64_t s_mask) return fold_masks_zs(ctx, op, -1, s_mask); } -static bool fold_masks(OptContext *ctx, TCGOp *op) -{ - return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); -} - /* * An "affected" mask bit is 0 if and only if the result is identical * to the first input. Thus if the entire mask is 0, the operation @@ -2769,6 +2764,9 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) static bool fold_xor(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *t1, *t2; + if (fold_const2_commutative(ctx, op) || fold_xx_to_i(ctx, op, 0) || fold_xi_to_x(ctx, op, 0) || @@ -2776,11 +2774,11 @@ static bool fold_xor(OptContext *ctx, TCGOp *op) return true; } - ctx->z_mask = arg_info(op->args[1])->z_mask - | arg_info(op->args[2])->z_mask; - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z_mask = t1->z_mask | t2->z_mask; + s_mask = t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 24 20:04:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853269 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084629wrq; Tue, 24 Dec 2024 12:17:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU4sDPHmoysE32oR94dmy3SNDxAJ7AeCKlQ+hNPR9yWqs4/PU3zwTW9gvPx15E6ckwEMAZBsQ==@linaro.org X-Google-Smtp-Source: AGHT+IEttlPw2+m+BgcnND+qg1JXuHHgMuNGZdNCoEU0tCqRAlgYgQs9nbMTPpcutKOX6l6Rvssz X-Received: by 2002:a05:620a:2449:b0:7b6:f31a:7804 with SMTP id af79cd13be357-7b9ba716d84mr2751722785a.9.1735071448481; Tue, 24 Dec 2024 12:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071448; cv=none; d=google.com; s=arc-20240605; b=hjrJu2EkSvvLDep/ln2K/AYPJ4OkFswRToUmwLMh82IR9/1iFjLfq1gKxIbBOtnAmj 6OeK2BtYUD0meAE7UhrNOo1dScPPkj56d0w0YHqBvPtCg6Z5NSofiYrgtsmdd1wfXZu0 52LwDZZ45AEzNnh1a3esbnEEJutZys6Mr2Lq3NcutOHrSim34mZ7KrNAffVrP8SdGXtc 44RZwGSKcRjheOe39NkPgtjZ4OuU922rREQQnJAcRho80GoQpF1kpiB0PQIdsveQb9oo 1HcaSt+Qhgx9yYR4rtVutBF8LIALv/QZv8W03m3MDhUCWwdA6+tLKmVYQlWXJBNVN7J7 W2CQ== 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=6T4dE7mQpDnGfqvX4E7RoeAOsu5gIGr+d/C7xqfvwqU=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=FMZBzSDZ0Q/RgDVbnDMaqbL5zya51cU5RvEEuSVxDFRD4LolThozQt65WWt+jy+pUb h/WX8WcB8Re6COJ0V70CZNUQiGspDa+vD0silG47n2SrIl8kwM98M8IbNG8fhAlN4YJL X0fMJtnyL8nKcjNyaw3QNWxE/H36p+hcLz7E8bzMHT8QN/lXXGTB0sL8Eiw315FAJwZ3 0X796YOx2BMPO1+pZyMkHHA38uHlf7LXZyu07zgXIt6GpwWe9eKYCvcna0j9FyPHDzuy d9ckj/iDyXdc33eeq6UXVoEs1n5mt9ClvvBfPeGN7MrZAct4eMVlg957KTU2ZhOk4H+C z0jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WA7r/kv9"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac564645si1386197285a.696.2024.12.24.12.17.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:17:28 -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="WA7r/kv9"; 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 ) id 1tQBDp-0000OY-EI; Tue, 24 Dec 2024 15:09:41 -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 ) id 1tQBDM-00063m-Cb for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:12 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDK-0002wJ-Vh for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:12 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-216728b1836so49418655ad.0 for ; Tue, 24 Dec 2024 12:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070949; x=1735675749; 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=6T4dE7mQpDnGfqvX4E7RoeAOsu5gIGr+d/C7xqfvwqU=; b=WA7r/kv98jIqIyrR0lXubhAKkPAptY1YtU+ANHVSfUkbfXmqOBa5VojI/oiJ/DvMZy IBjxxnobd3enwmxfKkmbmiBzCEvhMplm4FKdeSKi2mUwqIQjJhqN7CCbFEOsmQ6Gz5Ne D+avwK21PUl2m6DMpjFkbk8HMpId4DChfQdSoKTvnFYsEIpzdO6d3Ydla9W1AUwUA6F0 /Oz9l+GLuXXF9kB7WtF1E+8/bhJqsL9OIzvl/vzcqmN7QwuO1OgeZlvwKGBMrSbov66V swHkLOUZdDB+ObtZvbPgxZpXSra4zipIw0mZ3/vbrnRbklU7h2ds8RmFdMOkUsk7m2XX o+Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070949; x=1735675749; 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=6T4dE7mQpDnGfqvX4E7RoeAOsu5gIGr+d/C7xqfvwqU=; b=pEcXuhoc2luTkCe8jy8GwmqTospgCbzMP9RXhRvgVfs7pY7iOKKwdQTs5H9v/k6LLr UT/L0zatTOt8K3GOi/QWJ/mSbYag6YF+K4c4T0myA9GpBZ8DQMZyClAtucctCzJx+Mym stgbL3au8mP41Ah/QXUzyFft0e1Tm+S88sW2ESVR205oT3FWQPsWHtkLiMMec8JDp2/Z /Cun2TogbhuN3+rAB5ZHHFPCXMWO7uWpTn7c+u3a4Wr5XgAybOYaU7TLcU8jjNo0BeUz KfP0f/YiLJEjNlO0Rw+D7OShviHMzgy6lLFdc+Vuyo1GqXjEXe1qqlJ1U+e6l0RDOZQv kk8Q== X-Gm-Message-State: AOJu0YwD0bu2TpECMifLO09umwZC51xgLRGpPfJU6vUs66P+wUd8EryH YPWtVLdazIqddrEt9YIQaiLD59OrP2J2PqqHfplk7oAbXGe6eYDeQx5QTbDE/RXtVFwffjnkDa2 95B4= X-Gm-Gg: ASbGncvdZXjgj0Q0McSmHUILILseZquzdffgZWk73sLG+Dq2ddyfmpQO/ofnyC/Dqrw uZ0imfmKfN1+7ufapNrbXeGeV+hgxEI28con0JaUtOs5jouNG7DzdxLuLkUm8qa4AodyzZ71q8A O/DMMAVPpWTh7fgas9WgtmJsXelVoUPTHIHobJ2R6EbQWFqIum+93+1kdNlEL8LVwYjw1yIgixt b5hT2QVxpp794F+EoOxa6rNjbSqm9XcIFYEuN1Hg7IMsoqtBb86fvuLK5dlqquH88QfsisTrP2c OJTQril4LWYmFPZM+LuVheUWWg== X-Received: by 2002:a05:6a00:1144:b0:729:597:4f97 with SMTP id d2e1a72fcca58-72abde828c1mr28376953b3a.20.1735070949616; Tue, 24 Dec 2024 12:09:09 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 49/72] tcg/optimize: Use finish_folding in fold_bitsel_vec Date: Tue, 24 Dec 2024 12:04:58 -0800 Message-ID: <20241224200521.310066-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-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.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 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index d543266b8d..4271d14d2c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2833,7 +2833,7 @@ static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) return fold_orc(ctx, op); } } - return false; + return finish_folding(ctx, op); } /* Propagate constants and copies, fold constant expressions. */ From patchwork Tue Dec 24 20:04:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853277 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4085020wrq; Tue, 24 Dec 2024 12:18:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXgtNdRgC500jErzs9IsE7aUDT69xLsqsGCFuv5tAS4hR9hRpNFmagzjkepJyt1s2fjnsxfYg==@linaro.org X-Google-Smtp-Source: AGHT+IHOsM4jIS7u6vBwBczrGaeU190aemu0RKBt0jnR+f3JbKsjnNFR0hHASu9D/h21WYTgD4ep X-Received: by 2002:a05:6214:2b0e:b0:6d8:e641:da29 with SMTP id 6a1803df08f44-6dd2331f4e2mr294384286d6.6.1735071534620; Tue, 24 Dec 2024 12:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071534; cv=none; d=google.com; s=arc-20240605; b=O1r8RJP9j7LJbLEXFjeDU5wB6yP9/pQJvGLyxLtiGI/At2Wh6VV+hbmkhx1xY4fygJ RGTEHXlUPqMHNHdeQ9eKf+A/8CbuEkBgMdUPjCT0OVCeCvHpo8wGu8XUg6obPs3ztvHq NF4jgHfhM2/15Ad+9gLa/lVKOGI9BjeonipArow1pgXn9iGTK6JhhpqdEmsN5Dk20/JU 0/yMghHusqeeTMfL9TIv0z6wNt7S2uhVdiCe4S/qSu+AFtBq6DWhEUsQ2XzeEM9kiBuj FMfz4Ra3QNTF8v16lMUAXwwLyGnVEGrPfJ3LFxHugN+T86dP85+dPGxxXuC+Swgan9Ke 0Z3Q== 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=NoS6fF+zYBIciWuFVqUakribBmIpxW8sJFwdLDnjnLM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=heMlxIKxIOr4OWC1/e/VZ0o2SBpf30sl2GMksFN+JNs+tYlK11ShL6DstP1uyo6xHJ E8zhr6FfSlJjWS5vwNEJeM9ShPcptlJYtMyl5uTaFqOVNOTfelLH5bTHKUhqtlzWv5hZ S9v6XrEccNG8sNOteAdOnBHxHyW1bEzdlh0mFiQ3g4YDiUkPd7MoEnrJXtQWlY/UyVdc cQpdiOSdj3Skxq3A1MPvnXS+XbBQaKLwacKC22YV3+5ykmEHqHHJtZeNnz3CB4gNGYHH e1eqYjqrMsqrazkuJ7wkQxY+nO5l1KBPZm2lw+oC6p9ardgBauLV55ysRcg1K+xv9M9B TcEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hHDaFsZn; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd18101f05si138202636d6.111.2024.12.24.12.18.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:54 -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=hHDaFsZn; 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 ) id 1tQBDd-0007Na-Pp; Tue, 24 Dec 2024 15:09:29 -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 ) id 1tQBDN-00065t-7t for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:14 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDL-0002wW-Ob for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:13 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-21644e6140cso59073775ad.1 for ; Tue, 24 Dec 2024 12:09:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070950; x=1735675750; 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=NoS6fF+zYBIciWuFVqUakribBmIpxW8sJFwdLDnjnLM=; b=hHDaFsZnSIG3RwsIImP/mb1KE6Go6dQQQBvAbbVj9QN7HHrv/ssXPHX8lrltBZgwVg p6t6dxPvYYcLGnsrKGco4D4OlQUAdt3zSMysC2yo+9PjuCYU/azYxNjEMfGUhaF/gJtn /xe4jq7/7KOaKvSy0uVLJ8RsBuQQOvwnmMGPtedkcqYgjt+YplQwfjV5+KC0GNAvgm4Z J9Ky+rSV89HWTdoJaNf7lor0XkklFRYNuS72XYHDPAVfHVC2ku//YxpUFbCcWWr1oF4u Nl9yWIpfJxSnK+7idTfsWUkA3Kfo9PqNRGPj/qjowkN+uSdByrw1q4u/Nc/tITiepYqM cBjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070950; x=1735675750; 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=NoS6fF+zYBIciWuFVqUakribBmIpxW8sJFwdLDnjnLM=; b=EclfKCQXv7D3nA8e8XB4tLukVei4IDvxL86geXOazMpqldHNaCSaKLS3ws/ldPiYII D/xF1cDizFFf2A2NVIyE7b5I9VjFgkqlEz4amEyk+IVI8IkN4AAiPeU/htswthnVr/BP VK9KvAB8HIyaBzGYHLi+Lmb9FdEy/audteJdo0vzfS2VfV7Pvp1aZb38HztbMkbpSFb9 OthFy7Dj7tquaJVpZN1MWXIadwdrha9IqAzbJygszYkofSjxPuzX42dxzTVsrXJCu1BS IUpcFFnAOHtZPSPt6nnF0VDZD/FBSI2LDZomehynIdynnlIcFuheyAliC5Y6srfp15AC a+qA== X-Gm-Message-State: AOJu0YwM+3zT00MM5ixtXRnU8u/clpDynJxoy/3W4v+yHDgJr6/L9No+ qHVCiNlrBH1M48C45/oogG/JvHqx7fFMsfrB0F+LqGx39kdi+xxvzR5p9vzEMQ8qWeK/6KFarwf 7KkY= X-Gm-Gg: ASbGncs0nIe/hJl8WmO/qIvRUC0hP6Tb2pYpXwA/JRnVB23VhbCFJ84CV690/nM8pRX /v3SuV2JIxRszs0V5GJ6Qw0JWAQqCRfSM7i1qKKDph6UUwedV4aELGrN4K8L9ols3qTRN9DmCXk Zx4iVObdthE1PM372CvvakHZer50cYES+0Xh1ypTWzkcuzURtEtTTEjgQgLLqq5CIZyuDrQN/Xz TSVmVzwkD51e7W1llc3QUGm35H8K5WagqkpK36cm64XSAPjBljMbF+MBvmUQD0Pb671HMtVCdFr UhsOegc9AvL4qCCKTIi/kDYxaQ== X-Received: by 2002:a05:6a20:9185:b0:1e5:7db5:d6e7 with SMTP id adf61e73a8af0-1e5e083f019mr35018185637.46.1735070950563; Tue, 24 Dec 2024 12:09:10 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 50/72] tcg/optimize: Use finish_folding as default in tcg_optimize Date: Tue, 24 Dec 2024 12:04:59 -0800 Message-ID: <20241224200521.310066-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 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 All non-default cases now finish folding within each function. Do the same with the default case and assert it is done after. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4271d14d2c..51cfcb15d2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -3096,11 +3096,9 @@ void tcg_optimize(TCGContext *s) done = true; break; default: + done = finish_folding(&ctx, op); break; } - - if (!done) { - finish_folding(&ctx, op); - } + tcg_debug_assert(done); } } From patchwork Tue Dec 24 20:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853271 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084854wrq; Tue, 24 Dec 2024 12:18:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX/jtdbhNLKCveuQzp445N50myeMqhQu4LjOU63EwIOYEc2EG8/xM6QGaOxheUohVN7ugLnqQ==@linaro.org X-Google-Smtp-Source: AGHT+IEqvFqf5MlmJJ5sjQSjcFvGIjlzqqoMuPfASwrVEJe2SMGVYTW0WPoPFAkyinFyR0HWRtw8 X-Received: by 2002:a05:620a:459f:b0:7b6:d799:1f83 with SMTP id af79cd13be357-7b9bac05b06mr2820892785a.3.1735071499035; Tue, 24 Dec 2024 12:18:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071499; cv=none; d=google.com; s=arc-20240605; b=a8D9sPwWwf6W0y0UJamcqI27hgsemeufhK4/2/nu97puR+ZCLlWGX/Hqz1gcCYHKf+ LkOF3792LOmqRy0eXzJOOaa3knKfucxUXKzk0XFJRKGeEELDgg60lBzkuwr7ABrbQi0P XvHW0ZXCqkbIXtfZiUSmc/qfAFdDpNoYCyTjBEYwVzYuxfBhq0aJQPIAK7by7rPvruey nqf2ToN7SO/tIGh8OUM+Kn4Nes8W7YHZeMToShwFghXksXG+/LbFoVOEdcWOrTFmOLBL x3eipyR9umlp5lFRlFC3aj1RsZRuHWOzOCQrqGB5qSwE9alz6UgNOUhBJ+kG1gSPmuyn er3Q== 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=+fPgLDQ23uWllVbCL/m78hDFOj9j1qZde0rBMxog4xg=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=GmVeCt0/Pt+2AV8nSHXaK7l9ZsGDU8JyzpTO62GpV/qh7YtwSJjs7ZIBGtA/dH5dk6 4U7v9HJia99f8WkGq4KSqmnGw7tZins7/7zaUOcXszeoSGuThnf/elbB/4B2iJPTOh87 zhvizDy1YEDFhmuYh6vGL+ey7ioQ43QXYEJeGIpmKzzc2C8OY0KIMOsAXPbvm7NZY2BI rZ+UjWTG/zSLAsRyEdQyXqGVphGjSVG+f76Fn5OhT8C8O80ldaJHTsSZvWkpZ+r+NoJu AhgLT0AxE2TuycO3SITblVlkVu7SLl3oqXKkAsD7/Kf6EfVtaCk4qsfEpkKS8b3PM4uI VQZw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eVZOz8ay; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac47a66csi1393323485a.294.2024.12.24.12.18.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:19 -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=eVZOz8ay; 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 ) id 1tQBE1-00025n-V5; Tue, 24 Dec 2024 15:09:54 -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 ) id 1tQBDO-00068D-EL for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:14 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDM-0002wl-Pu for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:14 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2162c0f6a39so64890985ad.0 for ; Tue, 24 Dec 2024 12:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070951; x=1735675751; 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=+fPgLDQ23uWllVbCL/m78hDFOj9j1qZde0rBMxog4xg=; b=eVZOz8ayP3P+S9SGhNNn3g92F7bj3Awi/rm6h3036jvWdl5UBZ4hes7bQ/gZdBNopN 4kxnl41VbW3mDn29LF4nOHe8qeft6d/HAzkfq97gZGq8yK6x7WNQhC1uzPZ3L+VqUYYC zOSiYe3VqZVopViJKzhdEo0NQaMdHJuXKpZ66+BlmYsy7QiJMeHBNyHvredF5BBgQnol q7i0Suk2qVK2Et9MNJjS5FPU4zvgJ1EDOFm0vTz4Pq9Ky24A7r7UnMKt1jbqxFUWBmNn OcP3x03Ca2Qw7eEvVxN+jbrO33/bSacyB2n1XVFK7zMcx/QFzD8tRjDAFAnjaByrJQPR 1MAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070951; x=1735675751; 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=+fPgLDQ23uWllVbCL/m78hDFOj9j1qZde0rBMxog4xg=; b=td7vfqMZmydzk4GyatNpljtMiNtRIW/4n4/lPnjIJqYCPqUWFtHge+QuhXgDrmNCHb K6t1RTU5B31SF4TsAwHwXrj17jVVAapuWv81mJoxQhFLWmxr4OjYgPms3pV/nMk7kbYE s2uBeEPKqls+EFt+ubUGKnIQnA4SkSiLb4QoumgGhqZFrrT8rzxooudn3RA/ypatO7Vi 9i0bji50Y2Cmkg0/XRyx8t2+kBvxQAg+K/giRXr+ZFduF87xz1liCtj82yFQAwImawEp LuZ11viiubDiJ0gu1rPnZR1lmVuIYp7xU+PsVuxIzxxfPP2YRjLZmDZ47b5O3hGU9PHN iSYA== X-Gm-Message-State: AOJu0Yx8SqcqmnML3950GiOWyiyh8AYewjZzjWtiYxhwfBUYTkegLrqU Ub63Lc4PdQGuMYPVPZVBe+pXrlbMJoORt9n5lGEsgJ8Sx7jINPgcTeDC4TXpzdPFz99HgSWXNuC HsmU= X-Gm-Gg: ASbGncsy6ACh9u3Y4p6E02CgkYujc5obh3SjAoJOA+0Kv1ZY7MXGFnEcoAi3ZAQAnSr BfMjDn1nmEeZq1JJzyX6jsYHMBQKtl9AAAVdLb+ZODtCST9DAR+yospgsr83z+pwPTUIyuc1B50 qEgaQBDpaTPeIhcASm8MuiZXZUnuxQ2DG3BceaYbWwmBBJV0ER6PuQUIwIUKCeTlKg0cxtyknPZ JEbnK/FxCLmkjUOMVXG3SAy73jjSvjc/k+5gLvzCnN9qm+oedsMwRbtCtn1GrJ3kGNSqbuEUkGC rj5gCSjKzyUN9xAKDBQlp/c0iQ== X-Received: by 2002:aa7:88cc:0:b0:72a:a9d9:55ff with SMTP id d2e1a72fcca58-72abdb0170bmr25230924b3a.0.1735070951532; Tue, 24 Dec 2024 12:09:11 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 51/72] tcg/optimize: Remove z_mask, s_mask from OptContext Date: Tue, 24 Dec 2024 12:05:00 -0800 Message-ID: <20241224200521.310066-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 All mask setting is now done with parameters via fold_masks_*. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 51cfcb15d2..98b41975af 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -64,8 +64,6 @@ typedef struct OptContext { QSIMPLEQ_HEAD(, MemCopyInfo) mem_free; /* In flight values from optimization. */ - uint64_t z_mask; /* mask bit is 0 iff value bit is 0 */ - uint64_t s_mask; /* mask bit is 1 if value bit matches msb */ TCGType type; } OptContext; @@ -961,13 +959,6 @@ static bool finish_folding(OptContext *ctx, TCGOp *op) for (i = 0; i < nb_oargs; i++) { TCGTemp *ts = arg_temp(op->args[i]); reset_ts(ctx, ts); - /* - * Save the corresponding known-zero/sign bits mask for the - * first output argument (only one supported so far). - */ - if (i == 0) { - ts_info(ts)->z_mask = ctx->z_mask; - } } return true; } @@ -2879,10 +2870,6 @@ void tcg_optimize(TCGContext *s) ctx.type = TCG_TYPE_I32; } - /* Assume all bits affected, no bits known zero, no sign reps. */ - ctx.z_mask = -1; - ctx.s_mask = 0; - /* * Process each opcode. * Sorted alphabetically by opcode as much as possible. From patchwork Tue Dec 24 20:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853265 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084606wrq; Tue, 24 Dec 2024 12:17:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX9ohF2Rnn3UoTSS6tUK40OGQ0s7ud9Qn3WUsvojWw4zRoX8Gr54wbMrP+KW2NkXEB9cjSfIg==@linaro.org X-Google-Smtp-Source: AGHT+IFDruCJUEsLsqEeYkPfi/TZizuskIK792bU8j+KtrocMjmdaJPeJyKisupudMo2W+zA1y4L X-Received: by 2002:a05:622a:347:b0:467:7eaa:c023 with SMTP id d75a77b69052e-46a4a9a4257mr280081161cf.53.1735071446189; Tue, 24 Dec 2024 12:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071446; cv=none; d=google.com; s=arc-20240605; b=K8EKwb/kYMMsJZ8ilHytDdZIAWoFAd0+ROGznPaLgzuEk8Z+2UmdTSa5BWvsjTyWZc FVslvIV6UQ8/3neDk5xyTwMfF2dsmxDdaSw6ZF6k+n2iUiyl6vpjy3ZUvQLNItYa34ln qc9+PC3oxoZPp1qEWtdwNkDqRwiEeNq9ipn9TehoIPx88aTIkp7XJlYt36E+OtOIZcwG IUI1eei09OX3E4iqmffzyyMz5S96XSW2k9qo9FHDVs3fdw/JoWW7f54WNPfRi01eIXxD WV3q+cnE/rMrPtmYENCgC/2v6OkWCkBedq6oDcU1SonQgg2DBUIs7s2c54D0eggA++CM c2IQ== 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=sDeZA2lUoCCt2kMhRmtoiUVX1sDRebW38v5tmQ0pqH4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=k4du/+NS6pLZPfiYv8+MS8myzDf4yedIAJw6y9aojPsSCUwiV8FbTrdezRCzvAylq4 /I41+Xbj4rWUlMuqDWemS5mAXJ+At4cpBeyuJAcM6PHYnMQNXY9bsZUa3cKF4DTZKW/L vGZ3cRclnXJkS4jHfIxswqpNsw1SUWwsoyjCIj/ps8c7MyxweJb/mUKYqnINYNjL2IO2 YaKZCw5GEb3rvTfa03bsM9qbSp6t2HyPqGgm9MFPbDkrERxKpwnE4GfmqMuAgyeD6wxV 1Cw4xGB85TRcyjRUmnrgUeED17/zLgUAMBrBRlmBASH2V8xYUybkIyTU8Sq7aPkIoqov ErlA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yUnhNVkM; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4791a0si1421998485a.238.2024.12.24.12.17.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:17:26 -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=yUnhNVkM; 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 ) id 1tQBE4-0002Up-NR; Tue, 24 Dec 2024 15:09:57 -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 ) id 1tQBDP-00069m-52 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:16 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDN-0002ww-IM for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:14 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21669fd5c7cso57808145ad.3 for ; Tue, 24 Dec 2024 12:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070952; x=1735675752; 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=sDeZA2lUoCCt2kMhRmtoiUVX1sDRebW38v5tmQ0pqH4=; b=yUnhNVkMCtSbF/42gO4KO70hOaVmjk4EF9oSuSjJgod+W9n9Sta4kjRGFt0LOFeWXf eY39VBCmLi2ue/Q7JR9JI+Qh/ZTIUMxZOLdsmij39XKhrCDiBmA4b7bOrPJvdQE72cZa z6c2x91PkJ55JrFT+ZqIPoZxbsak8PtFvar8Q3r2ZE0jx5LiuT4Az8Q2z2wCFii5MAEi FREQycjyW2RaImUOKP5Jo6RoCE12DmBZhWpTnVJ8m2OIkYDF1oL/2MUYlzKp1+3g7NVm Ww0ATmP8Y8IXTwYsDrEIjUm7z83Jepzpri9BHryP48FbGdHiijHgea0qGt4Bw5BjrJAF LmMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070952; x=1735675752; 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=sDeZA2lUoCCt2kMhRmtoiUVX1sDRebW38v5tmQ0pqH4=; b=s1vbhp1kIwuaT/9lis1HUQrQm8mp8gIyICWkhXtH+21NSabcruamvQWwIQG7gmFCOW lXbBsW+LVj8+5057CdLn5nNu11+DbgSMtrkx1uThd7WfpeweAM5qxUyhODE6cV//imKg puBMuWCXkeGsc2WHti6aGg9V5pAazw0Ch3i4B2J7EnPi7zztE1CtUgJATaSfFgm5xVmY qy0iWMKKmSE+BKgfCkCM9/SUTFkZ+EkQC6/xES7i4qyGGEpb90MFqlm2NAbTCqElLuI8 UbUAN7HQZMD5Jdwmex9H+nv2ryAwZOv3OqDChZDFNNj3lGvOqjRkx2AoJGSaVOyepplG tc4A== X-Gm-Message-State: AOJu0YyKIv3r51rgHqmz/L+VvOTKBCtRQCI16svBr72h+JpioUXqJF1s UCwuBTqEddtkgDLych+Y8BT925pejn8/0ecxPeOrz32vRNZqUUSBoHJVQchmQZ3SZuEoMxI+iK7 Ash0= X-Gm-Gg: ASbGnctx+N1gTCui2xTRQ3mnx93CtUFJMceHFgt8zpcnCctQEekTfV2wLmeWL964M6p sQoYBFmjWkCSkPYnz+tXgh6mlL5JIvtebWO+/e1FYOv4shaZ0x8RGCsjUcinOIqWYfVk+No0F+S ++x9sbyiAUjd+LlIHnZGMTykoxvvAvBxjaWzGAUsRJz02xYyfnf8wgNm6DRWrG48UJ5BBK+zfk3 FGUv/MZe02Xzbz19Fr4Cdkg5NpXvwzDYqiAZhXsGmr+8pHZwbA/CkKZEFjH6W89UIvL1e0Gdfb+ 1vxZzjZG4c54C8Vw5b1uHEf7iQ== X-Received: by 2002:a05:6a20:e68b:b0:1d9:2b51:3ccd with SMTP id adf61e73a8af0-1e5e044536fmr29456744637.7.1735070952378; Tue, 24 Dec 2024 12:09:12 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 52/72] tcg/optimize: Re-enable sign-mask optimizations Date: Tue, 24 Dec 2024 12:05:01 -0800 Message-ID: <20241224200521.310066-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 All instances of s_mask have been converted to the new representation. We can now re-enable usage. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 98b41975af..182be7e63c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1797,7 +1797,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } - if (0 && !type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } @@ -2506,7 +2506,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) s_mask = s_mask_old >> pos; s_mask |= -1ull << (len - 1); - if (0 && pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + if (pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } From patchwork Tue Dec 24 20:05:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853252 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082809wrq; Tue, 24 Dec 2024 12:11:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVlTe8EeoV9lTLBlLTzC+b508zhVMCAxIH5d/7HoP012N7YnkxIUUzsr9DJA8jX3WrqN0GzVQ==@linaro.org X-Google-Smtp-Source: AGHT+IFZOM+m8btvm4soeNoxgYjCOFZKWoQqLtplawgBnMCwGiezeO9AYySuzvp+0oOe19wfPTmf X-Received: by 2002:a05:622a:2c6:b0:467:70ce:75ea with SMTP id d75a77b69052e-46a4a8f9543mr276825441cf.23.1735071093218; Tue, 24 Dec 2024 12:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071093; cv=none; d=google.com; s=arc-20240605; b=L/Kj4BmoRnTCWu5WatgThS6945r+APxpJ9nwQc7786PCU5tEPw4f8MZn6Z0WSmvVvF AKxMczrG2t43q3qGy29Cyzsq7jSwpOmD0FOKnmr/FUByS5BQLY6JCCet1X4usRfKMFFh 0zk0iE4rceD89a0NgNi13BVTuPA0uLrhqnfKWRUjLGPF3Qo81QhyQSiFrVk+ADLuVqdo J54zgCLtqcuyccp1XfgcwsSpHydIcmK0+qfOKEKfHh8+zenqK6rX6YgkUsa2f4BhdTIo fqc1qYztLark09Gg/CEsKFlUnq108O4zhLZCa0wHMcAGEgTWLoySoRuP6Y9Kl+mfBxhr qNvg== 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=JVk+VUZFNdsgvGVfECPDzgCPxhi/YGH65zoztjt+K/8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=BLmmyzkzkr2o0LJkGqbXobKajUR6N05X4fhlqTPVBUfBQ68tJYtukV1g6XcSkic21T Ki4zvo0m1A0CLuHvFYK8biZgd+/ZtV9SLvQulv1qpY0yiDYi+QdJH43lw6RP/FjechRn B+W4XUmQFeKcJTXCPMUtypt+R2kpcT0M4+3nPGpxOq+sYCJjSioafHdSxbgTgvhAQEfB Gq5ysZJ0TSX5W/tGb1Cd2T1nt2PZqjWlt8OR7bbUjf8BAgRQIwi5BjuAJjHhnCJS/M5R YltfNboWhn9/OSEI5c7S78H5QllpCf/uq1ngFTytbUH8H7MpdfmV8snjtzX3Ht/AgPYt T50g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=em3+DBNI; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebd82a8si108814841cf.609.2024.12.24.12.11.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:11:33 -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=em3+DBNI; 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 ) id 1tQBDY-000736-OL; Tue, 24 Dec 2024 15:09:25 -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 ) id 1tQBDQ-0006SZ-DJ for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:16 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDO-0002xA-Mw for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:16 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-219f8263ae0so23718105ad.0 for ; Tue, 24 Dec 2024 12:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070953; x=1735675753; 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=JVk+VUZFNdsgvGVfECPDzgCPxhi/YGH65zoztjt+K/8=; b=em3+DBNIE8dSsSC2fg5T/psu7wO10DQPf7W9/QZMBhgb9zCiP+H8bXp4xut1ong3zX +U37iAg2NqDJFm+n8JSdRgqFqfAo9RQl8YFInuPoiefBl1bzr4kE/KjStfbhzDcw15PF 7Of9RhUEIUKR3lIiFfttogXPzK0byMecGwvdo7fZg4JVSNDb6fqHwMIslYl7sTT3V3xI ZOzTPRGcdEEUMCBGL79o7+8zJqujw4k9VeBTJ8XJyiPv5YForRN8cTP5SSnPrp0e6E+R QaNl/fzE0+9fFbIN8Z++iedTkCojNeFX5P4c59F+BXl3nfYl7V1ms7Jr6EaiR3goflN7 tuHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070953; x=1735675753; 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=JVk+VUZFNdsgvGVfECPDzgCPxhi/YGH65zoztjt+K/8=; b=Q+t6J+QTpzWVnliQ+SriOvlifgu2IEAp+xRl63GoxPVVKr75j3NfxFNhd9s/3y+Uzm Ve5j00pj56Opq0Bs4/6KOZDcbo7sAYnIlww6TBKGr8SOS9gOiphIniqpgRhu3YWAy7jp CRwN5GlT9ats0TgoVbCmvV+kM6TvOrN63kAunWsk83t1IYIhYrfLCP1ogcQ7XaTG7h6P i3PMSFyyxcs35UxOAGu0gskHyjU6M1P0gu9jwH6FwazheRKJKP1uiwi8TdjwCUfg22AX UzN9+UP30o54ILYBy2t/PiFsZXzvs2savdXBWdePmBarKoszBr6QLUqdLw6KsFBL2X9l V92Q== X-Gm-Message-State: AOJu0YxrFPq/RtOKwhMA9CVHIDcqEoqgDVjou/ADfuXiEYKBP4TSQA3c TathsUz5jbbJeu2PRoYRgMzWlUJe3bAaYQqppRoqLq757Ud1NyYsMT3RlFGVTWQSISf/212KYbB S+NU= X-Gm-Gg: ASbGnctzicaGlKvFzb5PW4BVIwL9tM4gKSKAOXbd9Y45X3uG8pCIYLvwtghkKO2M0rn 9NqB6NoNCJ1DDCT+82lha5l/bgK617Xo4Q+jqz/NpqwuFpbt1o+ANXeQOh0nPtIJqsaTHWe183F erTC4ZrTRfhn96SyIiT26rT3Ty0q42Guc5Z3JnMMFNsWUedVEDCnn9wpRCnPFH1vE4jOHHc0/Q7 oEb9hMZgwk/2XklQJOowWaPii6StHEcps2CGpmKVnBlJWR2ll+BbjalrKMfCwzueFWkoSjBaWis BgPLJTdcErDuSpuaZHjxy3dAXA== X-Received: by 2002:a05:6a00:6f0b:b0:725:b4f7:378e with SMTP id d2e1a72fcca58-72abdbe0cb5mr23205064b3a.0.1735070953400; Tue, 24 Dec 2024 12:09:13 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 53/72] tcg/optimize: Move fold_bitsel_vec into alphabetic sort Date: Tue, 24 Dec 2024 12:05:02 -0800 Message-ID: <20241224200521.310066-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 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 The big comment just above says functions should be sorted. Add forward declarations as needed. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 114 +++++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 182be7e63c..1df61378ea 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1193,6 +1193,10 @@ static bool fold_xx_to_x(OptContext *ctx, TCGOp *op) * 3) those that produce information about the result value. */ +static bool fold_or(OptContext *ctx, TCGOp *op); +static bool fold_orc(OptContext *ctx, TCGOp *op); +static bool fold_xor(OptContext *ctx, TCGOp *op); + static bool fold_add(OptContext *ctx, TCGOp *op) { if (fold_const2_commutative(ctx, op) || @@ -1356,6 +1360,61 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return fold_masks_zs(ctx, op, z_mask, s_mask); } +static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) +{ + /* If true and false values are the same, eliminate the cmp. */ + if (args_are_copies(op->args[2], op->args[3])) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[2]); + } + + if (arg_is_const(op->args[2]) && arg_is_const(op->args[3])) { + uint64_t tv = arg_info(op->args[2])->val; + uint64_t fv = arg_info(op->args[3])->val; + + if (tv == -1 && fv == 0) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); + } + if (tv == 0 && fv == -1) { + if (TCG_TARGET_HAS_not_vec) { + op->opc = INDEX_op_not_vec; + return fold_not(ctx, op); + } else { + op->opc = INDEX_op_xor_vec; + op->args[2] = arg_new_constant(ctx, -1); + return fold_xor(ctx, op); + } + } + } + if (arg_is_const(op->args[2])) { + uint64_t tv = arg_info(op->args[2])->val; + if (tv == -1) { + op->opc = INDEX_op_or_vec; + op->args[2] = op->args[3]; + return fold_or(ctx, op); + } + if (tv == 0 && TCG_TARGET_HAS_andc_vec) { + op->opc = INDEX_op_andc_vec; + op->args[2] = op->args[1]; + op->args[1] = op->args[3]; + return fold_andc(ctx, op); + } + } + if (arg_is_const(op->args[3])) { + uint64_t fv = arg_info(op->args[3])->val; + if (fv == 0) { + op->opc = INDEX_op_and_vec; + return fold_and(ctx, op); + } + if (fv == -1 && TCG_TARGET_HAS_orc_vec) { + op->opc = INDEX_op_orc_vec; + op->args[2] = op->args[1]; + op->args[1] = op->args[3]; + return fold_orc(ctx, op); + } + } + return finish_folding(ctx, op); +} + static bool fold_brcond(OptContext *ctx, TCGOp *op) { int i = do_constant_folding_cond1(ctx, op, NO_DEST, &op->args[0], @@ -2772,61 +2831,6 @@ static bool fold_xor(OptContext *ctx, TCGOp *op) return fold_masks_zs(ctx, op, z_mask, s_mask); } -static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) -{ - /* If true and false values are the same, eliminate the cmp. */ - if (args_are_copies(op->args[2], op->args[3])) { - return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[2]); - } - - if (arg_is_const(op->args[2]) && arg_is_const(op->args[3])) { - uint64_t tv = arg_info(op->args[2])->val; - uint64_t fv = arg_info(op->args[3])->val; - - if (tv == -1 && fv == 0) { - return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); - } - if (tv == 0 && fv == -1) { - if (TCG_TARGET_HAS_not_vec) { - op->opc = INDEX_op_not_vec; - return fold_not(ctx, op); - } else { - op->opc = INDEX_op_xor_vec; - op->args[2] = arg_new_constant(ctx, -1); - return fold_xor(ctx, op); - } - } - } - if (arg_is_const(op->args[2])) { - uint64_t tv = arg_info(op->args[2])->val; - if (tv == -1) { - op->opc = INDEX_op_or_vec; - op->args[2] = op->args[3]; - return fold_or(ctx, op); - } - if (tv == 0 && TCG_TARGET_HAS_andc_vec) { - op->opc = INDEX_op_andc_vec; - op->args[2] = op->args[1]; - op->args[1] = op->args[3]; - return fold_andc(ctx, op); - } - } - if (arg_is_const(op->args[3])) { - uint64_t fv = arg_info(op->args[3])->val; - if (fv == 0) { - op->opc = INDEX_op_and_vec; - return fold_and(ctx, op); - } - if (fv == -1 && TCG_TARGET_HAS_orc_vec) { - op->opc = INDEX_op_orc_vec; - op->args[2] = op->args[1]; - op->args[1] = op->args[3]; - return fold_orc(ctx, op); - } - } - return finish_folding(ctx, op); -} - /* Propagate constants and copies, fold constant expressions. */ void tcg_optimize(TCGContext *s) { From patchwork Tue Dec 24 20:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853278 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4085033wrq; Tue, 24 Dec 2024 12:18:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWCFSXbYT/XoU3KQTwEyrPfit1ClTz40kd4W8TuZwtovUVI5rXwQ3HgmA3mWZYG6hzXCm3eRA==@linaro.org X-Google-Smtp-Source: AGHT+IFQWn6uQ0t4pTLYbMnnxBNjZ3F4aIOuLYRqgpccwguhOsoHQ3hLJxG8maETyF647qZNnfxH X-Received: by 2002:a05:622a:28b:b0:467:63a5:fb9c with SMTP id d75a77b69052e-46a4a98a203mr334103431cf.44.1735071538299; Tue, 24 Dec 2024 12:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071538; cv=none; d=google.com; s=arc-20240605; b=bHWWxiNqHx1wKaW9T5j6tUbA5Z3fnExRjx1sVacRC4Nq7m2j+A5HU9GPNE9db6FDC2 0HAiSLqoLVvvYsf1OwifchGhIjj5HQ++6sWdd20hJmOUvAW38m4HjEHKZOMeFZEAvLAu mN0AG+Pb+TTfpZaIOxfkFaSBNDO3ImT9tw0LM4eHfX6cS1I9GT9uQySeqrawS9Dg1XDP Ghm6kE2ajScW2gqxMxSXIxwVSKokeLPBl+PI30YsH85/LxvoaJeis6JN/A/83GASpxIT 4M17ehgN5DXOD0TmRZ8ptIfk1wJb64idDJtFg1r4QTgNiO/gVBli7U5dNhek+m74FQnM CrIA== 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=GEYI0S30T/rgONrSP0b+foHB4bUKaiqwurHUBqbuKQI=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=P7fyLG8L/MMJOBV1e6tD5YJj1cmqBxyepaC7mG6H49IDQz4E7SS2ikyhklAtCqCNJM wjJcn0OY9j1DnBQRLLomAhZ6EDwRqzUBZCip1/BwnU6YoP9MsoysvRJxBAaa7shvuCbx BG+Ljdj3QJESXhlb+ZnuTzB/zMxAMw8DlXXJphkkVY79SRie7TzPS7Y9iAGknusA2mR1 vdWb5sdV4VxGJ3R93FY7CduFciuNtLkuTC3M2oqlt0jGYIKr3axrC4ScWlr/oHavIkbF kx/MHTELSjVI57oApjgBSLz0MFFrg+kXRynyvv88DaeuQcnekOy6SgSCXaZDubVgpCAT ytbg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RXZkV9sR; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebbde5fsi133250691cf.404.2024.12.24.12.18.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:58 -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=RXZkV9sR; 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 ) id 1tQBDd-0007NF-DX; Tue, 24 Dec 2024 15:09:29 -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 ) id 1tQBDS-0006TT-BL for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:18 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDP-0002xX-Mv for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:17 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2166f1e589cso67084455ad.3 for ; Tue, 24 Dec 2024 12:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070954; x=1735675754; 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=GEYI0S30T/rgONrSP0b+foHB4bUKaiqwurHUBqbuKQI=; b=RXZkV9sRHT42gj/VRnKru6Qf02UPCljzVnTYOE6qos61gmbFiBQC7frxRhNygT+iYX rk8lrhDS6lgFI/v18NJT3KBZQDzUVI1TvaR3BzQG9TuHLQ7/bQOCQqAxJtAXZiYxPME9 aD7+F+Fwoj+UEehTLCcSbpxJ8Dd29fXwCXRGMvzaTDxjB6SV1+MvVhLwO+Y6dJJfZRjA w7OiGXyYFKzD9vrFMZISn4G5xpVElU/eEKzN24y6DPdKn7Pc+FIYgYrPW2K0yEyz45mB YjYqrvmGrMedHj1/k8/qMoTfXJlbZjMiUazX6buri2qAKWqXxsErodmU48wM/nt6b51b cSYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070954; x=1735675754; 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=GEYI0S30T/rgONrSP0b+foHB4bUKaiqwurHUBqbuKQI=; b=YAA/DJFMUv0+OtKghBMM0PsElJt1GtpjYgJymhfcN5L90lnL1LZK1/5FIA/VEiL8v1 f+Wi9jstWjmciYerYBY4V6ZJICElfwbIo/GTaLNXd88ww9d7FbOzKdmiyrpBTrmZS8Ub 2LZXbhfq6FlES6wIyx4fbRnpPoO9nd7lVBuG5VM6Tv2LqACAbJRhvjzX1HYv90KDpkuN bN+Jg1zZzHvfgw+hV8R9B9YEKAB/UaQ+NUPBH09rvF81YnwAPepnrWIQxySz/KVucMbC hTjnCoqbrxypgJHqRNRbbIEZZRvxVXkPMZelKM+/V8jEAmM6vEZVHpbaoWkqonoBKJOt ZgBA== X-Gm-Message-State: AOJu0YxzKexQ7ZRm6Vnw1kyjISlgqotyqqMMtylPROvousfL/Ze8VBh+ x85xbZZy3WUsbzurjHknBjOlvFCSE7yBkbHlq2WCLxSnZOt3IxX8uufWmXZN6RgdHM9d73elkB4 djKA= X-Gm-Gg: ASbGncvyjimFdDm3KF99j6ikXnuKwOQj5f8bnfyAwbwysyMxvTDL1gcKV2RYCUa5E9P Kz9BQEoqd7xK54F/yW7NcXQlKyTPQgPMKHZhxdTfvokLWqhtJq8U7aV4DvS6xz+ZUgCWu/HwvCR 9r1zoxx9gRvEU7HMGnFORMURYmqPSTbR338VwK/oSjo3P1/X1ckk9hjht9jsUTPCwZlrm4aGQ4Z HACdkjD9TcQJzpD+nm6Yc0Md/jSpBW1Oq/va8R7E6LEP3k7/T5ihiX18JRSoGiNo9dL6xOIxqfW rP0NBZ7eTGUupnwFmzDkwdyAcw== X-Received: by 2002:a05:6a20:a108:b0:1e1:9bc1:6d6d with SMTP id adf61e73a8af0-1e5e07ee6e4mr35782718637.31.1735070954398; Tue, 24 Dec 2024 12:09:14 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 54/72] tcg/optimize: Move fold_cmp_vec, fold_cmpsel_vec into alphabetic sort Date: Tue, 24 Dec 2024 12:05:03 -0800 Message-ID: <20241224200521.310066-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 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 The big comment just above says functions should be sorted. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 1df61378ea..c23f0d1392 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1619,6 +1619,36 @@ static bool fold_call(OptContext *ctx, TCGOp *op) return true; } +static bool fold_cmp_vec(OptContext *ctx, TCGOp *op) +{ + /* Canonicalize the comparison to put immediate second. */ + if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { + op->args[3] = tcg_swap_cond(op->args[3]); + } + return finish_folding(ctx, op); +} + +static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) +{ + /* If true and false values are the same, eliminate the cmp. */ + if (args_are_copies(op->args[3], op->args[4])) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[3]); + } + + /* Canonicalize the comparison to put immediate second. */ + if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { + op->args[5] = tcg_swap_cond(op->args[5]); + } + /* + * Canonicalize the "false" input reg to match the destination, + * so that the tcg backend can implement "move if true". + */ + if (swap_commutative(op->args[0], &op->args[4], &op->args[3])) { + op->args[5] = tcg_invert_cond(op->args[5]); + } + return finish_folding(ctx, op); +} + static bool fold_count_zeros(OptContext *ctx, TCGOp *op) { uint64_t z_mask, s_mask; @@ -2519,36 +2549,6 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], i); } -static bool fold_cmp_vec(OptContext *ctx, TCGOp *op) -{ - /* Canonicalize the comparison to put immediate second. */ - if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { - op->args[3] = tcg_swap_cond(op->args[3]); - } - return finish_folding(ctx, op); -} - -static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) -{ - /* If true and false values are the same, eliminate the cmp. */ - if (args_are_copies(op->args[3], op->args[4])) { - return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[3]); - } - - /* Canonicalize the comparison to put immediate second. */ - if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { - op->args[5] = tcg_swap_cond(op->args[5]); - } - /* - * Canonicalize the "false" input reg to match the destination, - * so that the tcg backend can implement "move if true". - */ - if (swap_commutative(op->args[0], &op->args[4], &op->args[3])) { - op->args[5] = tcg_invert_cond(op->args[5]); - } - return finish_folding(ctx, op); -} - static bool fold_sextract(OptContext *ctx, TCGOp *op) { uint64_t z_mask, s_mask, s_mask_old; From patchwork Tue Dec 24 20:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853250 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082549wrq; Tue, 24 Dec 2024 12:10:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVkX2HlCpz1qYeftSpUSvdLpfPNqReioM62e8WxShp4kmvtuzHcbv47+FusMOuZ/2JBlffQqQ==@linaro.org X-Google-Smtp-Source: AGHT+IGa1wr/y5qQMWH2rAPNN+3BD1VCuUP+piNTzDAc+ToT+DmKRIdttPv0vqbZePueDObmgU2a X-Received: by 2002:a05:6214:20eb:b0:6d8:8a60:ef2c with SMTP id 6a1803df08f44-6dd23307d09mr334733686d6.2.1735071042569; Tue, 24 Dec 2024 12:10:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071042; cv=none; d=google.com; s=arc-20240605; b=XP08jk42IPYOELvDcvyXDTLbhkPQtFvJUJXE4HxdOyVNOBIwA/IwLHeLe2llSWwfPB nio1VHDBmoO2taFnsSAr1nPQpjL4zmPAl6llDpxWTif6rfBaGvVBGiN+ZJR+05CJpZ5a ASnk4ukLoqHYDL+jxvHoay3mQWB2GZoi7iuYPJt1TZwrN907IE0evLFuROvML6C5lOAD r4kFfepAy42NRoxk34g1XZOzL5AlP2YbqKokuU9lLKSKJ46QT78jjQpAylkfAAbZRNv/ 2gp6PFpjgO6DzAIGbalCtzsZW8F6k34gxZajm+mBUnJdGUahgJ4W2tFkB5QvYSOxQd57 81NA== 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=2h6+tcbi8+WeC6r2ZX/7AWbF2bUA4Qz417vf0HVpGMk=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=eT7LFSknfpiLaeitj0FC2oXQzCW4heavEXlO6F6lWMkfQuNSkqs0RY2hO84Ugcghlj 8OkDdMxDa15HTmAIr/vr5K7JJ6NlduX/ZTcPOBbI0Xu7J+qz4UJZnDSyBGly+abWb5Oi +ztqUy0vNqoKz+bQwPQyuk58CgHBcq7kFy3CZ/547IsKoe4gVe3CVtIhmefK626Wn1d4 1QduaEHlPwh3j7T9bKlJvFJ5OJMcxUNKH+hZVcnGNhXuvMV/GGkJQ7fvLbJ4ceXcF99S TXl3sH+QvGERnDj3q90E5ABl5pTuQGsKNKJAJ/158G2r33mTAkT3tMsuBxHpWx5vavn6 gbnw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eKp1ZJIs; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1836fbe5si139826916d6.534.2024.12.24.12.10.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:42 -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=eKp1ZJIs; 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 ) id 1tQBDh-0007WE-NJ; Tue, 24 Dec 2024 15:09:34 -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 ) id 1tQBDS-0006VJ-QI for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:19 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDQ-0002xl-Gr for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:18 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-218c8aca5f1so66390165ad.0 for ; Tue, 24 Dec 2024 12:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070955; x=1735675755; 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=2h6+tcbi8+WeC6r2ZX/7AWbF2bUA4Qz417vf0HVpGMk=; b=eKp1ZJIsaCNQGVsAeO/URs1kjwHaqriTb4HZMZuLoMGq3JcYxX6NESaJml6XasViJW GtJmaH2Cb8Z/bKPpxHKEEv0/sFlmGZzIQVzjOhsrcbCUIMqqEIxkSWzRUYcLTDx6gUx2 SqWqJz1DWecXzuWgBsdScZad0XhCtTyc0D1vJxowRY9IbJ7X5wTJFaAnxElMsWma2kji mCi20phimMUZxIjKc9X6QRH6SPIlzdMtL3qBCsN0mW++HHbcPxBp9O9zvYnUJPpYQIQ6 Eyy4ay21sX7jBF7dhWU1Gl3wCLqY/mKIndhx1iXEiRUvYJnA79bUnK92Oh/bKdNSi1Kz v3Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070955; x=1735675755; 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=2h6+tcbi8+WeC6r2ZX/7AWbF2bUA4Qz417vf0HVpGMk=; b=ik3rDynrwKVK6u/Fft2DgXjVFnGxV7YmFoaABMXgdcdGdEaiiWugg+zJMVLMcGVL95 M+sHAx2pG6mioGQTkFsFQiNEW9JWxOT4kHvf//vFw67aOT28ZTNyyr32hE6VsnXeFDzh SPTBwGcMAog5f3K19U/eqSlaDlmY9fSbYs3WNHlu5s+WZIaQ7rJ15gpVudN13IYNYqK0 4FThcEfEpQefSRkObXjU7e/sWhqBag31+sLBXYQo3T90Ab8I0K3luRWyjd+kToRibkUD pw1iYmi4Ltabjjumrqt8Kco6V4NC9l/8qG2tZ7F44Yx1PX62TFCWLD3xupaoHc1GBM+T AVgA== X-Gm-Message-State: AOJu0Yw++Klk7hrlJzVVFIfQVEh7tRxubXiSP9GnlK3SoYo2dw2ZfY5H ViDMhUsH/0fb3nMcl1djp+pV1ffcgkgN2Yxcmik8t5j7ZbF6pAfOizOaYeVEhgM6er5MXMj/GjM 3/7w= X-Gm-Gg: ASbGncs5V1QJ2fLkblmC9DP6l4ETMq9jidpQUx8MdT605OGFWJYfYx+J48d57qv9sxS HmuOAvwUEbfzNVTtDHxPz2L9CepuhGvHhK3zgbMO1SDeCrkuQNvBrUUOKFqQYsELIeisVWUtaDp +vlgl4cgkK6T4gVBxT5WPJuUK6FNC1ieb7hLr9mxXeHG4MzQDZSWxatxiTG+TNQhAsrppHdoFNP 9/eFOQ/N5jKII+mrvrc/kwKuWIkGYzuUaWvdFIXCHleiwOzayx1e/375a2OSMiJQpKvc+/TC32c RNUn1tDAjMJsZTZ2eXz8YmO6GQ== X-Received: by 2002:aa7:888d:0:b0:725:f1ca:fd75 with SMTP id d2e1a72fcca58-72abdd3c299mr26876054b3a.2.1735070955280; Tue, 24 Dec 2024 12:09:15 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 55/72] softfloat: Add float{16,32,64}_muladd_scalbn Date: Tue, 24 Dec 2024 12:05:04 -0800 Message-ID: <20241224200521.310066-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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 We currently have a flag, float_muladd_halve_result, to scale the result by 2**-1. Extend this to handle arbitrary scaling. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 6 ++++ fpu/softfloat.c | 58 ++++++++++++++++++++++----------------- fpu/softfloat-parts.c.inc | 7 +++-- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index eb64075b9c..c34ce0477d 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -238,6 +238,8 @@ float16 float16_add(float16, float16, float_status *status); float16 float16_sub(float16, float16, float_status *status); float16 float16_mul(float16, float16, float_status *status); float16 float16_muladd(float16, float16, float16, int, float_status *status); +float16 float16_muladd_scalbn(float16, float16, float16, + int, int, float_status *status); float16 float16_div(float16, float16, float_status *status); float16 float16_scalbn(float16, int, float_status *status); float16 float16_min(float16, float16, float_status *status); @@ -597,6 +599,8 @@ float32 float32_mul(float32, float32, float_status *status); float32 float32_div(float32, float32, float_status *status); float32 float32_rem(float32, float32, float_status *status); float32 float32_muladd(float32, float32, float32, int, float_status *status); +float32 float32_muladd_scalbn(float32, float32, float32, + int, int, float_status *status); float32 float32_sqrt(float32, float_status *status); float32 float32_exp2(float32, float_status *status); float32 float32_log2(float32, float_status *status); @@ -792,6 +796,8 @@ float64 float64_mul(float64, float64, float_status *status); float64 float64_div(float64, float64, float_status *status); float64 float64_rem(float64, float64, float_status *status); float64 float64_muladd(float64, float64, float64, int, float_status *status); +float64 float64_muladd_scalbn(float64, float64, float64, + int, int, float_status *status); float64 float64_sqrt(float64, float_status *status); float64 float64_log2(float64, float_status *status); FloatRelation float64_compare(float64, float64, float_status *status); diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 8de8d5f342..b5936cc0f8 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -789,15 +789,15 @@ static FloatParts128 *parts128_mul(FloatParts128 *a, FloatParts128 *b, #define parts_mul(A, B, S) \ PARTS_GENERIC_64_128(mul, A)(A, B, S) -static FloatParts64 *parts64_muladd(FloatParts64 *a, FloatParts64 *b, - FloatParts64 *c, int flags, - float_status *s); -static FloatParts128 *parts128_muladd(FloatParts128 *a, FloatParts128 *b, - FloatParts128 *c, int flags, - float_status *s); +static FloatParts64 *parts64_muladd_scalbn(FloatParts64 *a, FloatParts64 *b, + FloatParts64 *c, int scale, + int flags, float_status *s); +static FloatParts128 *parts128_muladd_scalbn(FloatParts128 *a, FloatParts128 *b, + FloatParts128 *c, int scale, + int flags, float_status *s); -#define parts_muladd(A, B, C, Z, S) \ - PARTS_GENERIC_64_128(muladd, A)(A, B, C, Z, S) +#define parts_muladd_scalbn(A, B, C, Z, Y, S) \ + PARTS_GENERIC_64_128(muladd_scalbn, A)(A, B, C, Z, Y, S) static FloatParts64 *parts64_div(FloatParts64 *a, FloatParts64 *b, float_status *s); @@ -2212,43 +2212,50 @@ floatx80_mul(floatx80 a, floatx80 b, float_status *status) * Fused multiply-add */ -float16 QEMU_FLATTEN float16_muladd(float16 a, float16 b, float16 c, - int flags, float_status *status) +float16 QEMU_FLATTEN +float16_muladd_scalbn(float16 a, float16 b, float16 c, + int scale, int flags, float_status *status) { FloatParts64 pa, pb, pc, *pr; float16_unpack_canonical(&pa, a, status); float16_unpack_canonical(&pb, b, status); float16_unpack_canonical(&pc, c, status); - pr = parts_muladd(&pa, &pb, &pc, flags, status); + pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status); return float16_round_pack_canonical(pr, status); } -static float32 QEMU_SOFTFLOAT_ATTR -soft_f32_muladd(float32 a, float32 b, float32 c, int flags, - float_status *status) +float16 float16_muladd(float16 a, float16 b, float16 c, + int flags, float_status *status) +{ + return float16_muladd_scalbn(a, b, c, 0, flags, status); +} + +float32 QEMU_SOFTFLOAT_ATTR +float32_muladd_scalbn(float32 a, float32 b, float32 c, + int scale, int flags, float_status *status) { FloatParts64 pa, pb, pc, *pr; float32_unpack_canonical(&pa, a, status); float32_unpack_canonical(&pb, b, status); float32_unpack_canonical(&pc, c, status); - pr = parts_muladd(&pa, &pb, &pc, flags, status); + pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status); return float32_round_pack_canonical(pr, status); } -static float64 QEMU_SOFTFLOAT_ATTR -soft_f64_muladd(float64 a, float64 b, float64 c, int flags, - float_status *status) +float64 QEMU_SOFTFLOAT_ATTR +float64_muladd_scalbn(float64 a, float64 b, float64 c, + int scale, int flags, float_status *status) { FloatParts64 pa, pb, pc, *pr; float64_unpack_canonical(&pa, a, status); float64_unpack_canonical(&pb, b, status); float64_unpack_canonical(&pc, c, status); - pr = parts_muladd(&pa, &pb, &pc, flags, status); + pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status); return float64_round_pack_canonical(pr, status); } @@ -2323,7 +2330,7 @@ float32_muladd(float32 xa, float32 xb, float32 xc, int flags, float_status *s) return ur.s; soft: - return soft_f32_muladd(ua.s, ub.s, uc.s, flags, s); + return float32_muladd_scalbn(ua.s, ub.s, uc.s, 0, flags, s); } float64 QEMU_FLATTEN @@ -2394,7 +2401,7 @@ float64_muladd(float64 xa, float64 xb, float64 xc, int flags, float_status *s) return ur.s; soft: - return soft_f64_muladd(ua.s, ub.s, uc.s, flags, s); + return float64_muladd_scalbn(ua.s, ub.s, uc.s, 0, flags, s); } float64 float64r32_muladd(float64 a, float64 b, float64 c, @@ -2405,7 +2412,7 @@ float64 float64r32_muladd(float64 a, float64 b, float64 c, float64_unpack_canonical(&pa, a, status); float64_unpack_canonical(&pb, b, status); float64_unpack_canonical(&pc, c, status); - pr = parts_muladd(&pa, &pb, &pc, flags, status); + pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status); return float64r32_round_pack_canonical(pr, status); } @@ -2418,7 +2425,7 @@ bfloat16 QEMU_FLATTEN bfloat16_muladd(bfloat16 a, bfloat16 b, bfloat16 c, bfloat16_unpack_canonical(&pa, a, status); bfloat16_unpack_canonical(&pb, b, status); bfloat16_unpack_canonical(&pc, c, status); - pr = parts_muladd(&pa, &pb, &pc, flags, status); + pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status); return bfloat16_round_pack_canonical(pr, status); } @@ -2431,7 +2438,7 @@ float128 QEMU_FLATTEN float128_muladd(float128 a, float128 b, float128 c, float128_unpack_canonical(&pa, a, status); float128_unpack_canonical(&pb, b, status); float128_unpack_canonical(&pc, c, status); - pr = parts_muladd(&pa, &pb, &pc, flags, status); + pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status); return float128_round_pack_canonical(pr, status); } @@ -5249,8 +5256,9 @@ float32 float32_exp2(float32 a, float_status *status) float64_unpack_canonical(&rp, float64_one, status); for (i = 0 ; i < 15 ; i++) { + float64_unpack_canonical(&tp, float32_exp2_coefficients[i], status); - rp = *parts_muladd(&tp, &xnp, &rp, 0, status); + rp = *parts_muladd_scalbn(&tp, &xnp, &rp, 0, 0, status); xnp = *parts_mul(&xnp, &xp, status); } diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index ba8de7be76..4a62d6ca24 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -562,8 +562,9 @@ static FloatPartsN *partsN(mul)(FloatPartsN *a, FloatPartsN *b, * Requires A and C extracted into a double-sized structure to provide the * extra space for the widening multiply. */ -static FloatPartsN *partsN(muladd)(FloatPartsN *a, FloatPartsN *b, - FloatPartsN *c, int flags, float_status *s) +static FloatPartsN *partsN(muladd_scalbn)(FloatPartsN *a, FloatPartsN *b, + FloatPartsN *c, int scale, + int flags, float_status *s) { int ab_mask, abc_mask; FloatPartsW p_widen, c_widen; @@ -652,9 +653,11 @@ static FloatPartsN *partsN(muladd)(FloatPartsN *a, FloatPartsN *b, a->exp = p_widen.exp; return_normal: + /* TODO: Replace all use of float_muladd_halve_result with scale. */ if (flags & float_muladd_halve_result) { a->exp -= 1; } + a->exp += scale; finish_sign: if (flags & float_muladd_negate_result) { a->sign ^= 1; From patchwork Tue Dec 24 20:05:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853245 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082366wrq; Tue, 24 Dec 2024 12:10:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUaBe8icOkcfrs7KXMBGpZzs7EUq7+iwvjTxCD6motTh9eH1099qTGnwZU6THOGym+SG9ONYg==@linaro.org X-Google-Smtp-Source: AGHT+IHF7wJP74BCpXFcMEDVGFEGC+v/qAMPf+/KxYbXk+AC8BI7wH9Ip1C8G64dT0sTe3S/epcg X-Received: by 2002:ac8:59ca:0:b0:467:8526:f280 with SMTP id d75a77b69052e-46a4a96b166mr273637081cf.41.1735071004746; Tue, 24 Dec 2024 12:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071004; cv=none; d=google.com; s=arc-20240605; b=h5kw1WMLeyvzjZnpPBAA10MhAgxgwJE5fOo6CpOC62uOrmhJSTa2qWzeGQuM+bfMyg cbDgce5pjyY209sv4BcfrDafhqDe2CoueG3avu2uWeWvhRIaASIcsAdHrx3gw2h3lciv q66U6CE8jWhLtT0wZo8IrnTJoNZaB5vkSleUbPbWthiLTVbVeYrq1DdPU0+hw1FiqE1R W4gs497KNXTZJ2M1MCF6GoYL7Q8LkZvx6vDuPt4wwp4bozKiLddXmRopqLJvae3l3NNW dqTMHDGHKnmvnP6xorsGngE7BtDIE3BXqn/wbfOLPvRzLW8RGo3gtBpBcyE980xjn+8j xBVA== 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=MKoswZ0+HzjatCwvvzude3nDWSM8RUV02VuNA19m0ac=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=gVKEoQQwNNP3c6OPP2Ff0V2hAPIaoHlQDCfeEOmHWnF438+uLmR2fL4MWotl0///2p xubQwTBscVOZ1hIg6AW2Uf1Xi04idtzn5yUkJjtmggA8lX9y/xiH26nXO+TNyuuqDvcT dWOBNn7DcibKjUyCbdmwWdRTmV3wpdLFoydhro2obfGwNetGR2Xk1g4ffgivF3W+JcGF hVzrDxOCDJ+33KpYWvjjzu6GDU5CNFN3RGjLKUH6PeTx/IxwOyqqc3d6n+/uuKQPTeCX 4pRrLXik5Q+PiPj/cpkGpNiMWEJoWfgDJos0QhuujOj2RFvYdQdCJ4iwjed9P/DlxEsT lbZw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kp847CNw; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac53e52esi1442855385a.634.2024.12.24.12.10.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:04 -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=kp847CNw; 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 ) id 1tQBDy-0001Wv-On; Tue, 24 Dec 2024 15:09:50 -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 ) id 1tQBDT-0006dQ-QV for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:20 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDS-0002xz-4W for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:19 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2165cb60719so57760375ad.0 for ; Tue, 24 Dec 2024 12:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070956; x=1735675756; 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=MKoswZ0+HzjatCwvvzude3nDWSM8RUV02VuNA19m0ac=; b=kp847CNw7g5ZE2ZUZgWnGD8MT8kNil/Lh3RycQJn1/Lrn4UI9EuL81BR6k6j9TamFa 4A6OaE3xsd+rORv6FOriyyGWsBP+yQiYd/N9+ooy0r8aQt3lUDBiTajjbWJnRCCb33oz fasUEoCHmefLmMIfSqvudN3fLLwf50nT/BqOQduBe0PDlg7eVGgjmkr6xvPOVCv0v3bT MiBxYaX5tSQYXYhakAHI6fAci769Q6RZ9LoyV+9w0JgMdSIDrQXzpGIeV11eFE8gSNAO aWkjzg719+GMdQQW7tvhaXGp2vo6K7A8toHhAHjDl933T4YhJtTlT1e3yi6BaYB6f3uR EhYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070956; x=1735675756; 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=MKoswZ0+HzjatCwvvzude3nDWSM8RUV02VuNA19m0ac=; b=QPi1nKl1VvUvxXj7SSusa6T+xxXYu4rrshdjJTEanjQpz2j1gT10slk1XSYZOwXJli ErXbPdR/rKLdpGC7+wbDgXJfucyTA91QiNzkF8Kbh7+mk7r41Z2uQbvA9tOfKF+U3Cbv CH9Ym7LZNPN6WIWAMDiUo7skK2zbzaVcisoyo52Xz3KqraE4rA4wNAtET1oUQS9plc98 QDQjybB6HVH3o1a5cy2z1ZvoKQZueaSqt6DpCeEMA14E5Lupk1nMvBPIFJwGFFm05GJb dEptHo5sveDTyulmsoJY8AdVfCwfaWgVs+uZgLPM9y7LzqhLNl3KoEeDjPYSyDb81bPX DpZQ== X-Gm-Message-State: AOJu0YzqhaBngt8+bXeb9zhzOl39LQrfjdGow3YFVrBbPNIw3KVzhTja ccTKQbSZSKQV9VIi4B54AGw4L61E+fCYFrGNk4uvOAnc4d4U/8oPqIG6R3yG63TJfOCdNAyf8DG FKns= X-Gm-Gg: ASbGnctKio1B2n2FPkIsjV+0ZRZDT3crY8wUaQCCj9PRo7ZRpOlFTX7Q/1Qhv6HAeAR 2MG1enM4VfB1uYAjJ5++BypyskwYFjYSrQaMKBn4synOfKQ+z8Q/qVnq2S0OtYN+ShANS7xPfa6 IUTb845tJrX7QRsvSsFGdbBUEjVNXm3xD9FQptvehlhwa/Dww0hnrAwII9N3btUwmQp8gGIcpAT dXCZ335Aa+0u5/OZZDx3dS/8hnhSVEnFg7SifU+YSNEKoke2lcz4LytxlqD4g8IOq3iZJZsQlpZ 5dqQPuIFr0lVpZIagE2EPstFfg== X-Received: by 2002:a05:6a20:6a25:b0:1d9:6c9c:75ea with SMTP id adf61e73a8af0-1e5e0448930mr28347558637.5.1735070956205; Tue, 24 Dec 2024 12:09:16 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 56/72] target/arm: Use float*_muladd_scalbn Date: Tue, 24 Dec 2024 12:05:05 -0800 Message-ID: <20241224200521.310066-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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: 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 Use the scalbn interface instead of float_muladd_halve_result. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/helper-a64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 0e130501fd..3b226daee7 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -262,7 +262,7 @@ uint32_t HELPER(rsqrtsf_f16)(uint32_t a, uint32_t b, float_status *fpst) (float16_is_infinity(b) && float16_is_zero(a))) { return float16_one_point_five; } - return float16_muladd(a, b, float16_three, float_muladd_halve_result, fpst); + return float16_muladd_scalbn(a, b, float16_three, -1, 0, fpst); } float32 HELPER(rsqrtsf_f32)(float32 a, float32 b, float_status *fpst) @@ -275,7 +275,7 @@ float32 HELPER(rsqrtsf_f32)(float32 a, float32 b, float_status *fpst) (float32_is_infinity(b) && float32_is_zero(a))) { return float32_one_point_five; } - return float32_muladd(a, b, float32_three, float_muladd_halve_result, fpst); + return float32_muladd_scalbn(a, b, float32_three, -1, 0, fpst); } float64 HELPER(rsqrtsf_f64)(float64 a, float64 b, float_status *fpst) @@ -288,7 +288,7 @@ float64 HELPER(rsqrtsf_f64)(float64 a, float64 b, float_status *fpst) (float64_is_infinity(b) && float64_is_zero(a))) { return float64_one_point_five; } - return float64_muladd(a, b, float64_three, float_muladd_halve_result, fpst); + return float64_muladd_scalbn(a, b, float64_three, -1, 0, fpst); } /* Floating-point reciprocal exponent - see FPRecpX in ARM ARM */ From patchwork Tue Dec 24 20:05:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853272 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084853wrq; Tue, 24 Dec 2024 12:18:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXzDkV2DDADu1e85yNguWOZpXDNAY2G+Psf2sJq2Ij3aXziYPAVnj8I5NWFLcbN2Y1dqShTDQ==@linaro.org X-Google-Smtp-Source: AGHT+IFU2z4cLr5Pepqhp8y4aEhFr893Px/3SIQSsfgArARMrRnn01OBMPEl8glMlcQP7XCCZb5+ X-Received: by 2002:a05:622a:28b:b0:467:63a5:fb9c with SMTP id d75a77b69052e-46a4a98a203mr334073661cf.44.1735071498969; Tue, 24 Dec 2024 12:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071498; cv=none; d=google.com; s=arc-20240605; b=DckelD59Qm6Z8hucCeEp7TyDyL7ZT7p2m1WMpuQb1RAPvC+sXVcKxeQ4DIl5qOXK9M I+cQAW/8MP1t50uSAi4CdE9ejrdx/KxPBVzH96Wi+3FuqVWCQi9Ax0BdgnlphZ8/rvIG +mkbY8C+4Njx/xYRBWftPeONODbRXFWt4l0ZVPXaY1b2kriFAM19hSI0bSl3CETCKzGH tjaw8vno8yOvPsbkFhttrvr5Mat3qPKQGTuYy5wlpsJW7Y2jKoqQnyS3XPD6jztmzA4n 9c+9v9EmfJDm5chkMTKlVhEjkOme0JG54as1a1L+lEX9HfkRYU48/uWi/oF/hIAFWqVd 4FbQ== 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=1WWVUuFJ12NWX3hZBTm/nR+nuzYhMWj/gdswxVh+HzA=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=aaVoxKYIbnEiSkVkUlQDG5tN96SGDvMG6KAs9zsuTAsqsCWXsJXujCtoVTfwnBTl7t WODqn/y0ce5usiIqJnhs7kV4Y0MzvzkZBWBeBuxUUHmBgF00vi5vfV3jUrsuf1BlPwq5 Hw30agy4zOhf0XQx/G4Ng0P40psaNBBHL6dB3dbWToo6gwh0BMY+yFytTOoNDF2Q3yL+ TTwDNsuJ0rfLfDhzKAxrcRb+nx9E7b2MmZUPT7ICKoEg6m9bjYZKeKhpYUvFbEx/PBPe dRJlukV9FtGyMw3SjWmbtp1Xk7Naie+n7NconXk848xHw7oAfUVQF+3rUvQF9Duu038l Ik6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nRW6miba; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e6a8b97si153608251cf.169.2024.12.24.12.18.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:18 -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=nRW6miba; 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 ) id 1tQBDd-0007N9-Ay; Tue, 24 Dec 2024 15:09:29 -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 ) id 1tQBDU-0006og-OW for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:21 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDS-0002y6-Kg for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:20 -0500 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2efb17478adso5478455a91.1 for ; Tue, 24 Dec 2024 12:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070957; x=1735675757; 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=1WWVUuFJ12NWX3hZBTm/nR+nuzYhMWj/gdswxVh+HzA=; b=nRW6mibawrPYbgl5GP5Q4Bd0hil2z3UINtVaPUbH1lMVTimLBXKivYIvbPE/xtvfkz AD4QJQg38I2Yt1EWQnNrQI6pNrByW4yuKGcwzRKmld0QubLTjUyMWn7PwmwRIRFUZ2JE 3Cbz+fjf3/1Ss5K4RpEyTOlf0UTICCzuhpXQR6np7HiVnymbaeEaz29vHRgO5MsjPDoV egFML7YtwVJA6DLilV/sjd7xHZvBchOkDvcuvVnoTnCWHiku1sZnGLOsK7WBOW5sHzzX 5bAFzKY+tiUThFyX3yzNpADfPrDwpNthz3s2xm1FeDTRFvgjUGyU8TcHEPTB4NbT8krb 1y8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070957; x=1735675757; 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=1WWVUuFJ12NWX3hZBTm/nR+nuzYhMWj/gdswxVh+HzA=; b=TYsKCtk6Qq9HW+Elu5pgAJRTP9jrF/aaDukuuFBWvk4Bs9wfKVKhMl2Aj25NckLCMo P68u9WtDAWRYb+p2kSkR7eZnw9aU1hQJ/sCTB7YqHsOtM1SpUMqzDFFH7atQ4M881XCK mIScbUpbpViwF8Fcmyrje/sOzN6qFN0RF5JA1McNCxz5kJ3xCeXEl6Oio4ztvjEQTGip dxfTBB33lDEy2g+8GWHOYOSklVo5yd7IhLloqhc+ke1duSpbrZNrwkrFcZibpbQ1rRAg xduw3IhHGR1dibRzvP1NeXsmtALxTzGKuyuk17p53kBAGmjOH94V8xVmqgtSJc8xjrRX 13PQ== X-Gm-Message-State: AOJu0Yyu1P/TtwhKbrmHkxZNPyidZHNMaE4m2bePmwhQuXPGG2hloZ60 nHFcciXwN4rFeHrHmAc3J4l64kZwFIY2Tv3BnRY5loWm8Jwtxa+AKXi9Yi+fN1n3h8rrHXj9CxM A+Ug= X-Gm-Gg: ASbGnct7UZD4np8dSBu0HZKXxOdTNtYvbvJH0kkuU2tedFy3j0Ot030Gk9VwNalf2s3 u/tDayR2KzRWRG0VsY9TiJ08SdK+dYQ2bkZP2YCWDEtNMSywIGuN5FV4ZzJHfpjaSVHhwJyWV9c LQcYYNr2edHzmjk8+DQh/YrKvknpC69wNzIPRqhJy3UTVvuM1L0K/ySsUxL0YJUB4ytzaTvpj08 rGc86kFE0h60b76+QH7+AzSktZKY3cJJ1tFQ8JNOnjV4d8HBtkItvzfsVkbw5Xtk9Jp4PEuBKu8 ci6JaQ6UxAG2EvWhcuWx5XfPzg== X-Received: by 2002:a05:6a00:1944:b0:71d:f4ef:6b3a with SMTP id d2e1a72fcca58-72abdeb6e80mr26145144b3a.21.1735070957102; Tue, 24 Dec 2024 12:09:17 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 57/72] target/sparc: Use float*_muladd_scalbn Date: Tue, 24 Dec 2024 12:05:06 -0800 Message-ID: <20241224200521.310066-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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: 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 Use the scalbn interface instead of float_muladd_halve_result. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/sparc/helper.h | 4 +- target/sparc/fop_helper.c | 8 ++-- target/sparc/translate.c | 80 +++++++++++++++++++++++---------------- 3 files changed, 54 insertions(+), 38 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 1ae3f0c467..3a7f7dc129 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -59,7 +59,7 @@ DEF_HELPER_FLAGS_3(faddd, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fsubd, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fmuld, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fdivd, TCG_CALL_NO_WG, f64, env, f64, f64) -DEF_HELPER_FLAGS_5(fmaddd, TCG_CALL_NO_WG, f64, env, f64, f64, f64, i32) +DEF_HELPER_FLAGS_6(fmaddd, TCG_CALL_NO_WG, f64, env, f64, f64, f64, s32, i32) DEF_HELPER_FLAGS_3(fnaddd, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fnmuld, TCG_CALL_NO_WG, f64, env, f64, f64) @@ -72,7 +72,7 @@ DEF_HELPER_FLAGS_3(fadds, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fsubs, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fmuls, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fdivs, TCG_CALL_NO_WG, f32, env, f32, f32) -DEF_HELPER_FLAGS_5(fmadds, TCG_CALL_NO_WG, f32, env, f32, f32, f32, i32) +DEF_HELPER_FLAGS_6(fmadds, TCG_CALL_NO_WG, f32, env, f32, f32, f32, s32, i32) DEF_HELPER_FLAGS_3(fnadds, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fnmuls, TCG_CALL_NO_WG, f32, env, f32, f32) diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c index 236d27b19c..c25097d07f 100644 --- a/target/sparc/fop_helper.c +++ b/target/sparc/fop_helper.c @@ -344,17 +344,17 @@ Int128 helper_fsqrtq(CPUSPARCState *env, Int128 src) } float32 helper_fmadds(CPUSPARCState *env, float32 s1, - float32 s2, float32 s3, uint32_t op) + float32 s2, float32 s3, int32_t sc, uint32_t op) { - float32 ret = float32_muladd(s1, s2, s3, op, &env->fp_status); + float32 ret = float32_muladd_scalbn(s1, s2, s3, sc, op, &env->fp_status); check_ieee_exceptions(env, GETPC()); return ret; } float64 helper_fmaddd(CPUSPARCState *env, float64 s1, - float64 s2, float64 s3, uint32_t op) + float64 s2, float64 s3, int32_t sc, uint32_t op) { - float64 ret = float64_muladd(s1, s2, s3, op, &env->fp_status); + float64 ret = float64_muladd_scalbn(s1, s2, s3, sc, op, &env->fp_status); check_ieee_exceptions(env, GETPC()); return ret; } diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 9be26c804e..465e20f4f3 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1359,93 +1359,109 @@ static void gen_op_fabsq(TCGv_i128 dst, TCGv_i128 src) static void gen_op_fmadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) { - gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(0)); + TCGv_i32 z = tcg_constant_i32(0); + gen_helper_fmadds(d, tcg_env, s1, s2, s3, z, z); } static void gen_op_fmaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) { - gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(0)); + TCGv_i32 z = tcg_constant_i32(0); + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, z, z); } static void gen_op_fmsubs(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) { - int op = float_muladd_negate_c; - gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); + TCGv_i32 z = tcg_constant_i32(0); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_c); + gen_helper_fmadds(d, tcg_env, s1, s2, s3, z, op); } static void gen_op_fmsubd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) { - int op = float_muladd_negate_c; - gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); + TCGv_i32 z = tcg_constant_i32(0); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_c); + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, z, op); } static void gen_op_fnmsubs(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) { - int op = float_muladd_negate_c | float_muladd_negate_result; - gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); + TCGv_i32 z = tcg_constant_i32(0); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_c | + float_muladd_negate_result); + gen_helper_fmadds(d, tcg_env, s1, s2, s3, z, op); } static void gen_op_fnmsubd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) { - int op = float_muladd_negate_c | float_muladd_negate_result; - gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); + TCGv_i32 z = tcg_constant_i32(0); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_c | + float_muladd_negate_result); + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, z, op); } static void gen_op_fnmadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) { - int op = float_muladd_negate_result; - gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); + TCGv_i32 z = tcg_constant_i32(0); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_result); + gen_helper_fmadds(d, tcg_env, s1, s2, s3, z, op); } static void gen_op_fnmaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) { - int op = float_muladd_negate_result; - gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); + TCGv_i32 z = tcg_constant_i32(0); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_result); + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, z, op); } /* Use muladd to compute (1 * src1) + src2 / 2 with one rounding. */ static void gen_op_fhadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) { - TCGv_i32 one = tcg_constant_i32(float32_one); - int op = float_muladd_halve_result; - gen_helper_fmadds(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); + TCGv_i32 fone = tcg_constant_i32(float32_one); + TCGv_i32 mone = tcg_constant_i32(-1); + TCGv_i32 op = tcg_constant_i32(0); + gen_helper_fmadds(d, tcg_env, fone, s1, s2, mone, op); } static void gen_op_fhaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2) { - TCGv_i64 one = tcg_constant_i64(float64_one); - int op = float_muladd_halve_result; - gen_helper_fmaddd(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); + TCGv_i64 fone = tcg_constant_i64(float64_one); + TCGv_i32 mone = tcg_constant_i32(-1); + TCGv_i32 op = tcg_constant_i32(0); + gen_helper_fmaddd(d, tcg_env, fone, s1, s2, mone, op); } /* Use muladd to compute (1 * src1) - src2 / 2 with one rounding. */ static void gen_op_fhsubs(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) { - TCGv_i32 one = tcg_constant_i32(float32_one); - int op = float_muladd_negate_c | float_muladd_halve_result; - gen_helper_fmadds(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); + TCGv_i32 fone = tcg_constant_i32(float32_one); + TCGv_i32 mone = tcg_constant_i32(-1); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_c); + gen_helper_fmadds(d, tcg_env, fone, s1, s2, mone, op); } static void gen_op_fhsubd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2) { - TCGv_i64 one = tcg_constant_i64(float64_one); - int op = float_muladd_negate_c | float_muladd_halve_result; - gen_helper_fmaddd(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); + TCGv_i64 fone = tcg_constant_i64(float64_one); + TCGv_i32 mone = tcg_constant_i32(-1); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_c); + gen_helper_fmaddd(d, tcg_env, fone, s1, s2, mone, op); } /* Use muladd to compute -((1 * src1) + src2 / 2) with one rounding. */ static void gen_op_fnhadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) { - TCGv_i32 one = tcg_constant_i32(float32_one); - int op = float_muladd_negate_result | float_muladd_halve_result; - gen_helper_fmadds(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); + TCGv_i32 fone = tcg_constant_i32(float32_one); + TCGv_i32 mone = tcg_constant_i32(-1); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_result); + gen_helper_fmadds(d, tcg_env, fone, s1, s2, mone, op); } static void gen_op_fnhaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2) { - TCGv_i64 one = tcg_constant_i64(float64_one); - int op = float_muladd_negate_result | float_muladd_halve_result; - gen_helper_fmaddd(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); + TCGv_i64 fone = tcg_constant_i64(float64_one); + TCGv_i32 mone = tcg_constant_i32(-1); + TCGv_i32 op = tcg_constant_i32(float_muladd_negate_result); + gen_helper_fmaddd(d, tcg_env, fone, s1, s2, mone, op); } static void gen_op_fpexception_im(DisasContext *dc, int ftt) From patchwork Tue Dec 24 20:05:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853256 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4083263wrq; Tue, 24 Dec 2024 12:13:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUceWgTKJofsd48ByGreiCltY4zsI9kltABeaG4E2/Pbj1oAoirc9d/4gTtGFt8K/eu7FBWjA==@linaro.org X-Google-Smtp-Source: AGHT+IGw1dgsL5jBdbtWbU2wvrbOVFN3wsLxzonrsnlJ9/T7+2MSsldgUf3vwfs+jm+adthkJphM X-Received: by 2002:a05:620a:8006:b0:7b6:e9ba:2853 with SMTP id af79cd13be357-7b9ba7bc17amr3315595885a.35.1735071180451; Tue, 24 Dec 2024 12:13:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071180; cv=none; d=google.com; s=arc-20240605; b=Nrq8zvHjw9rCsUBZNoZCETSy4jgVqTB/kQ++o34crsERy2U/09XzFOcDc151YvpQDf +GrRAHCBUDFliIgivHRSVVxuXgbDj1fLqPa5JXy7Y1OWHs4NxpPvbdkgxuJWGZPOwuxt eTwGwFpACim9h3JkZtcm1pg/CogOjZ1zEX7tLTreemT6qaaDL5ISGrEagavNIdOPWlUP PdPmnfPT3t8Bt5HHqfAHMqRatWBlfeYyix8TIjYL3q6hD9Iue/06UCvpulON4PkutGf9 3tY4zlTVJ+zxGnFUOhhPsMZ6g0I03cYP764GrYamjEfaSyuMFqot5fb+MKT90pWZvLnn zr4Q== 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=DNZINX2but2Pfb8ZOCVoSmAmmZqPR58yrma436JYpx8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=a6q1jF0pL/qGElqlr+WklWMQt52QeMFa8hCqauIxP3UbImmBfuDKfk7Y1TDDLfV44l zpcDfgfLeva+m30xNH8eHk6iqjgt9CpGwanMYJoXz3YntyLi5UvmcxvgUrTDE4l9mFbN +JrNRxazyKT3EsXnY2N4rMjUX7p/c7SKUeuO5HI8DP4MfEexFViJHWsstvYiZ/olZ0gb jyomqyGN0EY9GRjcFoFNfkXkDDlUsefqK6Wg4tf/zdw0LPOuCFrVuCTuXgBzLW/Np5t+ 1lgC3K7NbNO52zV9BhoJ/dC1h28eEouD98MIUwP6QSSc1gLVu9H/15VNx+rc3WKFUyUD ILhA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KwSRT+Kc; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4f2904si1386087685a.528.2024.12.24.12.13.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:13:00 -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=KwSRT+Kc; 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 ) id 1tQBDm-0008QL-Dh; Tue, 24 Dec 2024 15:09:38 -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 ) id 1tQBDV-0006uA-Gb for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:21 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDT-0002yF-I8 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:21 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2161eb94cceso39855885ad.2 for ; Tue, 24 Dec 2024 12:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070958; x=1735675758; 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=DNZINX2but2Pfb8ZOCVoSmAmmZqPR58yrma436JYpx8=; b=KwSRT+KcH7MgyHOtDyq5XmPTzoqcNKuvSAi7VuB/OwOW+Fmk94CwgyOddiCGKFDXbh JUsQaPT3aL64sKAvplEBtMeCc94UriLAxNDD74dYmLy7hRtxNFh/triM12/7l42Gg9Y9 2dU9jb8s8Ce84DmmwvbxD/GFDRJpletHZWukKPIWvGtyJBTY/OfK+pwiqyeu4Qibzpsj p+m/yOPppOrQVWLigq/V70qTZOJy/FCs9dRGe19JvDM2w0owkfgCBYLTMJYC01pAT/yg gC9qpVIm8d4cMYlLTu3pl2y0J53I+2ySj1kAH8apr3fOL61cFlxVCNgoT0nqF6M8UteQ AgJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070958; x=1735675758; 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=DNZINX2but2Pfb8ZOCVoSmAmmZqPR58yrma436JYpx8=; b=LFODBmFeAqj178tIPQ6C3VxJbL+gJgetL111SzoB2PEXlAlpy00TGV9lDpe3rkQjlG A1tGpPnYR4zRtkIQNO/ocZZ4lmwVeRe3jebk5GmXBWjRzbjhDb/K22SIn1Xx8+ekVezf 9OaZ2rGsOpeeE37/JF+AHYff2gJPBFU5q3D4U9g4CTsHZBjNLe7/C3M33MrlZ2tgOkgO SwUjU8OxZjgLaaclp+t6riXYzTy1Bz2OB8x3X8sexatqE7X1Xnd4xYoZzYT5k+9DcN21 co6dvXL87fDS+0ZPm5hDtAvzoJGT4kSChrBhlDJXd164OyF0dvPtXgWMI+5HKnc/uvDf eIEQ== X-Gm-Message-State: AOJu0YwerBEHdhFyuTeDk5hMvaiTWiw4Mbe6hmRjgJvRNrfGlbGhWQCY 217DNy4gZvZA7FEKbW5tA0/WhRZfuBhNnisiPILoNw6wHFENmAKuyD8NRmDA39fd3c3+NDGWbG8 9nU8= X-Gm-Gg: ASbGncsdSPNX4GPPJLyBBPWhQZZ4tf/gxMbzKwfzF0Uzkft15vBw1NKM8CQRERruQi8 C6qAvy6b/xK/PRq9O2X3rx8XoXSa/bYfYG+CtbeMiWfRPITVbjGGyBtJX8EZqCZFvskAgIVDAvv KpAaTh606MxFmleMrjsGxNKmV2gZfSGevJ3SdzBcz6c4Gnv5QMvZb5P+tu1Zx6PQ8W5aqwCKVq/ Qfrtp4ChnSt7WAQzWZSPM3DBhXqQh1OU4KjcL0/1n6x3+oSHQ/t7MZ20/FqNBGEjjexlAzjmR/+ Tp5QWbGQHbXz2qusTN+YW8q3Sw== X-Received: by 2002:a05:6a00:2449:b0:728:e906:e45a with SMTP id d2e1a72fcca58-72abdecdbfdmr28215787b3a.24.1735070957893; Tue, 24 Dec 2024 12:09:17 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 58/72] softfloat: Remove float_muladd_halve_result Date: Tue, 24 Dec 2024 12:05:07 -0800 Message-ID: <20241224200521.310066-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 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 All uses have been convered to float*_muladd_scalbn. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 3 --- fpu/softfloat.c | 6 ------ fpu/softfloat-parts.c.inc | 4 ---- 3 files changed, 13 deletions(-) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index c34ce0477d..aa69aecfb0 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -120,14 +120,11 @@ bfloat16 bfloat16_squash_input_denormal(bfloat16 a, float_status *status); | Using these differs from negating an input or output before calling | the muladd function in that this means that a NaN doesn't have its | sign bit inverted before it is propagated. -| We also support halving the result before rounding, as a special -| case to support the ARM fused-sqrt-step instruction FRSQRTS. *----------------------------------------------------------------------------*/ enum { float_muladd_negate_c = 1, float_muladd_negate_product = 2, float_muladd_negate_result = 4, - float_muladd_halve_result = 8, }; /*---------------------------------------------------------------------------- diff --git a/fpu/softfloat.c b/fpu/softfloat.c index b5936cc0f8..6967fb5c9f 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -2274,9 +2274,6 @@ float32_muladd(float32 xa, float32 xb, float32 xc, int flags, float_status *s) if (unlikely(!can_use_fpu(s))) { goto soft; } - if (unlikely(flags & float_muladd_halve_result)) { - goto soft; - } float32_input_flush3(&ua.s, &ub.s, &uc.s, s); if (unlikely(!f32_is_zon3(ua, ub, uc))) { @@ -2345,9 +2342,6 @@ float64_muladd(float64 xa, float64 xb, float64 xc, int flags, float_status *s) if (unlikely(!can_use_fpu(s))) { goto soft; } - if (unlikely(flags & float_muladd_halve_result)) { - goto soft; - } float64_input_flush3(&ua.s, &ub.s, &uc.s, s); if (unlikely(!f64_is_zon3(ua, ub, uc))) { diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 4a62d6ca24..a724f317c5 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -653,10 +653,6 @@ static FloatPartsN *partsN(muladd_scalbn)(FloatPartsN *a, FloatPartsN *b, a->exp = p_widen.exp; return_normal: - /* TODO: Replace all use of float_muladd_halve_result with scale. */ - if (flags & float_muladd_halve_result) { - a->exp -= 1; - } a->exp += scale; finish_sign: if (flags & float_muladd_negate_result) { From patchwork Tue Dec 24 20:05:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853243 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082343wrq; Tue, 24 Dec 2024 12:10:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVyRtbxkQF3D4HgMcRyFLCK4B4e2/ibyoJjoW0jrmZ6N8Lrglx2PuCiChXmxdgZTkWsKH6ZdQ==@linaro.org X-Google-Smtp-Source: AGHT+IFeBDacon+gF8+EY5q/EqoxlclIoBPmpuk1Xz9M56IifgeBA7ZeY3EZYhRVDl19IQv4txNF X-Received: by 2002:a05:622a:60b:b0:467:5f17:94d with SMTP id d75a77b69052e-46a4a9a3ee1mr346720901cf.52.1735071000684; Tue, 24 Dec 2024 12:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071000; cv=none; d=google.com; s=arc-20240605; b=GuScQBfSWc5KMKSgYmqNgsUJLTU7SbX1kIEWkp/rJwcK3H/t6uXiFAGYZ9J4hlcWgn B//UXlaeS0tsdeYd+AfNkMXtFY4ZCj43twHkIvFKVWbz3CY2gg/K47xDlVjFrip7p3Lq 8lbYXYQbHnjPk0qS+T+UjY5HakLYba1xcwt2E91jdHxPDL27tSclfuQfcUxXrcNDyZ6W f5kI7p0xhRfQX2GEfaQYHKx5YIClbF7hHK3Bz5GHgdPmo++qTPBxCwrOMQCI2xTkCt97 o08nrnKCsRvogXjF3XMlqCHZhK8AMpeRiKwJv3Hj3ZYKhTBsQetxUKf52U2NgFfNZcqh kPtg== 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:to:from :dkim-signature; bh=VUIKMuGpZcO333SHRrlgYIo9hY7EVMRSpYe/wTFZLaI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RpPzDmt6gI49IwGxqiY2xf4f/uNmp8lc3VF9fvOusw+5wcI+tAdKnwHfVI4vlpizOS uL+HmnTuQLkdQMo25zpCro5RCH6dSmK5xmg4olY1BuBwWF8LOwYX3L6jWciKYeGkSM4C tZUV3RJ4LRU+fCZwHYVgcYlr3dDftvjghG4dRx7nwKkF+D7p6A/c56AZjlEiT8+SuQj4 c5VvW5wXX9SVS5XsljUpSytUX/KUbRjBJIOaDqakfsMQh1D2SolSrvDwbOpM5hCg19pS qubK9Aje3TRmp5SNK67o9yZA40u7whluVv8a+hcD1rujpBRHvGWby5+gu9eDV8HQlKwx JIPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xPuf381P; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebc084csi155565791cf.446.2024.12.24.12.10.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:00 -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=xPuf381P; 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 ) id 1tQBDg-0007VC-HN; Tue, 24 Dec 2024 15:09:33 -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 ) id 1tQBDV-0006wf-P7 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:21 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDU-0002yS-0R for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:21 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2166022c5caso50557955ad.2 for ; Tue, 24 Dec 2024 12:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070959; x=1735675759; 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=VUIKMuGpZcO333SHRrlgYIo9hY7EVMRSpYe/wTFZLaI=; b=xPuf381Psyw8zye033aHwe0G8pGlidd+1CYnlUfFeKJ5v9dCbcndCR56zGjhR2/Sn5 TZMO5P+0K6Dos+vvCq2NW2KeBMNB0MBUS+lcZ414T7vV9chvxicAVpSNbEAp3v+uJfzX Hfo+sJAGTP/ETrH580EepUdXH12dhqXC2//BfOGeVDayCYGd9m4xnrLCjXeISZfnqSvk cUQFUMTBCC35yklc0I8Q6gDjk4hxic+vTts4OqiUAUpxVl2Vujq7IgSZTl+CLvvOHkY9 ydEGDtmTmTBIN4uMi1g2k5YTMp8o+/pGgdtyNzWgBXdVo/jVRzHwZupUWf3FNZpoUywN XsQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070959; x=1735675759; 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=VUIKMuGpZcO333SHRrlgYIo9hY7EVMRSpYe/wTFZLaI=; b=d7ME0vTje7w9X24q0T9Pjlub21Z0Z2Xlsg4NY3IpLIDYLFVOgeYeM6IrHBgY3ZyrAU cMFgzMSjMS7pDbbsVp9N96gpfP8G2X4xLL6OvVK2aiK7gU2i0oYnGQiDLHMLBkqIsxKs PUur/npfan17Iy46SYfdV40DsXLR/hWf6IdKimOtFUrKp8jCR2nDENGdejcRJdLHlIDy fxwhhVEWPAL1NiUdYmZUjk6K2tUdn7ioXhiZBjDTJivTUIq1MK00IHCkIRin2rhqZFDF oKmuE414Plu7pK8s0jLLntV42fImewczcWKCSNfVplwWPkLYfsKetvGSKOSqtH0j0tLf ryCA== X-Gm-Message-State: AOJu0YxVMWHk98NH8pCZi6kMZQWHSU4PIf1dEZ35iL2B9jBEPR/CVukT uBlfB2J5UnPaK9jS0QeI5YveQe3hTSMiLLfeCEK2cuaVoz0UI67IUNqTzSKrMIQK94Wp4dyqo7P Rctk= X-Gm-Gg: ASbGncsjSRaUmmf7W4NvIAxXBThw2xxtYQ51trvFq+r7Rg+pNQ9dyKuMM9tM9spSg2D IXT1W7UAARoXqveSRUxCOdMGAHDenB591ZwY4OPjIU1VsYPy54Sttian1DOzcoZHFBXjQNmcr+a LbYyzeQ0D6/mz+1PqqaGsIkPzi9mFokkQt50/dX4/l9XYif/5U5VK56UgunNdBa58y1txMB4c+G iuLqE810Aoq4OHoTaSYdVd9ayoXhs+GboKWRL1olZyrQdcTKaNJxz44X7cB25lGiN78kn9NjHnM cf8Y6P2k2/kv9bAcnkCJiCHT/g== X-Received: by 2002:a05:6a00:918a:b0:725:322a:922c with SMTP id d2e1a72fcca58-72abdd20f53mr24150743b3a.3.1735070958732; Tue, 24 Dec 2024 12:09:18 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 59/72] softfloat: Add float_round_nearest_even_max Date: Tue, 24 Dec 2024 12:05:08 -0800 Message-ID: <20241224200521.310066-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: 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 This rounding mode is used by Hexagon. Signed-off-by: Richard Henderson --- include/fpu/softfloat-types.h | 2 ++ fpu/softfloat-parts.c.inc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index 79ca44dcc3..9d37cdfaa8 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -140,6 +140,8 @@ typedef enum __attribute__((__packed__)) { float_round_to_odd = 5, /* Not an IEEE rounding mode: round to closest odd, overflow to inf */ float_round_to_odd_inf = 6, + /* Not an IEEE rounding mode: round to nearest even, overflow to max */ + float_round_nearest_even_max = 7, } FloatRoundMode; /* diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index a724f317c5..37d046cfe9 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -241,6 +241,9 @@ static void partsN(uncanon_normal)(FloatPartsN *p, float_status *s, int exp, flags = 0; switch (s->float_rounding_mode) { + case float_round_nearest_even_max: + overflow_norm = true; + /* fall through */ case float_round_nearest_even: if (N > 64 && frac_lsb == 0) { inc = ((p->frac_hi & 1) || (p->frac_lo & round_mask) != frac_lsbm1 From patchwork Tue Dec 24 20:05:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853263 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084177wrq; Tue, 24 Dec 2024 12:16:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX8mI52HUdH6YHWdpJYVlIvuoANFPO/dS5jpaTinfaqebLT+0O5H7lTB/jRTfhz24L+uDx+Eg==@linaro.org X-Google-Smtp-Source: AGHT+IFXY54+4vl73VbctlPQ2ilDc3gvp04OrzFidMCGX+Xd2E7MSJPpFJv7uOM+cwL2Hrz6AFnF X-Received: by 2002:a05:622a:13d4:b0:467:6fa1:9e2a with SMTP id d75a77b69052e-46a4a97817emr302277921cf.40.1735071369197; Tue, 24 Dec 2024 12:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071369; cv=none; d=google.com; s=arc-20240605; b=k6UDJHMx5B+uMnY+hjDCeYhleRoHmdTq3b+qBXlAH97ExuoQnAi4xnBplApJ/0fDRT 8x8Y/+VuXOoDUZ/Ux2ochUF2bznZ6g0yOq07bTJAN2xsVUnJ1nnZpEqML/52JG3tLBoC OcMtyU9qtcN56qvhUAhU0JA8uT6FULm6gOw0YkzHhtVH4cJgGFvzKr3JRjhWa/8gM7jw D6tLtFTbLUgjzTeoTYVM+7lr6rGo8eQ5AxRMNJvLsj8CLQxrsyVcd/9ikiqt3hHpjYYj cwz/EQXnH4EycWUEz4OdhyUf3MCFVyLGduXXO7o2EAe3LkX2PcZQdVYHwHmCfxfp9XMV otOA== 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:to:from :dkim-signature; bh=qMWHCU8E787jJTfENdcTGiVxd4zzSlvdX30p3jl01M4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=N7GJUsSZJzeEqgHCe2aWtxjqXJ9b9zoMghGul3NiRihXokDxwsmlGaCwj/WJeEQcHV IBnMyN5sRkYl2OfPNmWwNtkUx/bj2EFtK9j3m7xNIonEc/YdHW6wBTHiXHxFDXmAM4vp hpMFQJ2cEGqf3E/VADKvLpYRS6kGOf3Y4Nv9/cxvO7qrVMqYX+AvkamLrg5T9gWHx4md tO1gD46m8zfwQPBdqt8VI6KDO6tP9tK2pQjsV7KadnBQbSeFFORd1GsYF646eemh/DUW Ltw9Z0VTo24/90JfeMPWh4WDZPNM6HkYCyIJ6G55osSfiWeYv2n1+vh+2E1MBm29aP3u O+KA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GffYiqBN; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebd8367si134630951cf.614.2024.12.24.12.16.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:16:09 -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=GffYiqBN; 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 ) id 1tQBDo-0000Mn-Ok; Tue, 24 Dec 2024 15:09:40 -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 ) id 1tQBDW-000732-Jv for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:23 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDU-0002yf-Tp for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:22 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-216634dd574so40016175ad.2 for ; Tue, 24 Dec 2024 12:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070960; x=1735675760; 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=qMWHCU8E787jJTfENdcTGiVxd4zzSlvdX30p3jl01M4=; b=GffYiqBNLAzxx3KVZWPF2Dj7oSAR+LbBeZkxm7SDygpT4kYdh37DH7aO8rDMykmEyQ iVAyJ1NAiRsCGpIPQxMugFyt65Daprwv2dJz3oSgnM2uG3JlK1rEiZxtdmUfg6jVseet o9rWkaUeY6/8vmFqY4yJtvzgYMYpB8UKom/4rL1nNv8WHrGWqHyHpwQb1KCDSfMSzFGp q8zV11EihlFqEGxLFMNsHmucUdvIS2H+gfkLVEBz8cJVBEZybMBBYid3e/EncpDhqydS 9KaIB8V4f/I8JIRygOJDHvAaE/xCOI8+hynTlWmf1NftX1h+oQJMeyUlJa7eIXh+DizD cCMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070960; x=1735675760; 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=qMWHCU8E787jJTfENdcTGiVxd4zzSlvdX30p3jl01M4=; b=WCtj3/uewzLnK9FHss2dCGWIS6R0SD6GpV7CVR7DgWz12eFW5ZcTZESsamcbWz48WY Sbv7TDMp+ru+noiKaHozqG3WUCcSFDozGDAgWJfijkWLYFB5hyxBY2u8+ogjKBYtvVIl BezkvyoKZKdDxdf9XpYAeH5Zh18EJUAzqeP9TIItXInz01Ld/4GZDSNXpbYxA3cu3SQA ZrkP/garK5s5q59S5RHGqIhGx6y+mzvCmFmmtwTZSv+yi/c2ILLsRbBf5upo31tWFXwn bQ60nHOFPAcFmFJ7Qre039I3UmIr6zWIIkG0PPyLEElZuFwZN6C6bkXR6+vpJoOpJd2K tzdA== X-Gm-Message-State: AOJu0Yw9bn0h6GMn+sitm2SMKk8X0ywEJ05PfUv1OeXK9DrR+roafQXt n+QCK+hsENcZMxlyYZ11jdTDMHnb0PQlqp/8w+KtOZIHnwa35hlTNv5aVZSN3KnaYEpCgR4SRkw yNwA= X-Gm-Gg: ASbGncvAOqoNs49svkejSzHMNH0epRhNbK/2siSNljhNMy2JEHah7cZmsHaQ+eb5vUA ZrfShC9nNeDXxLnO6WDEcCXAQqxY/wjUkTblHE2OC78HLtoxbMIXt91R1bww5jHuqj1hObeaPwx wQ+zErjKPgULD/jw6TYHHcdtMPcZgiWWR6g5xIn8C4FHRTtuj77i08eOOCIqQOd0CGC5R56ACN1 4gUudfZLoguaLzcTaLfxeb/2OjJQjyc7M98VlyGCj3Fpk3VzIL/0gVElC6oqfV5yuKrEgcGBy5s s9yqqhd/wGn+vsIMBygYeJFs0w== X-Received: by 2002:a05:6a21:6f87:b0:1db:c20f:2c4d with SMTP id adf61e73a8af0-1e5e044b1c1mr27570093637.2.1735070959723; Tue, 24 Dec 2024 12:09:19 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 60/72] softfloat: Add float_muladd_suppress_add_product_zero Date: Tue, 24 Dec 2024 12:05:09 -0800 Message-ID: <20241224200521.310066-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-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.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 Certain Hexagon instructions suppress changes to the result when the product of fma() is a true zero. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 5 +++++ fpu/softfloat.c | 3 +++ fpu/softfloat-parts.c.inc | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index aa69aecfb0..09a40b4310 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -120,11 +120,16 @@ bfloat16 bfloat16_squash_input_denormal(bfloat16 a, float_status *status); | Using these differs from negating an input or output before calling | the muladd function in that this means that a NaN doesn't have its | sign bit inverted before it is propagated. +| +| With float_muladd_suppress_add_product_zero, if A or B is zero +| such that the product is a true zero, then return C without addition. +| This preserves the sign of C when C is +/- 0. Used for Hexagon. *----------------------------------------------------------------------------*/ enum { float_muladd_negate_c = 1, float_muladd_negate_product = 2, float_muladd_negate_result = 4, + float_muladd_suppress_add_product_zero = 8, }; /*---------------------------------------------------------------------------- diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 6967fb5c9f..8d75d66817 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -2274,6 +2274,9 @@ float32_muladd(float32 xa, float32 xb, float32 xc, int flags, float_status *s) if (unlikely(!can_use_fpu(s))) { goto soft; } + if (unlikely(flags & float_muladd_suppress_add_product_zero)) { + goto soft; + } float32_input_flush3(&ua.s, &ub.s, &uc.s, s); if (unlikely(!f32_is_zon3(ua, ub, uc))) { diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 37d046cfe9..ebde42992f 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -615,7 +615,9 @@ static FloatPartsN *partsN(muladd_scalbn)(FloatPartsN *a, FloatPartsN *b, goto return_normal; } if (c->cls == float_class_zero) { - if (a->sign != c->sign) { + if (flags & float_muladd_suppress_add_product_zero) { + a->sign = c->sign; + } else if (a->sign != c->sign) { goto return_sub_zero; } goto return_zero; From patchwork Tue Dec 24 20:05:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853274 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084969wrq; Tue, 24 Dec 2024 12:18:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXizROHGJbRpVim5HcdMG25c2j/bBBi8pLAvqAqB9+virhKK+Th2PJD+MQbZWudzN8z9Psn+w==@linaro.org X-Google-Smtp-Source: AGHT+IGopu/BnCvjSl8hK0lZ7LvfRb4ntU/TqAUcrbzNnf9VXuULZVxD01yt2cXFXqjZMqf2TJlU X-Received: by 2002:a05:620a:4452:b0:7b1:48ff:6b62 with SMTP id af79cd13be357-7b9ba738951mr2536281585a.16.1735071523909; Tue, 24 Dec 2024 12:18:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071523; cv=none; d=google.com; s=arc-20240605; b=MMw8b14+X4NM+45HLr60xJaECOUSOBYuAzMJvrVBoPxyIyk6BOXuRizIyo3/6s4j8r Dknb4w8zgyGtedXCN5UF9tTSokGqiaeKuwoYiOrD1oGiP9irQPdH+J7vG9Hy3KdY0FB9 HNl3eYVfFRKilHVJGP/jdkiglCOzjXIrUf/vIDpmIvkloOR5kyVlvbOFcTkkeB+AL7Uk hBCyrRavh5REpzU/3QydvH448/Xfye9likrj4qoNHGyk1hDr0zh5kIdAxgIX8H0oo73x ao/nIVzRKmYJaqXk0BVcpZPFYWXXoaHP7TXFQuo8EWDIi2SHHNTJIqTZCgTBO5Y+cvgY efIA== 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=dTGDXG/LHK+cbArsNVQoTZPhYd/l2OlGD8Apa8yjd5c=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=lU6oEKysgM3buto+LfcupF3HavP9dWkd8XyJAhMGrXzF0T3jF3aij1vX9k5xhjT9FI mzgh0U8qOpR4sx9zTUIm/FqgvP3t0VKNU/OeB7EZmAPMZunwcigIlzzKZElO9fnmq7Z2 khUJ3Tr5IwOe0aNTekAgpR8YximFPxgYE3ZykbEfrsGpzTBVdP5HvJeY8HsEKfUfZFNy vYecyERD/gejwA89jZmHv8PN0WJaye8d/ln075saMJkJPZlqNUEJcTEgTgwhSHdcRQP8 MXbsRUMT82DnUtHImpVaYYFGcnWRhsPC5dbLquY9SugubILWlzBH1UWTDwcBOASpcM/1 4Utg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=imwiTqt5; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac47896dsi1605617285a.265.2024.12.24.12.18.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:43 -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=imwiTqt5; 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 ) id 1tQBDt-00019I-7M; Tue, 24 Dec 2024 15:09:45 -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 ) id 1tQBDY-00073P-Uk for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:25 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDV-0002yv-W5 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:23 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2163dc5155fso55567595ad.0 for ; Tue, 24 Dec 2024 12:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070961; x=1735675761; 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=dTGDXG/LHK+cbArsNVQoTZPhYd/l2OlGD8Apa8yjd5c=; b=imwiTqt55KHmMFeNaE75nII/ZaBDuPy4V2/0CiYKrGhPJvZP3fo5s52aC3fAaCl/nI j7p3BAT7W1iST011QE1d4DXMdkLgOgCfa5fRNJJs8Uo7FNQHDrWjVoYmwUPIJTRhQ4pJ vkFs+tKIaOXDq4a6QeGaZswt/h73Sw75jK7REzqhFlLiSYwIFYyvjmaGwD+zFOaLhfcn BMGJOtQuCTdDR+aeumsK8xT76gM26uRH+v6AL6Yte7vLEbzv/K+VFSr54EKyXkBz8GZz xOrjVALZWUueqs84l5SaIn58YwXecIj5bbG7SmLgErS+xC7+C8FQ1bTFB6UQIsXzXPff ftbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070961; x=1735675761; 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=dTGDXG/LHK+cbArsNVQoTZPhYd/l2OlGD8Apa8yjd5c=; b=NHVsSth9vzU778W/Kk2Y1v7EdVLkAMSzp9NllZXFVkjB2ez9hEshBiw8ReRIG0l9S1 OFH6TKfVav1ro4GWPMDDSC8AygH6s4VekW5xw+bC4kRKQqobRDs8GegMpY3CszChZ2mM DTjipaUYDTwL/LJ6UDBbJ5A2DFjEROUOZfrpJzX+I3EQTsZImw7dZ6fcjoxec0IsWgs5 RRANxG/fMjlDWYBpAnQ8C1EmuRhDOfvv9iWzksC8L1YSlA5vb8focMIwMMptdcLuG8b4 Y+jD7n+AMVjl9PPdiAGq1iCWaNpxJTJwMJXCZFkHhuctL10OuHCF78z4uXTXTM04+Q1R 84+A== X-Gm-Message-State: AOJu0YyrZFzuy11SuNdC9z3/h0z+4QiNvdhOt8ChQtlV2aQrtEzwgs5K oOZx6sXJbTFrHWpyE71scjm4x1qJjHK+kEMdP2wquc4wfM+X3XqWg1hXomJRusjyYo0QXeHMsP/ 1++U= X-Gm-Gg: ASbGncub3ERq56oZkJiLTCj90ck1uHcfI4x0CLi/nk6VunFUuQm2EGA2iEf9O4tbO1N cqx2Aw0/TOKVQJbSLgyBFOMEzKJiuI4fD7Xn796gqKUE1vnwypP1hCLthPQWq15VjHZWVCdjkCO dcIZrR4JApxvV7/9yDvJvf2w3YZqb30VtJDxh+7z+1mbgUn4OuYuRClgQf5v1anF3hCw98bCdRs GJPkFVtcMTFIw586eJBasXk2/g43wfLLcNhXvPcPfA4sMSsDus5wWvDoLWnd7Hd67mX9fWhEclC yQGCX2GWspSxLJdpW3XxAL4hCg== X-Received: by 2002:a05:6a00:a95:b0:725:d956:aa6f with SMTP id d2e1a72fcca58-72abdd5eea8mr28794770b3a.5.1735070960766; Tue, 24 Dec 2024 12:09:20 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 61/72] target/hexagon: Use float32_mul in helper_sfmpy Date: Tue, 24 Dec 2024 12:05:10 -0800 Message-ID: <20241224200521.310066-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-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.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 There are no special cases for this instruction. Remove internal_mpyf as unused. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/fma_emu.h | 1 - target/hexagon/fma_emu.c | 8 -------- target/hexagon/op_helper.c | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/target/hexagon/fma_emu.h b/target/hexagon/fma_emu.h index 91591d6050..ad5df5d038 100644 --- a/target/hexagon/fma_emu.h +++ b/target/hexagon/fma_emu.h @@ -32,7 +32,6 @@ int32_t float32_getexp(float32 f32); float32 infinite_float32(uint8_t sign); float32 internal_fmafx(float32 a, float32 b, float32 c, int scale, float_status *fp_status); -float32 internal_mpyf(float32 a, float32 b, float_status *fp_status); float64 internal_mpyhh(float64 a, float64 b, unsigned long long int accumulated, float_status *fp_status); diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index 05a56d8c10..35971b8b99 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -655,14 +655,6 @@ float32 internal_fmafx(float32 a, float32 b, float32 c, int scale, return accum_round_float32(result, fp_status); } -float32 internal_mpyf(float32 a, float32 b, float_status *fp_status) -{ - if (float32_is_zero(a) || float32_is_zero(b)) { - return float32_mul(a, b, fp_status); - } - return internal_fmafx(a, b, float32_zero, 0, fp_status); -} - float64 internal_mpyhh(float64 a, float64 b, unsigned long long int accumulated, float_status *fp_status) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 01d1a1b1a7..d257097091 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1045,7 +1045,7 @@ float32 HELPER(sfmpy)(CPUHexagonState *env, float32 RsV, float32 RtV) { float32 RdV; arch_fpop_start(env); - RdV = internal_mpyf(RsV, RtV, &env->fp_status); + RdV = float32_mul(RsV, RtV, &env->fp_status); arch_fpop_end(env); return RdV; } From patchwork Tue Dec 24 20:05:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853258 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4083535wrq; Tue, 24 Dec 2024 12:13:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUxObOi/cG/Fqnr2PU0ZaxlddJj94L4OJ2vZLfDnIt/t7CEDdG46xnw1vlM9hRI6mWsItLKLQ==@linaro.org X-Google-Smtp-Source: AGHT+IF0eSJw+Xrr5KZazMJ2DW386m358NLJ4w7qSEWbEBiOoe0m9twl32XRtTGT1PncDCk2inEI X-Received: by 2002:ad4:5b83:0:b0:6d8:a754:9647 with SMTP id 6a1803df08f44-6dd2333297fmr225041776d6.17.1735071234963; Tue, 24 Dec 2024 12:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071234; cv=none; d=google.com; s=arc-20240605; b=Dwpio4h7CLM284YcdA9DakePIO+r+X6ZOj31bgvWQTteyKs+E9lynIK37NVqBUZQ8o vieBBSdTL91/t3yj62xB2hENISOGJR9X7aWpqVwfDvM4+nZ1b45bGqVvHNMWn8idtEJp HGBReCKGo4XTKJWxdvJHB4ZWsDvzZPu03GWuB5uoQTATUqw6zR2FOBOlrNYZMxZ1bPgd 7E1KuDrnM0prKC4d346IcLHJUoP2qXneK9UFvYq5zP0O+CDMRX0oouDmI06USF3VkQ/p dnRtJNiqeSAXA7hrO7Qj4z0xXBgIqSOSOFi5t6MwjKgQ0lZLTN5xqFsKPlIBJte13zds p3MA== 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=fu0SQWVVGdmrru8Sp2YT+Mtrtw7meBa6dVTFQbMXPPI=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=fE1ab7mFEdnKLAjJ/EvQ2RDdHBX89thNJIEVKdKsJ2oxQLQwvdpnerijLxBxacumsy LwLXgBlNoQTPKDidblJ0Vl6L3NEiNS2cz4ogBrrGCt+ORWFzhVryxMNL6bRLYQSsw45j HqF88q9emf6vQI/fIfSFivPv7VfkQ/r+mHzgsdb5VvRedIU8IR6sOkd0Tk9M5fD1DFOn McRJ0x0Be2jI5Lvp9/RTQT3+UgmkCCrwczjyvAIPRBUIfJWNojfReij6FHTAYfuvAs2i xX/c5THDGJ1xkqqxkABfQJQl4UdrLVltNLf4xiR+m4LhypbxB+ljjOfdhu3/xAb00vd/ 1zmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DNbx3tw/"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e6ad678si157016211cf.181.2024.12.24.12.13.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:13:54 -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="DNbx3tw/"; 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 ) id 1tQBE9-00038l-6B; Tue, 24 Dec 2024 15:10:01 -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 ) id 1tQBDZ-00078W-IN for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:26 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDX-0002zB-3E for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:25 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-216728b1836so49419825ad.0 for ; Tue, 24 Dec 2024 12:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070962; x=1735675762; 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=fu0SQWVVGdmrru8Sp2YT+Mtrtw7meBa6dVTFQbMXPPI=; b=DNbx3tw/Nbu9RQ4IQEWCHnDHBWIA+mYUAfTf0A76Qq+JgqSFFvkZ0I6FnKGdgPggQ0 Mq79bHqfWn27dgdkIAEvQNJ3SvTR+55aiE+OYJrPT1MPlOvPYJGO7qw87/RS98RlKJk4 YGZ7Bvt3NO0FS5tnSmbr0W2hebAPy2N/H+ZjZda2Wbl2V6Y9r44irHYTfcauZvBmPGYS s/Kr7w3r3KB3vS0Ol67CnMBle1UbJyZ7T8sn1gC0rmwtx5kSl85bS63FJLSkMIIOvBH/ sA1hLUaQglwz46QajY3PNiL6z0//NesoPo2tY1+czcC//cn8Al/47BnglCooJHlkus6c MUtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070962; x=1735675762; 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=fu0SQWVVGdmrru8Sp2YT+Mtrtw7meBa6dVTFQbMXPPI=; b=tpuOBLDAWTtyKKyfYi7+t8TdAQD0tkCTnTXnhsoQf7dU0OKtMRPWpa4CxMBb5jZeHh DkeRVN8NT6KduSQ7csfvJ+gaWhfog7AAhECWIbfKvLzCBrAEYUjQZrmh8ILjVS7e8odg JEmtHTkaJDKZFPBQsDk81iSOeSFlFCxF23+TkPdzpLs0zDMS6+RgvfD9O+ikX/xyigjf qLRN3aFbpecTI+Q54S9gaBCwkXmPi0Cd8C33XHUVw4UIlZbKzgpa701I77NUo9i4nWA3 mUGEXEysuO3/tTAdyEqHwagI2Bpr4tFZf0ZSQYesvjOKx6X5ogfpZz/czXQ6u2TqXdD9 5/0A== X-Gm-Message-State: AOJu0Yyg3GIzKB1Gs1cdlNNt8vHnZ9GEqatvd+FTuSJRakRz4IT+PCHn JNQymK2iOwAIp+piVpM8W7ZjxQejHGyEiEAIbbbeT21qQTumEPWNgaBWgRtTcETyCMNKGLIczGy ta6k= X-Gm-Gg: ASbGnctNdE6YONXjLwIpNZCkt7ukOCuDWQjHavo3NTl2RUKZrx8pk8+Yg0rPhGCKOrD N5GQfT21/KfYl5u1WuJu3kbnN2RUgnWPWe3eiZtVYoJl+fgXB84vl3WPHawiRBV+PSQsBESUvVr nMki6d9YqoHhVn4Qbwqa1g51RPKiaCMGb48Vr4zUkQbEGoTQy0CnbUkem9NQnToBqSI2no0Kyn9 t04UWQTTKX5BxD9HnToy8FGahwnsxPL0EDNsS9IaY/eWrAKWZRaQ6YT4QtPvBAfBdugCRMNi0C3 lvgBl0ifqANSewhLzBR7/z4D2A== X-Received: by 2002:a05:6a20:4394:b0:1e1:b430:19c6 with SMTP id adf61e73a8af0-1e5e04600e3mr26564657637.10.1735070961814; Tue, 24 Dec 2024 12:09:21 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 62/72] target/hexagon: Use float32_muladd for helper_sffma Date: Tue, 24 Dec 2024 12:05:11 -0800 Message-ID: <20241224200521.310066-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 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 There are no special cases for this instruction. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index d257097091..15b143a568 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1054,7 +1054,7 @@ float32 HELPER(sffma)(CPUHexagonState *env, float32 RxV, float32 RsV, float32 RtV) { arch_fpop_start(env); - RxV = internal_fmafx(RsV, RtV, RxV, 0, &env->fp_status); + RxV = float32_muladd(RsV, RtV, RxV, 0, &env->fp_status); arch_fpop_end(env); return RxV; } From patchwork Tue Dec 24 20:05:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853248 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082433wrq; Tue, 24 Dec 2024 12:10:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUvhOOuMRYJ0/1QXiaA4hPgyI1MB3GKQfBeJaEUSizkebbz3fegZGG0acbx2Tu9ELnw6j+u1A==@linaro.org X-Google-Smtp-Source: AGHT+IG+OixWnxaXvEm84Htaknkb0uKk5CT7Q32UK9vEkKDV/Cn6hGgJL14BOD/OA7+7j9xsrvxQ X-Received: by 2002:a05:620a:4627:b0:7b8:5511:f72d with SMTP id af79cd13be357-7b9aa99f11cmr3635120585a.17.1735071016694; Tue, 24 Dec 2024 12:10:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071016; cv=none; d=google.com; s=arc-20240605; b=dGE9uMyz3gtPmhzxvNh0Y6Bk0+eTLgmfqSAmik1RwjcnbauF9+i36CWX86vpBe+Lqk c4I2aiSr2lc5O4P5w02hknpvji/Ew3qDFsXlANcpoNFcn5xunlZ0MGyVzc+bR83OM5q5 lVx1wfxQtSWn3kEeDk88l2MK6gGB1EiPCYefrtN1kRr///X3zo0kaXJ8Fm+ijK+VSaBl xBHNVIE8tMmTKePHZy5aois9BhwACyVAx3OjXpx/hgckE41DkLS52mN03sPjUjNLTg3Q QF1o9lhM9PX++kUM2nKsBTjhEOasjZI+H4Wthanhi8LcM2Z/qAf+1IpsKfVRs/l/+6Lq bIag== 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=B8Kb81fRDUd8pwBhno+Gknf2gcOv41osiELdqm6o4Ig=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=ctv7EQA2QStgU8VDV8zznWMdRvpCccqTpLo1Q/zN0SjXanikyhar9QRoAD/oUbGma/ A8K68+kPBXCfLpd55iBe7vZI83hCIrq8RHGGwfsyWRDjl2VfXrLC8sRidE36tnzjR6Wt Iscn196zDUHgnhIsAia8VL2Z2jpyUOll1P5NN8SxcCdc/kDy0NcXY2IJk7PopN8bKolr 0Qn1hRX4sm+aJ7eGM8xsgLGslkygkwbQtMFlhR4Q3SUx+YJk7Fd8zQwtIwL3yOm8vEVx r56mUKP0cYn3Kd9EJTaopqMIyyHW23aXo+k41Zcvf0jvUOxwmyozw12ND2gOQI6A7h3i G43w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Lgt/MJmQ"; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebd5fa7si150816951cf.528.2024.12.24.12.10.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:10:16 -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="Lgt/MJmQ"; 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 ) id 1tQBE2-00026H-Eo; Tue, 24 Dec 2024 15:09:54 -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 ) id 1tQBDZ-00079L-KD for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:26 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDY-0002zP-1e for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:25 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2162c0f6a39so64892305ad.0 for ; Tue, 24 Dec 2024 12:09:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070963; x=1735675763; 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=B8Kb81fRDUd8pwBhno+Gknf2gcOv41osiELdqm6o4Ig=; b=Lgt/MJmQ63Xwe+Ac77FMc9sAUEiFoSCxZYYx+EP+aIn2qKkhPVJL3eq/gkLj6YaCqB vr22VTi5Vz/kroWg3TQ/JBuYMkIBWHRpTURSGIYYuI9mdfmjs7BGLzAr+MxYpEOiv92h PyaCA+UmpOPyZYuuBDgvbumQK9Rv3nunQxbeLrL+md6IDY2b0VLYEw6/0y1FHv6EfQy0 d49rq0l+TqTy/CigU7MJk5V39swjMcDD7k+Db1QTMNTcTvr0aBfO8CmnOzo53yv4GVlF 8YAda8VS1aRY7trkAfR/bbaxqvL6C+i6Imxxp0b3Dg2+jTTy+91R3/0RTbkHmYhaDLqs 4fxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070963; x=1735675763; 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=B8Kb81fRDUd8pwBhno+Gknf2gcOv41osiELdqm6o4Ig=; b=YkneBrW6MAdsVkc0udkaN9cmMjtgGv8pOaiDuaGKhEzMRNbBPT5YMi2rQY+9ZPGIXD ruaoxF2mo/IEMrdHGHUMzcg6ay+V3ZbbtiXgSN1q6akJlhgxrFzbXiu8KoGxWw5xPQ7r gt5d4ixosK1y78Pqx9eTLgsoeocMGSIBpcMcRWciLhfazvHjiIcU17j9wQh3T/O1Ho4U rOsRlRJk8ga9ku7t9MVHLmcT1PCK2gE5ZlqWMl65fy2Hm1WN6eQprerZEk63i1+yeCzT VuM+pwaObnYI9cu3mwUmHshpVbv8xJCRFXNLrccLtw4g++2IZ6HdSiYSkTr/A8gWcNM8 H3Tg== X-Gm-Message-State: AOJu0YxDPR3i4cfWa3sFtqvn9xVF0HAyyB2AjEiAwg9z3SuBYUjz78VL KpsjHyAENlEBIue2CQ4SakEmPVV0ZJk4nkdWNsYdotwAGKI4wwo40jheRS+wWGj+gBrtwg+8o71 pEcA= X-Gm-Gg: ASbGncvf0pbHQPmbx8WmlDy/ZKyNecmi1U1S9DRaooZGYPY7viFCx3qyEpc8VUgixy8 BWU5NRdivLHsQeMxW+l1hHZLdyT49fa8YrQf8b3cPoD04W5bj1cJlpgHrayKRDJHLSDrAQvsx4S PXjCsI7abiPPXb9BSK1fGKxLZVWnRjzhVNJSyFTfN+/0tgngHR33B4Pg8bWW3U0o+vXEvOSUH9n ytcYYCNt8lkfgJNA7X/JRbyZQAZT8YennvLyHk7Et091QGv1UHKQDJxZaxbBf24+XVYBggScG0F DezCrgWUS8sURNHSguSIj8+11Q== X-Received: by 2002:a05:6a00:820c:b0:725:ce39:4516 with SMTP id d2e1a72fcca58-72aa9a3edc8mr28305995b3a.7.1735070962737; Tue, 24 Dec 2024 12:09:22 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 63/72] target/hexagon: Use float32_muladd for helper_sffms Date: Tue, 24 Dec 2024 12:05:12 -0800 Message-ID: <20241224200521.310066-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 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 There are no special cases for this instruction. Since hexagon always uses default-nan mode, explicitly negating the first input is unnecessary. Use float_muladd_negate_product instead. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/op_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 15b143a568..95bfa5d029 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1096,10 +1096,9 @@ float32 HELPER(sffma_sc)(CPUHexagonState *env, float32 RxV, float32 HELPER(sffms)(CPUHexagonState *env, float32 RxV, float32 RsV, float32 RtV) { - float32 neg_RsV; arch_fpop_start(env); - neg_RsV = float32_set_sign(RsV, float32_is_neg(RsV) ? 0 : 1); - RxV = internal_fmafx(neg_RsV, RtV, RxV, 0, &env->fp_status); + RxV = float32_muladd(RsV, RtV, RxV, float_muladd_negate_product, + &env->fp_status); arch_fpop_end(env); return RxV; } From patchwork Tue Dec 24 20:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853237 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082213wrq; Tue, 24 Dec 2024 12:09:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXnlDnm4VW+kA2dzw39DwNyBs211PPBgeCY1X/pVool9JG1VdUtZocwvJ5YDRjkvKY3sZHUEw==@linaro.org X-Google-Smtp-Source: AGHT+IE/OI0uf1J0zLWgccgMAEZM/NDWwYyqlojq5MpsIiE85SzVvhBKW8b+KOXLKE3J/dJqKFvH X-Received: by 2002:ad4:5ce8:0:b0:6d8:8d16:7cec with SMTP id 6a1803df08f44-6dd23397b76mr240998656d6.37.1735070976966; Tue, 24 Dec 2024 12:09:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070976; cv=none; d=google.com; s=arc-20240605; b=clRnO9G5fGMT5oOC18bPmXvRFklAfk6blEoT7uT4K0lM6QA8FpU20WZ/isSm5e2a16 FpL0BEDApNj5XEZwugxLWPU5rLfljP4dZTJx9BbkO/VRrXDu3u+JezdVFsfQ9s9V/qot 6DMqGGmJROhHDJM2i3Jwj52r4Bvj6YsiB+B/GX0XidX8KzHSjezcnsh0C1MazG70h0oA 9E0Bxwj2xR98UFoCqnmamWd0IC8BhOqRAU82/hABqAJnSoHQJAaeQMDmvrDsfB7TRMiC BdWNvTyzuSSkx4n04E+gKxtsPBozBVkSy32ArXJCDMoAv9LxR8ypjnExj8KTliia7XxR diRg== 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=pM1P4H8kwtouAZ2NoWkwRl0qCbuYni4Pia78By+9+hY=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=kq2vQDjhpn8l6b9BHE1JoOE9B4EzCnyWg3SOAo+jk7MVnljZG3tLHLBmU2zf6xXo2E x4Lb7YpbF0TKAVCfMjc9RXSjxxBvENgXgKrhphDy6Zmd4am0RGkBYqDuRqERJyxgcz11 h8Nftz+e88GRgBK/KYGc9YmQQD0r+LONGQAGLqzEMiQaJshXVhJyBluF9yub4FQ9Y+QE tcR8IlQqFVK+W0U8soJ5WLCcdEN9YFuukTa5YAtg/yo5DMNteVYDMbMg5BM83NyA8gbn 0KhG8wCMPWv1to8Y5YyWwy/1A0ECOYcjQbpFV/Z/ah/VKtvemKA8gS7n5jP3h36Mrs7R OtuA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTp3ms79; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd18236652si138786096d6.225.2024.12.24.12.09.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:36 -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=QTp3ms79; 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 ) id 1tQBDi-0007bv-62; Tue, 24 Dec 2024 15:09:34 -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 ) id 1tQBDb-0007DQ-18 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:27 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDZ-0002ze-Hw for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:26 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-215770613dbso41216155ad.2 for ; Tue, 24 Dec 2024 12:09:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070964; x=1735675764; 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=pM1P4H8kwtouAZ2NoWkwRl0qCbuYni4Pia78By+9+hY=; b=QTp3ms79A+LVU76nAD4T4SzLQpRH75f+g+bJmTfbLlrbbniM5d9/AhIKJokpHfCWe/ ITMe5Bb3IAxG28sRl1FW/uQgeksN5EdBdylAhqRPd8a7ISWbDUW1OzT6QblG/PoC5MA3 ALvd/naTSy8cp/dmjIUDVEvEBFD17Z+T2bpemCCe93tCxjhgGomsm43X2d/5bd0cYcjN mQ8G7ybZ8X3yrWAw3FY2Y3EKXV2evTr8f2JhYa3a2wtz7V13vd7sQJEsMm2BU77w04ZL vfKK4wxxJ6B5u/sf0Dr7cHB2rXbgYYKc0/4COKkhvOMB1W+Y0vAxmzn5tjL/RvjbU+e9 tQ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070964; x=1735675764; 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=pM1P4H8kwtouAZ2NoWkwRl0qCbuYni4Pia78By+9+hY=; b=sCmdn2sl2yi+HkkQQH8aqb6GK+SwU6QAwEj6nqxiHplPcf989AR0mW+daPPd54bnGk NPxHX0lLP47KmYABEK8qKQeC86TNqLjlQnRYodTLuktfc/boo90PikqDXF1galxn2YS3 9pGRb13ppOYVJZ/QI3tKJReGj8SThjGBpe2js0GNBTuJkyuDBo4UpD5NPujZQ2OX8902 rXq6xUNcgt4Q/Vz4F7t/UNJruRuLrAR7eqDwNgZMLx1wZN3YivDTTgN+DUbYf0JvzRzW eA2elNdM7/7JUR4/uo85H75C+Chwd6cMJum91r8Hd+CMOytp+2RQtubAl+px5suc/+gA b+og== X-Gm-Message-State: AOJu0Yw4+Mu7+xKHT8lRc1hpL7EPvu87cIX/l+cIxcp9T3LChq0etV8l MI/uuxCP0zlWyJxHTBKi21h316LQwBBSD5tUkZ+HTtX4QRsi6/26Qw53O5tvU14FIkI3SsLcbaQ queU= X-Gm-Gg: ASbGnctOciuU5qvpcXLDXRj85kgVMLydxTe345QYEP4MsTbp0ITBY/qxxpT2u8+pmLK ybCHi7i44HZkkDzXgU34A2zBJFMV41fkuzM8mZWo/36Dpb3v1sMZnrbM5j+3i2dKVG35Npe1I4m 7536bxqXw4wSMz9h/JOeCO9hY3gUn2oDoKqfaFyRVvgCZ2KUhI/PeA5Sc/wGZa9iBVJwFpNlAmK hGLccbIf9e2eC+x7qLId3CpDn+ed88gt/2KXByM2zqenSD6/rFq/ZqHvKI7zeJNGbGPzsBYIw// 1WzixX1U+ebrzeSaH/Ego8h0tQ== X-Received: by 2002:a05:6a00:4096:b0:729:c7b:9385 with SMTP id d2e1a72fcca58-72abdd7bdecmr26688209b3a.6.1735070964271; Tue, 24 Dec 2024 12:09:24 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 64/72] target/hexagon: Use float32_muladd_scalbn for helper_sffma_sc Date: Tue, 24 Dec 2024 12:05:13 -0800 Message-ID: <20241224200521.310066-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 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 This instruction has a special case that 0 * x + c returns c without the normal sign folding that comes with 0 + -0. Use the new float_muladd_suppress_add_product_zero to describe this. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/op_helper.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 95bfa5d029..53c65e852e 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1080,15 +1080,10 @@ static float32 check_nan(float32 dst, float32 x, float_status *fp_status) float32 HELPER(sffma_sc)(CPUHexagonState *env, float32 RxV, float32 RsV, float32 RtV, float32 PuV) { - size4s_t tmp; arch_fpop_start(env); - RxV = check_nan(RxV, RxV, &env->fp_status); - RxV = check_nan(RxV, RsV, &env->fp_status); - RxV = check_nan(RxV, RtV, &env->fp_status); - tmp = internal_fmafx(RsV, RtV, RxV, fSXTN(8, 64, PuV), &env->fp_status); - if (!(float32_is_zero(RxV) && is_zero_prod(RsV, RtV))) { - RxV = tmp; - } + RxV = float32_muladd_scalbn(RsV, RtV, RxV, fSXTN(8, 64, PuV), + float_muladd_suppress_add_product_zero, + &env->fp_status); arch_fpop_end(env); return RxV; } From patchwork Tue Dec 24 20:05:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853255 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082824wrq; Tue, 24 Dec 2024 12:11:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXeezEbV+K8XC3UbSjHRFcmjiFa3MTa8jhUU83OcTGQbWyO2a4ZgfLIvIYNEX3RM1cMwVm1Fg==@linaro.org X-Google-Smtp-Source: AGHT+IEYsIoQjUEiJ87mw/Lrd2lXf802UAkzyRyxSfsQkdF3ozuDyadRJZEJ/yHrCtu1DALs0brI X-Received: by 2002:a05:620a:2992:b0:7b7:2de:6dfd with SMTP id af79cd13be357-7b9ba716d8fmr3278925585a.1.1735071096342; Tue, 24 Dec 2024 12:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071096; cv=none; d=google.com; s=arc-20240605; b=UlY8dM0adnt1V+gcQg5QAxdYynMJX1SfhVPvAVbcw7z/lcCGyDWXohEMpdHNxnMyVX pEYAGktLpwSfqOOVbpWhVg3Y0ikSVCHJpLHG/eag9/Ohh3ljofkqBag7wMJH61eKb1Jf 12As9Zb/6q9/T0hOhksjBAq5K0pxvgEQ8mgMFhkWjsmqYCVCY5n5KR+IesrYK8coFOro i8+QAQaZnfxgy8F2XlWTvtIT+zbtDEnSq0co7n1mNUFNUXXHm/i/fpjZ4mCjaBDJBfWK l1K0hixzrUlkUjcpthcRPzCqpL26AyzuSHYV04TYL3TUuo8QH5Mux3A2fF8x9//YQU4C MDbw== 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=nBCIoQniDOPCXed8/3lUiDnf86jkv18W9RdRy76zZxA=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=jbWaFjlHpCwbmWyFkR59WGIk7m1IO9aNXju6sEqAfZVT0sY7QqJG86GP0E9fnDoaP0 LeLnCNOw46ZnF/TrjXHHGMcijg/0++3/XqWBk/8fHW5U/LL/gUx7bFwEePfLpcfWM0O1 gsgmooNdcuCvPBuzRkJnAUO2EL/uHrtsjSemSo/el1V1619LmoS2Vf4NQbZiGBX2vzjn CqjBs0LRz81P4qF3TWY9Hs+32HoBlzYJqWbMAuzc3w1cE1Fp9Bdg75a8qchzZFMCLRka eFii/H3ga9dGZBYNNZ6Nnssqhrq/5Um1Kyvb/taX1gJs+5C6uHpv8DqILnOXCUhVbX83 P9zQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EpHfixSy; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2d1173si1485358285a.206.2024.12.24.12.11.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:11:36 -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=EpHfixSy; 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 ) id 1tQBEC-0003cw-3u; Tue, 24 Dec 2024 15:10:04 -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 ) id 1tQBDb-0007GO-Tt for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:28 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDa-0002zt-6D for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:27 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21636268e43so70684755ad.2 for ; Tue, 24 Dec 2024 12:09:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070965; x=1735675765; 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=nBCIoQniDOPCXed8/3lUiDnf86jkv18W9RdRy76zZxA=; b=EpHfixSyo8Faa66pziac9HuCTWLYbZrwKwE+1+DQKqGgfzNCo0MEyqVYMrVc0jF2LN N8hDBUFA/B5xTo2yF6oXxlK/TF70sDw1FDGf4rKP+gIXTMGdPu4JkWjDqxOpQIxwgVFT kGCuiVQeDCY8MaCqM5tMBwF4qC4HbmFEpcansymcC9I3TKgBVBNRQ50Zs82fvxAO6Tf+ eutoD+ms8bE/HeYsCPGutqCYb5DpJ9dCy4r4zhcJTilMrHn9oEAjUy7V+jjTKxYr0qmA zMB8xgmAB8koaW6ZocK4qHVklowdO7DoJMKsQvmkwja7vWRtr/6yHFpPUvpofYf/6Onc gPdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070965; x=1735675765; 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=nBCIoQniDOPCXed8/3lUiDnf86jkv18W9RdRy76zZxA=; b=GpvF71tyVDeHW6pDcfHSoIY6lyeJWwQ/cCVZ793t7l4ErNnZdjXjaZI9zoFSx+89kB 8fBkuiKWhNciYVITuvb2xynnouP65kujfV5oWSVYGVWJY/eCYpR9vTol9qlih0a7fRzU qU+1nGCx29RaPkJyINaCAcYoNnib+4p/ufbHTUfkWsAI2p7sllAdV54yg0DVrJT+xXZ0 IGpllbO8iTRfMFRNlQ5FxW1NNHnxUOCVXXmHhYiIIw9o/peC7UUivFvbhUQeHSSq6OF6 M/uN6d21QtYBkxlHx3AVWRQyvfwG9gwba7bm+Y1Aaik51pE1Iz8hqFY2tz1SVm/emwuJ r0TA== X-Gm-Message-State: AOJu0YxZYfckSUcHJfu++/uEdgBFb2J6IT+AtEoV/oKKOMzzmAafAZJr b+j4siBBVXrK4vhT7e8QO/PrqEf0QHzbYYpuBAsX/85fc/u+FQQ5YaPq5xXedJBpknH9SVxntIi SZqY= X-Gm-Gg: ASbGncvjpxdV5kdn7/Yy2miZCm9XW/2oQTJumjtUAyQgG6ZsR2tBX5kVqGjUhClqRe2 rGBSzKJtxZdmeLzYJ9hYMjf9lvQEtBBdwXqAX5jg4PZ3lRO/GPyFFaxzP9Xza8c1z5t5GnTIaSO aCY4b+H38Z/X8P7tfpXbG9xxBZ6V63O2zwq735LBfYQAu1GVHt5cdhULaUv6B9P+GTV/hcM9uaY w1oYZ9mhjVLasAirqbJOyEZDqEmyWjf11rNiTca475Q3a9ywVMxjanTnPyPB4h6pTefadctmsxu lS6FMt7ajJP0vdhyE0TzwHiZwQ== X-Received: by 2002:a05:6a20:6f06:b0:1e1:9ba5:80d8 with SMTP id adf61e73a8af0-1e5e080df22mr25488906637.33.1735070965000; Tue, 24 Dec 2024 12:09:25 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 65/72] target/hexagon: Use float32_muladd for helper_sffm[as]_lib Date: Tue, 24 Dec 2024 12:05:14 -0800 Message-ID: <20241224200521.310066-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 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 There are multiple special cases for this instruction. (1) The saturate to normal maximum instead of overflow to infinity is handled by the new float_round_nearest_even_max rounding mode. (2) The 0 * n + c special case is handled by the new float_muladd_suppress_add_product_zero flag. (3) The Inf - Inf -> 0 special case can be detected after the fact by examining float_flag_invalid_isi. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/op_helper.c | 105 +++++++++---------------------------- 1 file changed, 26 insertions(+), 79 deletions(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 53c65e852e..6da8db8ea5 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1059,24 +1059,6 @@ float32 HELPER(sffma)(CPUHexagonState *env, float32 RxV, return RxV; } -static bool is_zero_prod(float32 a, float32 b) -{ - return ((float32_is_zero(a) && is_finite(b)) || - (float32_is_zero(b) && is_finite(a))); -} - -static float32 check_nan(float32 dst, float32 x, float_status *fp_status) -{ - float32 ret = dst; - if (float32_is_any_nan(x)) { - if (extract32(x, 22, 1) == 0) { - float_raise(float_flag_invalid, fp_status); - } - ret = make_float32(0xffffffff); /* nan */ - } - return ret; -} - float32 HELPER(sffma_sc)(CPUHexagonState *env, float32 RxV, float32 RsV, float32 RtV, float32 PuV) { @@ -1098,78 +1080,43 @@ float32 HELPER(sffms)(CPUHexagonState *env, float32 RxV, return RxV; } -static bool is_inf_prod(int32_t a, int32_t b) +static float32 do_sffma_lib(CPUHexagonState *env, float32 RxV, + float32 RsV, float32 RtV, int negate) { - return (float32_is_infinity(a) && float32_is_infinity(b)) || - (float32_is_infinity(a) && is_finite(b) && !float32_is_zero(b)) || - (float32_is_infinity(b) && is_finite(a) && !float32_is_zero(a)); + int flags; + + arch_fpop_start(env); + + set_float_rounding_mode(float_round_nearest_even_max, &env->fp_status); + RxV = float32_muladd(RsV, RtV, RxV, + negate | float_muladd_suppress_add_product_zero, + &env->fp_status); + + flags = get_float_exception_flags(&env->fp_status); + if (flags) { + /* Flags are suppressed by this instruction. */ + set_float_exception_flags(0, &env->fp_status); + + /* Return 0 for Inf - Inf. */ + if (flags & float_flag_invalid_isi) { + RxV = 0; + } + } + + arch_fpop_end(env); + return RxV; } float32 HELPER(sffma_lib)(CPUHexagonState *env, float32 RxV, float32 RsV, float32 RtV) { - bool infinp; - bool infminusinf; - float32 tmp; - - arch_fpop_start(env); - set_float_rounding_mode(float_round_nearest_even, &env->fp_status); - infminusinf = float32_is_infinity(RxV) && - is_inf_prod(RsV, RtV) && - (fGETBIT(31, RsV ^ RxV ^ RtV) != 0); - infinp = float32_is_infinity(RxV) || - float32_is_infinity(RtV) || - float32_is_infinity(RsV); - RxV = check_nan(RxV, RxV, &env->fp_status); - RxV = check_nan(RxV, RsV, &env->fp_status); - RxV = check_nan(RxV, RtV, &env->fp_status); - tmp = internal_fmafx(RsV, RtV, RxV, 0, &env->fp_status); - if (!(float32_is_zero(RxV) && is_zero_prod(RsV, RtV))) { - RxV = tmp; - } - set_float_exception_flags(0, &env->fp_status); - if (float32_is_infinity(RxV) && !infinp) { - RxV = RxV - 1; - } - if (infminusinf) { - RxV = 0; - } - arch_fpop_end(env); - return RxV; + return do_sffma_lib(env, RxV, RsV, RtV, 0); } float32 HELPER(sffms_lib)(CPUHexagonState *env, float32 RxV, float32 RsV, float32 RtV) { - bool infinp; - bool infminusinf; - float32 tmp; - - arch_fpop_start(env); - set_float_rounding_mode(float_round_nearest_even, &env->fp_status); - infminusinf = float32_is_infinity(RxV) && - is_inf_prod(RsV, RtV) && - (fGETBIT(31, RsV ^ RxV ^ RtV) == 0); - infinp = float32_is_infinity(RxV) || - float32_is_infinity(RtV) || - float32_is_infinity(RsV); - RxV = check_nan(RxV, RxV, &env->fp_status); - RxV = check_nan(RxV, RsV, &env->fp_status); - RxV = check_nan(RxV, RtV, &env->fp_status); - float32 minus_RsV = float32_sub(float32_zero, RsV, &env->fp_status); - tmp = internal_fmafx(minus_RsV, RtV, RxV, 0, &env->fp_status); - if (!(float32_is_zero(RxV) && is_zero_prod(RsV, RtV))) { - RxV = tmp; - } - set_float_exception_flags(0, &env->fp_status); - if (float32_is_infinity(RxV) && !infinp) { - RxV = RxV - 1; - } - if (infminusinf) { - RxV = 0; - } - arch_fpop_end(env); - return RxV; + return do_sffma_lib(env, RxV, RsV, RtV, float_muladd_negate_product); } float64 HELPER(dfmpyfix)(CPUHexagonState *env, float64 RssV, float64 RttV) From patchwork Tue Dec 24 20:05:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853273 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084892wrq; Tue, 24 Dec 2024 12:18:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUBacEzMO8pn8ffoPM+OQ+FX5G84SOny+9BDzR9JBizuoGV9QOQ0M9xvhOMs4Pruk7tH9cUcg==@linaro.org X-Google-Smtp-Source: AGHT+IEtazUXifpL0Ku2/1Sgp6D5Qy4yMMfhGyr1wfwYolkKvVEAeY+hPKl1Jn/9I0ujlODCUGhr X-Received: by 2002:a05:6214:629:b0:6d8:b81c:ecc1 with SMTP id 6a1803df08f44-6dd235cb32fmr253087906d6.13.1735071509373; Tue, 24 Dec 2024 12:18:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071509; cv=none; d=google.com; s=arc-20240605; b=cfYZnytUvfA+aLDkg97dGwCeuuYz2LtYxVEc5saTgkPHxxUw0ALRgL2C10UD5znIna 8cLPGsqlyRL4f8CC+QmwkxYJsfL196L8ISxaUKIlbSsPlkCrRj0ChIKnTCTxY4oc+Vg9 qDar8Sa+0fXKa8rsvf3VpZIHJYYg+4zOIhH31hxFqffyTfLDKBTQ0HCvILzF+TJMu9FT BFq1B/1+PQFVrLQ8FZWTJp9bppYfeUo9BMPNLmnAsEE1rmPWZDTpZnptmwEA/yVwSyp3 c3jIodtONYjjetMlpCLK5XRhJwSBAYEGGbsQusXtqDF99abXcH+SPNdVcFKde+uC3gWN wblg== 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=dy+3YRybYCVi0eIJERcGpwApxyCnVCsmSJWB/vHW2XY=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=fNrugb69+/KhLdn1/wXa2ETshDq0KhNivwJeWc8q1EezukIMl38eAhYFMuBG/YjySF Q8HXxr3Rztcc6B9e15eKBeWyxm+KzLd7A68UecmIvSANi4JQFc+FDhRWagg8xO/7Vq2i jWnUUpnqW9RyLdeOP/CBIWM99/ldMPMvo0B+uLQuDmtQgTrnj93RRqYQn3OqQXO9QWCm YYqyZ3TRvp68B/jBJt/jaaDQCwsz2LRGVxgJ1T54ll860/Pe5/l40zwAjrhrIHafzdnw rcHPzRffvk9xfq5Ke5c+m/4+MvUpTdiPXFgMg/n35IXQY8rBQFgW8zFAujj+yHfPQt+W s6vg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NgTKV4kn; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1835b690si154497156d6.427.2024.12.24.12.18.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:29 -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=NgTKV4kn; 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 ) id 1tQBE8-00035Z-B4; Tue, 24 Dec 2024 15:10:00 -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 ) id 1tQBDd-0007My-64 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:29 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDb-000308-AN for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:28 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-21631789fcdso47000835ad.1 for ; Tue, 24 Dec 2024 12:09:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070966; x=1735675766; 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=dy+3YRybYCVi0eIJERcGpwApxyCnVCsmSJWB/vHW2XY=; b=NgTKV4knx93IpOboC1wfD3xgDIY27mRt9vFeqAfMatOPhyRjeMQ2WxOd4KbiWuRPV3 YAO2dbCm9mXqQSAMXnrsKx8l+YPlUKLwHzp9yiLyJk1k84YNeZGQtXqaf+c53E6xzyO8 cK+uEu+FMu7oDQT1t1zVxibuBNbT67RRhLrIxEUCFeY6tjdYo6J4oSK5yJyKc/26mTsI qE3u5wbT2u9hL3nvL6ZVJE0lJ8ckxuVBy6PTJI2qrXgOMAYKhET45V9Hx1SpfQZeVn7j e2R+BxdG+hF2bM3Ze3LdOMsFEZZ8naxBCtPvDtodS7FCgPNSiXDVzhvGHjX0btnSeSoZ m22Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070966; x=1735675766; 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=dy+3YRybYCVi0eIJERcGpwApxyCnVCsmSJWB/vHW2XY=; b=oYQYdyeQEqqTerpNd8VGUwx296gTBhvccsOUKOZZyByc2Bgk6Q5VxJQVjJR1MXwt1j +sp+fYREQoWX9475pW/Swu/QE/G5sPZxgWm9ywHTxu0nTAqo21Y8DcHdlO9a4PdUrWhO Y5lZQ8Sa+9xdLBz6a4+YEb+HjvOs6pXH0QeVhPm1wuCXAtvG2Xk0Y6ZS/wrpw/+k3DrE Dr0n5yyirG6oO3K9Dv9V5lR9r55cTcsS1l0/vDDE3zr66PvCHVkaoc/Xu4R0x+OYHdPL nmeo6YXKPVTK+fWYf/NeOSwhyK6Afc7BMVziAALeKQtrJ+C31VQxQPZQC15C5ZGrj6rd 4oxg== X-Gm-Message-State: AOJu0YwqfzPrGThAGQTPj84MjH6tr0yMN6EW2lzAkDUK7tWxp7B0qrps cCmQzGz+Fv3eTjaZaRFtjOM1pa5BofZ9i+ml/sEHuhl5N+U62DZKSg4DzrEPh2amvxdttD6T/rM TLJU= X-Gm-Gg: ASbGncu2jeb7OcvSdFl6BSJA3TQb01hg5ImrakFnXITe3BjE2A2IrOafapfkE7GB1W1 2Kf+nQ/9eU2bdcanKgJwhUO044Pqp3WDHG2YJK2OfqjDOOw6ZVJrowzgsScfEBVx6tjmrs0TIuM jJDadhGBG3gmY8yvmrL+0o7EL3TRlHqfrnJ0/8qfhzbVgghBptjU9QhRqSzhtpPlY0ycqTwX+dk qnL1rLeXrFRpDKrYFUG/+CuzTxpEBaUX0CP6D5Ufiwt4qRumZTxDA1WcznDqLqJL1PWi375vvD1 g4ZKjZBaEyXqs9VDKTbXjjmKEg== X-Received: by 2002:a05:6a21:3989:b0:1d9:a94:feec with SMTP id adf61e73a8af0-1e5e1e0460bmr29793862637.2.1735070965943; Tue, 24 Dec 2024 12:09:25 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 66/72] target/hexagon: Remove internal_fmafx Date: Tue, 24 Dec 2024 12:05:15 -0800 Message-ID: <20241224200521.310066-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 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.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 The function is now unused. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/fma_emu.h | 2 - target/hexagon/fma_emu.c | 171 --------------------------------------- 2 files changed, 173 deletions(-) diff --git a/target/hexagon/fma_emu.h b/target/hexagon/fma_emu.h index ad5df5d038..fed054b609 100644 --- a/target/hexagon/fma_emu.h +++ b/target/hexagon/fma_emu.h @@ -30,8 +30,6 @@ static inline uint32_t float32_getexp_raw(float32 f32) } int32_t float32_getexp(float32 f32); float32 infinite_float32(uint8_t sign); -float32 internal_fmafx(float32 a, float32 b, float32 c, - int scale, float_status *fp_status); float64 internal_mpyhh(float64 a, float64 b, unsigned long long int accumulated, float_status *fp_status); diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index 35971b8b99..0c7c7f636c 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -90,21 +90,6 @@ int32_t float64_getexp(float64 f64) return -1; } -static uint64_t float32_getmant(float32 f32) -{ - Float a = { .i = f32 }; - if (float32_is_normal(f32)) { - return a.mant | 1ULL << 23; - } - if (float32_is_zero(f32)) { - return 0; - } - if (float32_is_denormal(f32)) { - return a.mant; - } - return ~0ULL; -} - int32_t float32_getexp(float32 f32) { Float a = { .i = f32 }; @@ -369,25 +354,6 @@ float32 infinite_float32(uint8_t sign) } /* Return a maximum finite value with the requested sign */ -static float32 maxfinite_float32(uint8_t sign) -{ - if (sign) { - return make_float32(SF_MINUS_MAXF); - } else { - return make_float32(SF_MAXF); - } -} - -/* Return a zero value with requested sign */ -static float32 zero_float32(uint8_t sign) -{ - if (sign) { - return make_float32(0x80000000); - } else { - return float32_zero; - } -} - #define GEN_XF_ROUND(SUFFIX, MANTBITS, INF_EXP, INTERNAL_TYPE) \ static SUFFIX accum_round_##SUFFIX(Accum a, float_status * fp_status) \ { \ @@ -517,143 +483,6 @@ static SUFFIX accum_round_##SUFFIX(Accum a, float_status * fp_status) \ } GEN_XF_ROUND(float64, DF_MANTBITS, DF_INF_EXP, Double) -GEN_XF_ROUND(float32, SF_MANTBITS, SF_INF_EXP, Float) - -static bool is_inf_prod(float64 a, float64 b) -{ - return ((float64_is_infinity(a) && float64_is_infinity(b)) || - (float64_is_infinity(a) && is_finite(b) && (!float64_is_zero(b))) || - (float64_is_infinity(b) && is_finite(a) && (!float64_is_zero(a)))); -} - -static float64 special_fma(float64 a, float64 b, float64 c, - float_status *fp_status) -{ - float64 ret = make_float64(0); - - /* - * If A multiplied by B is an exact infinity and C is also an infinity - * but with the opposite sign, FMA returns NaN and raises invalid. - */ - uint8_t a_sign = float64_is_neg(a); - uint8_t b_sign = float64_is_neg(b); - uint8_t c_sign = float64_is_neg(c); - if (is_inf_prod(a, b) && float64_is_infinity(c)) { - if ((a_sign ^ b_sign) != c_sign) { - ret = make_float64(DF_NAN); - float_raise(float_flag_invalid, fp_status); - return ret; - } - } - if ((float64_is_infinity(a) && float64_is_zero(b)) || - (float64_is_zero(a) && float64_is_infinity(b))) { - ret = make_float64(DF_NAN); - float_raise(float_flag_invalid, fp_status); - return ret; - } - /* - * If none of the above checks are true and C is a NaN, - * a NaN shall be returned - * If A or B are NaN, a NAN shall be returned. - */ - if (float64_is_any_nan(a) || - float64_is_any_nan(b) || - float64_is_any_nan(c)) { - if (float64_is_any_nan(a) && (fGETBIT(51, a) == 0)) { - float_raise(float_flag_invalid, fp_status); - } - if (float64_is_any_nan(b) && (fGETBIT(51, b) == 0)) { - float_raise(float_flag_invalid, fp_status); - } - if (float64_is_any_nan(c) && (fGETBIT(51, c) == 0)) { - float_raise(float_flag_invalid, fp_status); - } - ret = make_float64(DF_NAN); - return ret; - } - /* - * We have checked for adding opposite-signed infinities. - * Other infinities return infinity with the correct sign - */ - if (float64_is_infinity(c)) { - ret = infinite_float64(c_sign); - return ret; - } - if (float64_is_infinity(a) || float64_is_infinity(b)) { - ret = infinite_float64(a_sign ^ b_sign); - return ret; - } - g_assert_not_reached(); -} - -static float32 special_fmaf(float32 a, float32 b, float32 c, - float_status *fp_status) -{ - float64 aa, bb, cc; - aa = float32_to_float64(a, fp_status); - bb = float32_to_float64(b, fp_status); - cc = float32_to_float64(c, fp_status); - return float64_to_float32(special_fma(aa, bb, cc, fp_status), fp_status); -} - -float32 internal_fmafx(float32 a, float32 b, float32 c, int scale, - float_status *fp_status) -{ - Accum prod; - Accum acc; - Accum result; - accum_init(&prod); - accum_init(&acc); - accum_init(&result); - - uint8_t a_sign = float32_is_neg(a); - uint8_t b_sign = float32_is_neg(b); - uint8_t c_sign = float32_is_neg(c); - if (float32_is_infinity(a) || - float32_is_infinity(b) || - float32_is_infinity(c)) { - return special_fmaf(a, b, c, fp_status); - } - if (float32_is_any_nan(a) || - float32_is_any_nan(b) || - float32_is_any_nan(c)) { - return special_fmaf(a, b, c, fp_status); - } - if ((scale == 0) && (float32_is_zero(a) || float32_is_zero(b))) { - float32 tmp = float32_mul(a, b, fp_status); - tmp = float32_add(tmp, c, fp_status); - return tmp; - } - - /* (a * 2**b) * (c * 2**d) == a*c * 2**(b+d) */ - prod.mant = int128_mul_6464(float32_getmant(a), float32_getmant(b)); - - /* - * Note: extracting the mantissa into an int is multiplying by - * 2**23, so adjust here - */ - prod.exp = float32_getexp(a) + float32_getexp(b) - SF_BIAS - 23; - prod.sign = a_sign ^ b_sign; - if (float32_is_zero(a) || float32_is_zero(b)) { - prod.exp = -2 * WAY_BIG_EXP; - } - if ((scale > 0) && float32_is_denormal(c)) { - acc.mant = int128_mul_6464(0, 0); - acc.exp = -WAY_BIG_EXP; - acc.sign = c_sign; - acc.sticky = 1; - result = accum_add(prod, acc); - } else if (!float32_is_zero(c)) { - acc.mant = int128_mul_6464(float32_getmant(c), 1); - acc.exp = float32_getexp(c); - acc.sign = c_sign; - result = accum_add(prod, acc); - } else { - result = prod; - } - result.exp += scale; - return accum_round_float32(result, fp_status); -} float64 internal_mpyhh(float64 a, float64 b, unsigned long long int accumulated, From patchwork Tue Dec 24 20:05:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853242 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082333wrq; Tue, 24 Dec 2024 12:09:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXQFdkcd09AOKvbFGwsmulXm0JCiJlChheNTY7RpiOMJmG2+GvvcdsgCj4Qqj6WK3QCFfN3/Q==@linaro.org X-Google-Smtp-Source: AGHT+IEmK4aiRPa/KoyvbI6sVd8itZr7ytSIFthqm3RGURcqIqpa74MKEPNbw0bz0ZYrn/mnCyJL X-Received: by 2002:a05:6214:1c43:b0:6d8:8d16:7cf3 with SMTP id 6a1803df08f44-6dd233a10f5mr303780886d6.40.1735070997691; Tue, 24 Dec 2024 12:09:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070997; cv=none; d=google.com; s=arc-20240605; b=PgmT6yAY5XVcgIWt1puatihgQqh7y/36ZG18HDQIWWNhn7VxhAe1iTylPoN33V3MQt IvbDQYTWT6P6dv+LxJ7Dvujzc9d0tuHNROiVCswYsMD/4zCT5TI1/ynWnPivH06GTuy5 UZTYBoolWcSM7PTO6jiSbPc0XlOgyaV5KrFt3rdSQk2KI/PoUqoguF3PKypvz5PXkFdc hnwSmq85w8le4dP8gnF1Jil6FuQ4cpDVIRf1MFZHiv7VP3TYiMqChjZuS9ihRzNNzOkT Kvgqg+1/T9HVcUf4YNVg6amB0q2PNatJ5p2oJ8Nrszl/k2+vSiqXFFCVz7B5DETT62rr CO7A== 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=VTkbR01xtg3cDFd0zyp26LRPzyNskPHkgWCn6SCa0AE=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=N9A10fUYuymHiivkuaH6yqLhxn655WbG+sqEYNqqKS7UIH/UX+dukyGiWD6TF3FZMd 5ua34uupY51yXrFUw1arjL1fU40Pj0MgFSlxsuEaZJDMnGEzWZWp8vTBMnvsrmS1BVsR 9Ys/dDRmcGAPzzQCtJDP7TqpH2Yko3gMsqP9N7Y9WC7c3/V1d/aX/hDoAr4TzAQPgiFo me608bwEGaQ1g+C3wTLYiLxozp5j+u8EzaSkY0DXswIXQqBwghflDyuWzIA05S8llB3Y vSKPN25vBWmF55jntjdsQTp+ARw0WHq2rwN4FQEL//HyKsQ27xfEOHS8ERlSs3DkLLf/ 8j9g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I48sZ0fa; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1836f6bcsi141118236d6.524.2024.12.24.12.09.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:09:57 -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=I48sZ0fa; 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 ) id 1tQBE2-0002GU-P2; Tue, 24 Dec 2024 15:09:54 -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 ) id 1tQBDe-0007Rc-UB for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:31 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDc-00030L-Fw for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:30 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2161eb95317so58726815ad.1 for ; Tue, 24 Dec 2024 12:09:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070967; x=1735675767; 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=VTkbR01xtg3cDFd0zyp26LRPzyNskPHkgWCn6SCa0AE=; b=I48sZ0fa0E6WgeRWAJUJ9ayu5wg2OiF8jY2rhPLjBf0ixPyqICXd+oye8dgYPkOykk RnIWHYzKGwjq5t/0egSyQNHdInJjngpp9EkoPmOf3U3GAh4dnoa8Zm3egDnefGSYSHKv lrZx5xVSc28ir3HQXPudeP/WOQw7QUUl3V8DKX2ajQqzB5TPlcRgK3Qs30Iu9JWIX3rT ejHLBkTegQzsfGk4BY7AlBHAKYDF2FZV5OzjrES9POnfiP7zRkO0LDcuXlQ+Qk18YrUu V38qymSeUVRYITNJj6f3V3nLxgD8HF3c7quy4TukEuHhPfjE682Rn1WgTmwzbKAzU7Fc bjug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070967; x=1735675767; 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=VTkbR01xtg3cDFd0zyp26LRPzyNskPHkgWCn6SCa0AE=; b=ON2dbLb3MvSoC/3I53bhX6769ydzOKqGnlb4tZHFluTu/kvWX2W2UOXQjEsPDasO/A 7TCthvtX4FH8ShIlouxg7FM10IvCJtqJ9napyi7ut+IMfNj2519EJda1INXUTVmFTWvN cnE3aOxIFmuyuWgeQ9+OnS3urMPcqdCf9MaWnMw9XAszyai1MpBpDGvh6sYBBgAJhpQT +Zpiq7TX9A2oTCnJPDgCD1ZhtSVs3hWBm0WCLP+MV4QEaA7UoqvsT3S79VqQXZu9z4WW pW7IkdMmjbYOkWAIxPcAed3gixlXQcJjre/SESjvOf7h1QjBiq8nlokkvoVVljJKVR8f 168Q== X-Gm-Message-State: AOJu0YzRLPyoGEWpLPIWQH35/IQjUFDL3aeXOdbMjiJGS//0LtP+8LKW lkLNF0siPMETUaPmEcbyTWEiPs5SQOmETfr7q0K4AVnF6OeOT5ZOTSYzTu5xDo50oWNSDYwg8UW Lq3U= X-Gm-Gg: ASbGncuDcta8kgEdZPAjMGrhQ4YdnaTISr4lGQS6NtCYHNPR+qDsoP9ee2TMnaMBMSt G+2M66Zl9JMR1hhOi840F7UYoNUEZ1Q0fYxFmizwopJMDtvvWIvDSszK7rWIM+mTjoqCWWLLORX 75li3m/iIsXGuMIwwO5PUhLhjGm3wBpnWBc66qNuBKOWIBKXBsossCmkTyPblPjnu6byTcisOMq 85nw/6ENLeYM8XUh8WMRV1/oRpD4oanzpE51purTRMa4rARcGWcRHQmjhQpSlGURvOdlqcdhBGS EfMGs4u+hwSUGTT9fmakYffc3g== X-Received: by 2002:a05:6a21:900e:b0:1db:ec0f:5cf4 with SMTP id adf61e73a8af0-1e5e081c8bbmr27968235637.39.1735070967175; Tue, 24 Dec 2024 12:09:27 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 67/72] target/hexagon: Expand GEN_XF_ROUND Date: Tue, 24 Dec 2024 12:05:16 -0800 Message-ID: <20241224200521.310066-68-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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: 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 This massive macro is now only used once. Expand it for use only by float64. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/fma_emu.c | 255 +++++++++++++++++++-------------------- 1 file changed, 127 insertions(+), 128 deletions(-) diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index 0c7c7f636c..0769de43de 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -354,136 +354,135 @@ float32 infinite_float32(uint8_t sign) } /* Return a maximum finite value with the requested sign */ -#define GEN_XF_ROUND(SUFFIX, MANTBITS, INF_EXP, INTERNAL_TYPE) \ -static SUFFIX accum_round_##SUFFIX(Accum a, float_status * fp_status) \ -{ \ - if ((int128_gethi(a.mant) == 0) && (int128_getlo(a.mant) == 0) \ - && ((a.guard | a.round | a.sticky) == 0)) { \ - /* result zero */ \ - switch (fp_status->float_rounding_mode) { \ - case float_round_down: \ - return zero_##SUFFIX(1); \ - default: \ - return zero_##SUFFIX(0); \ - } \ - } \ - /* Normalize right */ \ - /* We want MANTBITS bits of mantissa plus the leading one. */ \ - /* That means that we want MANTBITS+1 bits, or 0x000000000000FF_FFFF */ \ - /* So we need to normalize right while the high word is non-zero and \ - * while the low word is nonzero when masked with 0xffe0_0000_0000_0000 */ \ - while ((int128_gethi(a.mant) != 0) || \ - ((int128_getlo(a.mant) >> (MANTBITS + 1)) != 0)) { \ - a = accum_norm_right(a, 1); \ - } \ - /* \ - * OK, now normalize left \ - * We want to normalize left until we have a leading one in bit 24 \ - * Theoretically, we only need to shift a maximum of one to the left if we \ - * shifted out lots of bits from B, or if we had no shift / 1 shift sticky \ - * should be 0 \ - */ \ - while ((int128_getlo(a.mant) & (1ULL << MANTBITS)) == 0) { \ - a = accum_norm_left(a); \ - } \ - /* \ - * OK, now we might need to denormalize because of potential underflow. \ - * We need to do this before rounding, and rounding might make us normal \ - * again \ - */ \ - while (a.exp <= 0) { \ - a = accum_norm_right(a, 1 - a.exp); \ - /* \ - * Do we have underflow? \ - * That's when we get an inexact answer because we ran out of bits \ - * in a denormal. \ - */ \ - if (a.guard || a.round || a.sticky) { \ - float_raise(float_flag_underflow, fp_status); \ - } \ - } \ - /* OK, we're relatively canonical... now we need to round */ \ - if (a.guard || a.round || a.sticky) { \ - float_raise(float_flag_inexact, fp_status); \ - switch (fp_status->float_rounding_mode) { \ - case float_round_to_zero: \ - /* Chop and we're done */ \ - break; \ - case float_round_up: \ - if (a.sign == 0) { \ - a.mant = int128_add(a.mant, int128_one()); \ - } \ - break; \ - case float_round_down: \ - if (a.sign != 0) { \ - a.mant = int128_add(a.mant, int128_one()); \ - } \ - break; \ - default: \ - if (a.round || a.sticky) { \ - /* round up if guard is 1, down if guard is zero */ \ - a.mant = int128_add(a.mant, int128_make64(a.guard)); \ - } else if (a.guard) { \ - /* exactly .5, round up if odd */ \ - a.mant = int128_add(a.mant, int128_and(a.mant, int128_one())); \ - } \ - break; \ - } \ - } \ - /* \ - * OK, now we might have carried all the way up. \ - * So we might need to shr once \ - * at least we know that the lsb should be zero if we rounded and \ - * got a carry out... \ - */ \ - if ((int128_getlo(a.mant) >> (MANTBITS + 1)) != 0) { \ - a = accum_norm_right(a, 1); \ - } \ - /* Overflow? */ \ - if (a.exp >= INF_EXP) { \ - /* Yep, inf result */ \ - float_raise(float_flag_overflow, fp_status); \ - float_raise(float_flag_inexact, fp_status); \ - switch (fp_status->float_rounding_mode) { \ - case float_round_to_zero: \ - return maxfinite_##SUFFIX(a.sign); \ - case float_round_up: \ - if (a.sign == 0) { \ - return infinite_##SUFFIX(a.sign); \ - } else { \ - return maxfinite_##SUFFIX(a.sign); \ - } \ - case float_round_down: \ - if (a.sign != 0) { \ - return infinite_##SUFFIX(a.sign); \ - } else { \ - return maxfinite_##SUFFIX(a.sign); \ - } \ - default: \ - return infinite_##SUFFIX(a.sign); \ - } \ - } \ - /* Underflow? */ \ - if (int128_getlo(a.mant) & (1ULL << MANTBITS)) { \ - /* Leading one means: No, we're normal. So, we should be done... */ \ - INTERNAL_TYPE ret; \ - ret.i = 0; \ - ret.sign = a.sign; \ - ret.exp = a.exp; \ - ret.mant = int128_getlo(a.mant); \ - return ret.i; \ - } \ - assert(a.exp == 1); \ - INTERNAL_TYPE ret; \ - ret.i = 0; \ - ret.sign = a.sign; \ - ret.exp = 0; \ - ret.mant = int128_getlo(a.mant); \ - return ret.i; \ +static float64 accum_round_float64(Accum a, float_status *fp_status) +{ + if ((int128_gethi(a.mant) == 0) && (int128_getlo(a.mant) == 0) + && ((a.guard | a.round | a.sticky) == 0)) { + /* result zero */ + switch (fp_status->float_rounding_mode) { + case float_round_down: + return zero_float64(1); + default: + return zero_float64(0); + } + } + /* + * Normalize right + * We want DF_MANTBITS bits of mantissa plus the leading one. + * That means that we want DF_MANTBITS+1 bits, or 0x000000000000FF_FFFF + * So we need to normalize right while the high word is non-zero and + * while the low word is nonzero when masked with 0xffe0_0000_0000_0000 + */ + while ((int128_gethi(a.mant) != 0) || + ((int128_getlo(a.mant) >> (DF_MANTBITS + 1)) != 0)) { + a = accum_norm_right(a, 1); + } + /* + * OK, now normalize left + * We want to normalize left until we have a leading one in bit 24 + * Theoretically, we only need to shift a maximum of one to the left if we + * shifted out lots of bits from B, or if we had no shift / 1 shift sticky + * should be 0 + */ + while ((int128_getlo(a.mant) & (1ULL << DF_MANTBITS)) == 0) { + a = accum_norm_left(a); + } + /* + * OK, now we might need to denormalize because of potential underflow. + * We need to do this before rounding, and rounding might make us normal + * again + */ + while (a.exp <= 0) { + a = accum_norm_right(a, 1 - a.exp); + /* + * Do we have underflow? + * That's when we get an inexact answer because we ran out of bits + * in a denormal. + */ + if (a.guard || a.round || a.sticky) { + float_raise(float_flag_underflow, fp_status); + } + } + /* OK, we're relatively canonical... now we need to round */ + if (a.guard || a.round || a.sticky) { + float_raise(float_flag_inexact, fp_status); + switch (fp_status->float_rounding_mode) { + case float_round_to_zero: + /* Chop and we're done */ + break; + case float_round_up: + if (a.sign == 0) { + a.mant = int128_add(a.mant, int128_one()); + } + break; + case float_round_down: + if (a.sign != 0) { + a.mant = int128_add(a.mant, int128_one()); + } + break; + default: + if (a.round || a.sticky) { + /* round up if guard is 1, down if guard is zero */ + a.mant = int128_add(a.mant, int128_make64(a.guard)); + } else if (a.guard) { + /* exactly .5, round up if odd */ + a.mant = int128_add(a.mant, int128_and(a.mant, int128_one())); + } + break; + } + } + /* + * OK, now we might have carried all the way up. + * So we might need to shr once + * at least we know that the lsb should be zero if we rounded and + * got a carry out... + */ + if ((int128_getlo(a.mant) >> (DF_MANTBITS + 1)) != 0) { + a = accum_norm_right(a, 1); + } + /* Overflow? */ + if (a.exp >= DF_INF_EXP) { + /* Yep, inf result */ + float_raise(float_flag_overflow, fp_status); + float_raise(float_flag_inexact, fp_status); + switch (fp_status->float_rounding_mode) { + case float_round_to_zero: + return maxfinite_float64(a.sign); + case float_round_up: + if (a.sign == 0) { + return infinite_float64(a.sign); + } else { + return maxfinite_float64(a.sign); + } + case float_round_down: + if (a.sign != 0) { + return infinite_float64(a.sign); + } else { + return maxfinite_float64(a.sign); + } + default: + return infinite_float64(a.sign); + } + } + /* Underflow? */ + if (int128_getlo(a.mant) & (1ULL << DF_MANTBITS)) { + /* Leading one means: No, we're normal. So, we should be done... */ + Double ret; + ret.i = 0; + ret.sign = a.sign; + ret.exp = a.exp; + ret.mant = int128_getlo(a.mant); + return ret.i; + } + assert(a.exp == 1); + Double ret; + ret.i = 0; + ret.sign = a.sign; + ret.exp = 0; + ret.mant = int128_getlo(a.mant); + return ret.i; } -GEN_XF_ROUND(float64, DF_MANTBITS, DF_INF_EXP, Double) - float64 internal_mpyhh(float64 a, float64 b, unsigned long long int accumulated, float_status *fp_status) From patchwork Tue Dec 24 20:05:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853266 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4084607wrq; Tue, 24 Dec 2024 12:17:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUqRoEgaMYvLYFkCU34WTFrlST6UEsvmu8jEx8yTdBDX0+8QdgUNdz3eTcwTao0WdVT4KN1sg==@linaro.org X-Google-Smtp-Source: AGHT+IEKui9rFkrrdKnJXapprM+m4gMKlcLJVJCFw+71KcjzaAmjNfHfJm0dsr41a/5zucUQNnji X-Received: by 2002:a05:622a:1822:b0:466:8e3a:e6cb with SMTP id d75a77b69052e-46a4a8ea644mr265823271cf.29.1735071446160; Tue, 24 Dec 2024 12:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071446; cv=none; d=google.com; s=arc-20240605; b=kPaEz39oHQW6tJdBW1yTQ6c9KtlCGgPjUKBt374rfavDs3XyOPXY3hxJl/SVLdmWvx GylovyQvXrG2cq4da78aAEYvRhSiBrRJSnw8cPIJimlw4Iece94yzvUp6a2FN4vAm2XQ wo2FeQMjUXrYV5BLr6NOXD6ut0lY2aklHlCyaNvS90Ja4jNjVEYYwzE4FKm/R0TLiR1P 8DreQTzTu1Oox/rTnvLPy7LyyrnXudOskV9c3fqw7PPTwEJGpb8Zi+vRBwqSKKJnxhMR HplhgOISYrrWmpSPuT210Y3fwkofKYAfN8CeSL7TghZtCmezNBR37Ozracw3tjR76ioA x/kw== 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=RKTTrx8B/icquGiBXqUA5XkQlJqGmYAEi37JaPi9ziQ=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=hU+/m0RBsXY+/9yQBXmPkPQTtx9u6+7eXQXZI+3N5cgS4wl5dlamLXlGxKXdoUEMl0 effFP8atB/nHCkxthTqGHGL2i8FqBtKfmtEMdsSmHdlAdT9XVVs1g0439Fu7FMdfMU3i k7Fu97YLn20omoJWH2FLXklY/b6DwMHKlobvUu5ns1obWM6qEGKW46WaP3bl9twluG1j RZwmi8AgsWy+Hd3KApIWkf45oLijyLYnIvShfIYVPdynodpEGfTJhtBYr53cUS+X44Tn sc0mear3OLSv2Eb6Pmzglnkcc0IObf+SyTKqgUtyhjCJzoyZkXKEh6CLGHZAwYYYHefr X9cg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FBjx8nIW; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a46f172fcsi138816421cf.173.2024.12.24.12.17.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:17:26 -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=FBjx8nIW; 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 ) id 1tQBDv-0001F3-Rp; Tue, 24 Dec 2024 15:09:48 -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 ) id 1tQBDf-0007TQ-Er for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:31 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDd-00030Y-UK for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:31 -0500 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2ee397a82f6so5866840a91.2 for ; Tue, 24 Dec 2024 12:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070968; x=1735675768; 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=RKTTrx8B/icquGiBXqUA5XkQlJqGmYAEi37JaPi9ziQ=; b=FBjx8nIWslRurdSEhHxyqL00uZZjCLvPBbPOZ/K1wXFUgH5X3d61Je5wnD8Tx55Pf/ zD/8lLWJfWKW1iWyNtDBW1tPY5GRs7DKXS28fFzV9NlEhwrhSYDDSd7bsqCV6NkAQiPT V0Q2IUcq7KAP5J6uGpuQ6WHTH5p+CTAvVzo7gtWRglMhF3/h3/Hbi92Og6PjKsr2QkX5 ubV3hSmPHmcQLgm/NfydpDJuWojIgE/QSj2tewTT7qd0fGMUV8a1oceRoCsC4AuwnTip CHLL+lhZKgj8LsqN0bMGttZEmGHB0xbMdYCDw1oOzUwN8H0DjA+vMne20ZlwSHOpp4a7 kICw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070968; x=1735675768; 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=RKTTrx8B/icquGiBXqUA5XkQlJqGmYAEi37JaPi9ziQ=; b=uXv7eQcUNplo7HsSBMZtENa2xdfiz01N/ke3wf1JZvqgqX2B2xOLjIbQXwhW4rmT38 EDWAJ85YSWFxCYjMDdWV5KG7WbuUEP7mpm99COxhb0MRKJD3izBkqgBLn4R5SZfOIcD7 GuyS6g0fZbuZBmB8Mt9DxoOIgR75WKx4EU3WRsIBs87mwQp84H+BjhQjJBjjku3kkWrc BnKJ6seBttkaJje5LRGkfFoqY6XECTbJl5Vwjzw9hPdh11PRg/ToQnFdReoF0PpS1Cr3 SIMUJNAcBFJ3hipxHpiyWg6N64gyH5vmy17qteLu3RmPzBAzLOfdaprKM/XHe56pr01v Q8rQ== X-Gm-Message-State: AOJu0YyHWRgHUQGri8Pi5feWYy6wS6RB8zqVnkcGHRTR7FD4ABJBEXKI H1WRVPXSkEE3UNoRTzcuxu6UgeCdswAS7CMWXIF6NZazSjbkHC9vSP1D664zATy38dmCpxv9A61 XVhU= X-Gm-Gg: ASbGncuCj2vPSVDU8iqbFdXoQTJywUzGV8pCeo10UpUQLZ0L8gXlfc7r4KaRK5jyCpH 0qBGymPmRe2BrLQA9eVPR3NCDyV3RRZFdJ5sphGK2gkUUyRiaTaYQSygFnCY78xj2Sjr5yoirRw 5rTJShfaMPeecsuMHvCRp5R5ZfMBKuxDXDvVTQUzFU7GSGUvwz2ZQ2bBOaN3ooaSyVZBVSGqDcN s1R7SJKGuqn5LJC5HPYDifIn1d4JJW75R4r6wB3/s1tj+DnNBRg/5A9VMyLiV4h1UaIDZsj/MQl QBXc6OlTe8hQfIacDkTwuZnrxw== X-Received: by 2002:a05:6a20:8427:b0:1e0:ca95:3cb2 with SMTP id adf61e73a8af0-1e5e0458eb9mr32037304637.8.1735070968572; Tue, 24 Dec 2024 12:09:28 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 68/72] target/hexagon: Remove Float Date: Tue, 24 Dec 2024 12:05:17 -0800 Message-ID: <20241224200521.310066-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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: 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 This structure, with bitfields, is incorrect for big-endian. Use the existing float32_getexp_raw which uses extract32. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/fma_emu.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index 0769de43de..2a8f72fee3 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -53,16 +53,6 @@ typedef union { }; } Double; -typedef union { - float f; - uint32_t i; - struct { - uint32_t mant:23; - uint32_t exp:8; - uint32_t sign:1; - }; -} Float; - static uint64_t float64_getmant(float64 f64) { Double a = { .i = f64 }; @@ -92,12 +82,12 @@ int32_t float64_getexp(float64 f64) int32_t float32_getexp(float32 f32) { - Float a = { .i = f32 }; + int exp = float32_getexp_raw(f32); if (float32_is_normal(f32)) { - return a.exp; + return exp; } if (float32_is_denormal(f32)) { - return a.exp + 1; + return exp + 1; } return -1; } From patchwork Tue Dec 24 20:05:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853261 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4083803wrq; Tue, 24 Dec 2024 12:14:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV1yRsh4vVOlZipIIR+KHBIIc/4mySsqTzVIj1ZAwI3iSXfN0f5zqoo8ZhLO3cujvT2FTSCdw==@linaro.org X-Google-Smtp-Source: AGHT+IFn0tLN2FbSvPyMwLw2pVS3fzLPDpuE5z+nkLsH21ILlSk7WHrPjh+13VzxbdSqg15TJ2QU X-Received: by 2002:a05:6214:2264:b0:6d8:ae2c:503a with SMTP id 6a1803df08f44-6dd233af4f9mr274229026d6.48.1735071287888; Tue, 24 Dec 2024 12:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071287; cv=none; d=google.com; s=arc-20240605; b=WF7vH1cVXttYXOkh1uH3qlCtyYCkFVzpTvMjZdlMt2nSfKmFtE02mud5umSKBNOfWt Q2KjaOZmDXNEGmpOuW1EPIx3R6TzM3G4HiTbB89rU9NLwz0pXFRkfZH9beMUscWEzTUN ctkFovd3n/f0fJINDbuX3ZiAnu8TwvFvgIgsZyTBKtKtIDpfA8fsQT9dfJu+gmgp4cFV 70DcWM6vG/ApYvNXM0sftzVf96eHIWd1HLcHxbtQVJ9q9XUhY26T87G1FZ3//JsVW6Rr fho1791SI3A9gZ2e6I/HdT+DkOYD1Gid+laUPrS6tQ/kKIF1m23XcfYtklgPp8wMCDLo SKXA== 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=zmgwYYyv+juXwg/CgaDAXGKo2B+5k9ACWJHCK3pXUJ4=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=DvPJLP9wXFp5z8fTOdsGutALww3OEBPwPxkU1hz2C2rfG89yDRbIMzpWzxXQUlVOEJ nm6ru+ts9Rlq86MFvozZG37KQPcVfcVQhh4NlOL5RKMAaQSlf9mTYYWRhFem1XYzpesl ZuE8yVEhWCiXnENfZsXp1KuFHPUZxJdGMTIz54ltROzD3fhIi3VOWR43iXDEjlOcOL23 d8jd+V9AOpbJqjWdnUKcEw/4xbNRfasKCIvkphT519a1uYOOddcurzzleUpjB/BJnlWz Dg2HoAO8OL2QYfpSAb8ayGNaQFfGnGeCDF7z1UqX/f4wsXtVmJ2jUbq4oVnhPB+Wca+P fFdA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HL7R1URW; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd18138e2bsi157950436d6.178.2024.12.24.12.14.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:14:47 -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=HL7R1URW; 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 ) id 1tQBDz-0001eE-T7; Tue, 24 Dec 2024 15:09:52 -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 ) id 1tQBDg-0007Wn-Qr for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:33 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDf-00030k-0U for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:32 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-21675fd60feso73587425ad.2 for ; Tue, 24 Dec 2024 12:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070969; x=1735675769; 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=zmgwYYyv+juXwg/CgaDAXGKo2B+5k9ACWJHCK3pXUJ4=; b=HL7R1URW8hSYKtS8mqC7XPJm3HLZ53Ggibg5hmtTiG9DAUnzfRO0iU9khoiSQc4hd/ hZyFzx3aoyThexULHkC7cvtJiyUs8mFxW+X49ulvEwmpFmBchctfWVbozd1Njf1LODyw 7L2Wc3oT6rGqlQMgltMDDEeejCHpcbRWlVf3PmXjytR6k6R5xhh7QCbOrvjcOjmFCc6G iVMXIdv2+W1yrzwQ9LysXOdplZezbq6LgjgQVTunz04ZtNBGKgW8Ulw29PUIvAtcy/SJ ItBjMotDVWDiA4a1sHEuX3kx79w+p4A+xDKK8HbnIuvOUrOXCk0dcznY0N0FB06garrE h3AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070969; x=1735675769; 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=zmgwYYyv+juXwg/CgaDAXGKo2B+5k9ACWJHCK3pXUJ4=; b=bUCIX/elFqyw1NGyrEEkBVzOzW1q1IXpk5McZ0HZDBGZZt4I52odqV25/CSSxE6Q2k moe9ovb9gwR3ERDzxg8hbbjUwIUkvBib/mwtNMo9vkJYoaWYVulkmTpMa6ljwGh5DCra dU7Qnl2xqSHiFmP9T0UMrzXEPt0whb9HgVluOqSRemSrU43qVQDXX/h8fVmGqvO+bGlP MX2FtYTH4EA+RxxGgUuRTXRMPZ/uOzHhpSwDQARh5zxCqDNHra+cZmDYwKpjuydm3qpp gbfy/46r2OV8WS9bNBRHAC5Q6qN0OToZC3HY8f+5tPLhDjfqSfB9M4bDALGBsqcZ6XGS Whmw== X-Gm-Message-State: AOJu0YxT66L0OjJCJFWQmkZ1P6cQ2ghN3ZLdV6wW+0h4KeD+5TBea5NF CusoX8hkHsCMPAls4CzqWRQ6P83SAcY/+btcZxv5e1xTaqxYWrfvRrFoUcx0rxkFB3CRNsqxmdc vT9o= X-Gm-Gg: ASbGncuYRURORK0eSSBDvjkuasB1wMc1ivOmi/9WyhDHaiUidN/hS1j4QBu0JMJR0im bFGUMsLU4UbMDaT7CTFrWDBG6mq3ap1JfExvrlPGdUlnJkheRPP2WoYpwHDX2zwz0ybTzyLLvdF 9h10i8mPbb4OQ1IX7dlbLU2ZsKG06aGi8UD2cb6i610YX4eK2jUmpBkm1ioZ10At5rQG2NYDLVY 9XuifzvAWVGy8HHdhndqtOz+y2tnB5tZUyAF/KPR91yr2m07QCfErrzHE1E9/prJRpSPeoXH9Ey ZKm+XAgN+ChzndBBvch4ItEUbA== X-Received: by 2002:a05:6a20:7289:b0:1e0:d4f4:5b39 with SMTP id adf61e73a8af0-1e5e04a0ee8mr31050261637.24.1735070969558; Tue, 24 Dec 2024 12:09:29 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 69/72] target/hexagon: Remove Double Date: Tue, 24 Dec 2024 12:05:18 -0800 Message-ID: <20241224200521.310066-70-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 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 This structure, with bitfields, is incorrect for big-endian. Use extract64 and deposit64 instead. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/fma_emu.c | 46 ++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index 2a8f72fee3..ddc793fe14 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -43,39 +43,29 @@ #define WAY_BIG_EXP 4096 -typedef union { - double f; - uint64_t i; - struct { - uint64_t mant:52; - uint64_t exp:11; - uint64_t sign:1; - }; -} Double; - static uint64_t float64_getmant(float64 f64) { - Double a = { .i = f64 }; + uint64_t mant = extract64(f64, 0, 52); if (float64_is_normal(f64)) { - return a.mant | 1ULL << 52; + return mant | 1ULL << 52; } if (float64_is_zero(f64)) { return 0; } if (float64_is_denormal(f64)) { - return a.mant; + return mant; } return ~0ULL; } int32_t float64_getexp(float64 f64) { - Double a = { .i = f64 }; + int exp = extract64(f64, 52, 11); if (float64_is_normal(f64)) { - return a.exp; + return exp; } if (float64_is_denormal(f64)) { - return a.exp + 1; + return exp + 1; } return -1; } @@ -346,6 +336,8 @@ float32 infinite_float32(uint8_t sign) /* Return a maximum finite value with the requested sign */ static float64 accum_round_float64(Accum a, float_status *fp_status) { + uint64_t ret; + if ((int128_gethi(a.mant) == 0) && (int128_getlo(a.mant) == 0) && ((a.guard | a.round | a.sticky) == 0)) { /* result zero */ @@ -455,22 +447,16 @@ static float64 accum_round_float64(Accum a, float_status *fp_status) } } /* Underflow? */ - if (int128_getlo(a.mant) & (1ULL << DF_MANTBITS)) { + ret = int128_getlo(a.mant); + if (ret & (1ULL << DF_MANTBITS)) { /* Leading one means: No, we're normal. So, we should be done... */ - Double ret; - ret.i = 0; - ret.sign = a.sign; - ret.exp = a.exp; - ret.mant = int128_getlo(a.mant); - return ret.i; + ret = deposit64(ret, 52, 11, a.exp); + } else { + assert(a.exp == 1); + ret = deposit64(ret, 52, 11, 0); } - assert(a.exp == 1); - Double ret; - ret.i = 0; - ret.sign = a.sign; - ret.exp = 0; - ret.mant = int128_getlo(a.mant); - return ret.i; + ret = deposit64(ret, 63, 1, a.sign); + return ret; } float64 internal_mpyhh(float64 a, float64 b, From patchwork Tue Dec 24 20:05:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853276 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4085019wrq; Tue, 24 Dec 2024 12:18:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVpb/L0bu9tXNW05AWec8+jNCihoA5oNauak8sBM/srRp4Yqk8bySJv/poJeUAoGEB0rwGKRw==@linaro.org X-Google-Smtp-Source: AGHT+IHyWOz6ZiUo6VcW9L2l4mWweFXfFIfFXzxfG5ADx6h4pTKXuGuY8PZdkr6tqcqUjuCOUEM5 X-Received: by 2002:a05:622a:253:b0:46a:389d:17ac with SMTP id d75a77b69052e-46a3b0c28a3mr332583941cf.27.1735071534619; Tue, 24 Dec 2024 12:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071534; cv=none; d=google.com; s=arc-20240605; b=XLBm3zm35twvzKkhtWYvytNAwyqWEgzzl9bjJF4ZB0UxsJtTZZYP3nQvMA7RzZA932 /CiFPBLNg3CP2KFb++fnsIPNuzGNrMIa5BIlJFLUZ1/ZUYWBSR3J2bXxoVRcq/jCfxyE 2mCa/+vu1fBxq6Jfyat8NfXznVPlm0O7cxlpQhyETYhF1WwYO1M8RTark+1Lfx5M0Yyq gVEdRa3jJaD1M3pUkdNwpllm/gLUl/ZnyWVjEUed9uHiZBlO3o3c3kH79Al9TYaH2cE8 dOKkzG7OkKe6KfVLGVvKaS5f+j1JXSdyu4sASl4TkeOkXZRRMvdGBvpkR1nP3F19afqH PA0w== 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=F3y+AMSb8rvB6VTUgl6UjDCiMyf5UHg9L6oBAf1WE4w=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=YhgsOZEL/n5jX6A8/h/DRpOvtkxUza/2eXN7II4xZExRz6hpvUY9EE97CLiRiv+thQ v64rp7ZJYE4Za7W8Q4lKbyci7XNjV7PXrBtC+gu5HM2qCmlRssDRjN7tJG47L1yzlDuY 25d7GS/pkYRYSs+61CcmITgkR7hpfXi1S4n5nADvuToQalkRQywt4bZVg2mGGKu0n+b7 8t8XKsU9dQ8Nn+veRRQxeUuZpwOYkvh7BhrHp5/L5IjHexjNWCFgtNar5qMMURhqX9wR gIUN/LW68lKIRpTZCxxRIGLEOgEH23Oesq1nzmgRgFtHL0ZxiGaD4tq1pT61SSiQdEpf /Pqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QRF+WSyt; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3e680e90si154850421cf.113.2024.12.24.12.18.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:18:54 -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=QRF+WSyt; 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 ) id 1tQBDs-0000fH-0g; Tue, 24 Dec 2024 15:09:44 -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 ) id 1tQBDh-0007cC-JG for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:34 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDf-00030x-Ro for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:33 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21631789fcdso47001165ad.1 for ; Tue, 24 Dec 2024 12:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070970; x=1735675770; 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=F3y+AMSb8rvB6VTUgl6UjDCiMyf5UHg9L6oBAf1WE4w=; b=QRF+WSytAizZEVmDGUAhMK9zkDw4TEbThe4XS++5AIS9IWhEaINDFsii7hflDkHdgy ifb+AszHk8hQUcLJnrc5D6azXz4vuq3KsPDvXJXCK4d85/TxE10xiMnPQHqAWfj2kLv1 hiUvxBloaQofBvVACArluwBRsLzLEXwL1vvWoq9m1IyAfIiwsWplWM04TvOzFvAH5v/B E8AyZUT9EpdcW1EWha6tzDVClB1C3oGSf9eQqbXBFJL3y7TYjm4g+VwDb+qoL3Wf8/UA 9UCIPQ2NNNp7luSMD/Pku3pbyrn6S0peORnnhcFoOEND/468nj0dd2kkVYg/w+yVPOFz WLLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070970; x=1735675770; 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=F3y+AMSb8rvB6VTUgl6UjDCiMyf5UHg9L6oBAf1WE4w=; b=g/6Z5GuR44NQ0zgL6XVz0R9GHrXFAGH9nwLF1Vk7UOWXxAcqdBdFkz+nHlSY0SKoLE 5IYocgaGuNNeS8ewPkbh9X4BMSRpQR2GoX9Hja2TdlDoRXKxu3BS3wOXqeKwvWn9g/sK TP67NvOoUws2TTwihPigLhunefzBbbV0S5a5K8D/qyxdVo/8iAh6ArKf4l2gX+UxZW2S sSlTtFvm6o4hI1jNi0jU3pwQ8XUk9sSjOfkP0shXuI+FqCIsh3Mh627HlvstD/M/F6pt g0AIgINhwfu4nd8X2jYItXFvGN1WXcOq6ddIXVYKHEC5fum9o94y7zyr0LehaLm5rari TrUg== X-Gm-Message-State: AOJu0Yygs2Hk6fhxqhbTy6LXZeNwzmL8RNZ1SAo7jmDdPLXKTMk2WTw2 9JJ06PdJWZYphjssEqg23XuXBjNTg5VmGKsSFCSPsMT4++YSHP2WbQ36NxkwDMkdyZ24uVmjiDQ 1WQc= X-Gm-Gg: ASbGncsIP+2VIXn36HZBqtfctf1YeehRzzRUnwpg5FZcgFdjaHB6seJ3MgkKQggjAQi MdFakmMPNqU9uiIw5HeE9Vs4rsY8NHNU8XB0dG5gNfLtcSYB5j7OASmuMl60hNqVBFQyehsYQ9F smoS37cjd9Z3nh/TFcCjm6B0yfm6EbSQymTvYgCtF6dpdlHdXI9nKMzSTPTDorW2VB+Kxy0XOBa ViuGi20OCFM3Y8yNpoJpRJjRI7QYXKwGrPSgcso0t8SBdAao/DWMk3FRQbGwfATpuJuRX8k+MQ6 tPeQ6KXpsiwnp/LbS/n9Tt0bmQ== X-Received: by 2002:a05:6a00:66cb:b0:725:41c4:dbc7 with SMTP id d2e1a72fcca58-72abdae93e4mr26701042b3a.4.1735070970632; Tue, 24 Dec 2024 12:09:30 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 70/72] target/hexagon: Use mulu64 for int128_mul_6464 Date: Tue, 24 Dec 2024 12:05:19 -0800 Message-ID: <20241224200521.310066-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 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 No need to open-code 64x64->128-bit multiplication. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/fma_emu.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index ddc793fe14..07d2880776 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -82,38 +82,12 @@ int32_t float32_getexp(float32 f32) return -1; } -static uint32_t int128_getw0(Int128 x) -{ - return int128_getlo(x); -} - -static uint32_t int128_getw1(Int128 x) -{ - return int128_getlo(x) >> 32; -} - static Int128 int128_mul_6464(uint64_t ai, uint64_t bi) { - Int128 a, b; - uint64_t pp0, pp1a, pp1b, pp1s, pp2; + uint64_t l, h; - a = int128_make64(ai); - b = int128_make64(bi); - pp0 = (uint64_t)int128_getw0(a) * (uint64_t)int128_getw0(b); - pp1a = (uint64_t)int128_getw1(a) * (uint64_t)int128_getw0(b); - pp1b = (uint64_t)int128_getw1(b) * (uint64_t)int128_getw0(a); - pp2 = (uint64_t)int128_getw1(a) * (uint64_t)int128_getw1(b); - - pp1s = pp1a + pp1b; - if ((pp1s < pp1a) || (pp1s < pp1b)) { - pp2 += (1ULL << 32); - } - uint64_t ret_low = pp0 + (pp1s << 32); - if ((ret_low < pp0) || (ret_low < (pp1s << 32))) { - pp2 += 1; - } - - return int128_make128(ret_low, pp2 + (pp1s >> 32)); + mulu64(&l, &h, ai, bi); + return int128_make128(l, h); } static Int128 int128_sub_borrow(Int128 a, Int128 b, int borrow) From patchwork Tue Dec 24 20:05:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853251 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082808wrq; Tue, 24 Dec 2024 12:11:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWfTlWE+QIQW1+dkvaaHGHwr+7RIxfIz2tkJFppe76YQv4/8zfs03P9pl/chLCp+U+Y1XCnWw==@linaro.org X-Google-Smtp-Source: AGHT+IFQgXsQZ9A6x4cbObmR47e7I6sIZV5LyRpUoW4M4N0cxZfD5UW2osnvsF4/qqd8lUHN/Anb X-Received: by 2002:ac8:5889:0:b0:461:7558:892f with SMTP id d75a77b69052e-46a3aff2c2bmr397621271cf.15.1735071093188; Tue, 24 Dec 2024 12:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071093; cv=none; d=google.com; s=arc-20240605; b=jFWQ6Xc+VEMCh1AVcooKhP+xcufGvXPJe9Us1Lx2aAl/GVhc4+jspy7kkcGDoz6zBd 2Jf0JfHKw37VM2YKOXuxmLJ8HNyZLXqrqo8E5c5L9Rt8rMLh5UhRdd60jHcZ2/zxdZPz spnIQjLn/ZBGVH50wm+avi7RM2JEF+41RNIyYAgRwZbKguqQPyubE/uwkHh8u5+mXFnm xeEba69WUY95FLx4kvcNxukCK1WL7UIqYxlOP4KGVLwRFbYt8/jP8cbJeqkq3S+TtcEn JBgHNRhmoHGieIe02IiFTmBlcaYQMReCDDx90nU2y6QoeAE2ilVTQqk/AvEy7lL6RgIP ZWHg== 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=gqH8fYhzwspoKRTd/2StonIkPkTT7XOo4RkleZm+9sc=; fh=erpJr+t1J1nk7LsZaPa1TvOu4e//VqKoadf7h5wHEDQ=; b=YLxi96fRhFOPgT6h5LSb/DtIVQbYFnLptafKiJcEYsiUsDfHM/HSbg6tKhjdbHfE8l n+wyjbYTrOM4Z04DyS9DSfiJf2EMWwsWy2gAViv2gr6zXUdl3Ks5OA3QSJkN29Wf4VJ+ 8O3ii6ROfXW1uUPbd0/4fAE26YWCyc/FWttdE8okcTgytYUH0FWzkbtRR+AVc+59sNBr 6saFqJwYbbS/K/d3yiwC126yv483mS9IX6T8fUZn8oUycB0d4tGc5Dx2I/Za2L71kRMZ vBFHEolCMghRpU3oA7wJN8kOFXYXLaw/iQXwi1u7FnFCmGzLuJYLZEd9NVCnJxP7Ofu1 t5gg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kVQpUWLD; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ec0656asi146703431cf.701.2024.12.24.12.11.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:11:33 -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=kVQpUWLD; 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 ) id 1tQBEU-0004Ux-0w; Tue, 24 Dec 2024 15:10:27 -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 ) id 1tQBDi-0007hJ-J8 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:34 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDh-00031C-1E for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:34 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2162c0f6a39so64893235ad.0 for ; Tue, 24 Dec 2024 12:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070972; x=1735675772; 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=gqH8fYhzwspoKRTd/2StonIkPkTT7XOo4RkleZm+9sc=; b=kVQpUWLD97v8QJGh8/M1Fp5P1mO3ne91LHuWaru6Xwpiep3Cjnd67WrieFH32PEGdx Jp0b5HA8D+dwllI99Zqw/dNDeOcl7o7H479WBkwqAHjTUoJBFDme9HS4jQPLedtvPSQ9 8VPiBc5ZYz/ql4Cccb+pnbi7xtXvj14cvCa8A51SjeCjLof+MpyhlgE3JyB8PTrTTm/J AbamsRl2R8QJl5dOLoI6q+eORKpb7eNK3+boGGicqEJNUjqo4qVyRuX3DLkPmUX9VLI4 zhqvSjgRdGFzidzMUjMg67MLbUJbvK/Zo9e4B6XpNoJCk9p7S1P+Qus7CXllQApj5t/X uiLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070972; x=1735675772; 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=gqH8fYhzwspoKRTd/2StonIkPkTT7XOo4RkleZm+9sc=; b=gGn8DdWpbBTKL+O579BQ7pzptMzD3O2N+T4y75vzIeuE0WBt9vMY40j4JCaGbKTj6B INseUsUzVkPpnYfpTKkP1i0Q55nY2rCq8qZPWjaYIt+KcBpr++OBjna0MkgMi9QjZE9y 8bjtl1UZMyp0WyyOu87HXzyiNmfo3Y7+RknjhN1nabYTafTsk2X/M5mvAFGICgKBlh0w MYxTTqm7lT0JOjL16CnxpJbt30KpV2mWh8WvOExBpNqVQQ6kLKle3diQ78Ht4T3JLmta DMDPP3tGd8Wl5k3zPC7VO29N0F+F/uqY9z3VrwQruLFRQ1BZj1k9eqHInURSOyQpLpKz HRnw== X-Gm-Message-State: AOJu0YxV3ddDYnpijZVyj0eAXkwLhDFPe6tDEFqUOwEZwliysHbqCT0c y04eNtlzttiZ/ddoJwjL0hx3noCclQ6ASKK0hQHd4b4ls0YLTa6tUzYP5o5YvkJG6HAV53CVFon ymK0= X-Gm-Gg: ASbGncvnu2ub1Wg7jDgx70w31yc5VGJse9EYo4QWnumkuwkymLlPhq/WSuC8tR579ZM /LBc5fMSAm+gLxbeLZyRJr1fc56Zx8uCH11VEI00usj9jZE2WcQ74vP+yhSjLEWhg2ROL8Eyq25 4L/aTXPFPxFOi9VOzcALw+lNvnYwSs1GUCQbpEjXMRyghglHSdyt/tiFArhCJc9LsG9S/gwHPv7 MAznHifrn2r8iyb4yYgRo94mzUemXs6barx3jgPrtPYwIlq6jvzvaoEPm5LHIdYhPdmR/JBHFRg /k2b6nDTDzucdhqAwgLrqAqBjA== X-Received: by 2002:a05:6a20:a122:b0:1e1:b220:63db with SMTP id adf61e73a8af0-1e5e1f56b34mr29072796637.16.1735070971709; Tue, 24 Dec 2024 12:09:31 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brian Cain Subject: [PULL 71/72] target/hexagon: Simplify internal_mpyhh setup Date: Tue, 24 Dec 2024 12:05:20 -0800 Message-ID: <20241224200521.310066-72-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-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.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 Initialize x with accumulated via direct assignment, rather than multiplying by 1. Reviewed-by: Brian Cain Signed-off-by: Richard Henderson --- target/hexagon/fma_emu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index 07d2880776..c557141f11 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -455,7 +455,7 @@ float64 internal_mpyhh(float64 a, float64 b, float64_is_infinity(b)) { return float64_mul(a, b, fp_status); } - x.mant = int128_mul_6464(accumulated, 1); + x.mant = int128_make64(accumulated); x.sticky = sticky; prod = fGETUWORD(1, float64_getmant(a)) * fGETUWORD(1, float64_getmant(b)); x.mant = int128_add(x.mant, int128_mul_6464(prod, 0x100000000ULL)); From patchwork Tue Dec 24 20:05:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853253 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4082810wrq; Tue, 24 Dec 2024 12:11:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVja/vaa/ykdRG9gpkSQ3SgHsXStah3TmiuN+0GgWEH1a+YxOqCh4lIJSBW0HSlB4uQe5Xjzg==@linaro.org X-Google-Smtp-Source: AGHT+IFJNRXH1XJ4vySfs1bdvt6o64Omm37DnSNZtcrcyv6qaWiLnyFBk1MCw4QYiukry/gqlky3 X-Received: by 2002:ad4:5d4e:0:b0:6d8:8fdd:9797 with SMTP id 6a1803df08f44-6dd2339d938mr261697136d6.36.1735071093435; Tue, 24 Dec 2024 12:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735071093; cv=none; d=google.com; s=arc-20240605; b=hfjlw1HD7I5DA2N9Xeu2PnZSs2FVoMzcxv8tejVBMdXNfO5MWfJVXtY4QDqLqKZw6u V2DEev9hMQP5sDc4Kpfb1Yf3owy4eJ0jeZcVfffcGzcRazGjMrFIR5aBTO+UoMCI/YDM eu24Vdu4TfAVbBv6hWSKzsQrfNdA5cL+ZnspLf0oGI4UY+24S9+we65lO7IgfFgH2XRe kP+o37BenFsjBjxEihVvPwFRX1A77P3bBn3omirMUzeZbO5pbDi1XwmeL8nWiKyEGbEA OpJmJxivOme2M38QEQC/UTXfzKit53AX65fABLl0As/QdOO+YMaIZ98Mqvt/AVUzEMZx gAjg== 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=jQjeFmlwXi1lZLuV5C0dso81HNv2ocXCvP6mdxjNCCQ=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=ZZU7FED7ymfghlMEHSpeGi/PVg11nCyx3/Qc65A5JSYmTk5MP5hBxj8FI5yzKxS6v7 EbKg9cHpfTx/XNxGgMnGVy75P8A0Cw1ufysMKQp9mpZlN2QZWIaPsbeH8NXcCQzk+7TA bHDoWJ0WHtbbEN8w4gDN+rClJ5qSXx3Z2BfTcRhxusZlgpM6g/Gnvptw06TMtynAoNn0 mVMZ4a6Ud2eF67FTvf6p6f+mTVHzQWjuXF2G5V0hGzYpu+m7l6Pu1uHpEW4QDdKI2zuQ dONKPsykFV8g3HSiw0+ilUWNyx4bVmnfZtzC4t3JgjoVI0UjyY1pqWXXVUfn8c4HSc9R gjrQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xKElD0MA; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebbe3ddsi131872311cf.394.2024.12.24.12.11.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:11:33 -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=xKElD0MA; 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 ) id 1tQBE6-0002Vx-Ip; Tue, 24 Dec 2024 15:09: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 ) id 1tQBDm-0000Df-G8 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:38 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBDi-00031X-IL for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:09:38 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-21628b3fe7dso53770415ad.3 for ; Tue, 24 Dec 2024 12:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070973; x=1735675773; 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=jQjeFmlwXi1lZLuV5C0dso81HNv2ocXCvP6mdxjNCCQ=; b=xKElD0MArl+oIbQFDe/mPSA6zVyDJ2lE5cZBxqg21hY7Sr5DwD6RAT48vyXO+y6YTe u81dqP5nK/qMAgfopmvvgVeFqRQGJEIUsZDK3B8bXazYYbldCFiJ+7EcRBvACDoxUM3Q yOe0iycTJdrpnrlB98tp11cC84zH8nlDugLXyFatKtNq8UxDylmOdF6GBJJCW8yH6JHM Q6qG+16VWjyrAsGYxBSeA2gHM/kQVe42rsXhiioS2BAr8T4WbuA/jsqts3l4XmcwuadL goF1OTg0AB7XckvRkoO5p/dDa4xHroTQdC7M9inLW6cUMKRNyGmkXfh5q4WUJKNs2lHL KSKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070973; x=1735675773; 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=jQjeFmlwXi1lZLuV5C0dso81HNv2ocXCvP6mdxjNCCQ=; b=iyzI/27iZ3QfxFC48/sAl8ceyf6R2mjpKr9Uds/0ZqYh9yZ07t/wg0N+WZV7LssQ+9 i1cNFhQaXPMs7qwdCxlR71NaafJ6O6/9nUMukg6F87LqDTgUrTrns+BIHy+h1HpDNt16 INPay3t2LA0y/9nam3AaVrm5QxY2kduVHpnK4T5i2FkFR1PvVIUHup+vFyCDTkNmlvcx nycXRTbwQcwOCm974zjh7f7IPUC7MlYCgcRPMwVu2o4HvRDN+URnqRfrO3QPeE50jTDN EZCWexUWbyk0xm4qT4ct18pyo3aDqrojNMWescrHLWAmdpBlMyY9p7C786hDrPMR6lKA +tQA== X-Gm-Message-State: AOJu0YyXhwNnf9rLwEraqZ1Nf2obXZqScKgppEXTJpQIpXE4qDYyVYpA eJ7XMD5bj4yxU5xzn1N4ki2HFqrUrxTEeFBr5tG7sAlzsGWwKUJ2geNpCDcQMe7UMZCq2MIor9t pl1M= X-Gm-Gg: ASbGncs55qzkVXUZVz2P9ToMLipNPX+QiquGgwvK6g1oZa7pWEYjT2GS9RWAkVqW/xQ j+W/dGBdRZaNRsSeCFGmIHnltDm2KgDYE2P/HPoj0S6HBuo3HLUlBk3wHRkQK9OfCECaIogV9Ez v4URHeJ08bCu2poBzQybimaTYXYRnJnOlOyGqA+WffrcHFLTFdpTp9JupDC7Zr9HObJ7cmQSC2i GSjio71T+uVOyPfIH6jV0uhvKzuj22U0GR8LHZpMPEicE4BQTEwpTfMMaod0kdna+tzL4NdhmHF jqgZaaMiwnZN1nqYuKB60JmLUw== X-Received: by 2002:a05:6a21:100f:b0:1e0:d848:9e83 with SMTP id adf61e73a8af0-1e5e07a853amr28932876637.25.1735070973033; Tue, 24 Dec 2024 12:09:33 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8309acsm10033521b3a.45.2024.12.24.12.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:09:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 72/72] accel/tcg: Move gen_intermediate_code to TCGCPUOps.translate_core Date: Tue, 24 Dec 2024 12:05:21 -0800 Message-ID: <20241224200521.310066-73-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: 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 Convert all targets simultaneously, as the gen_intermediate_code function disappears from the target. While there are possible workarounds, they're larger than simply performing the conversion. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h | 14 -------------- include/hw/core/tcg-cpu-ops.h | 13 +++++++++++++ target/alpha/cpu.h | 2 ++ target/arm/internals.h | 2 ++ target/avr/cpu.h | 2 ++ target/hexagon/cpu.h | 2 ++ target/hppa/cpu.h | 2 ++ target/i386/tcg/helper-tcg.h | 2 ++ target/loongarch/internals.h | 2 ++ target/m68k/cpu.h | 2 ++ target/microblaze/cpu.h | 2 ++ target/mips/tcg/tcg-internal.h | 2 ++ target/openrisc/cpu.h | 2 ++ target/ppc/cpu.h | 2 ++ target/riscv/cpu.h | 3 +++ target/rx/cpu.h | 2 ++ target/s390x/s390x-internal.h | 2 ++ target/sh4/cpu.h | 2 ++ target/sparc/cpu.h | 2 ++ target/tricore/cpu.h | 2 ++ target/xtensa/cpu.h | 2 ++ accel/tcg/cpu-exec.c | 8 +++++--- accel/tcg/translate-all.c | 8 +++++--- target/alpha/cpu.c | 1 + target/alpha/translate.c | 4 ++-- target/arm/cpu.c | 1 + target/arm/tcg/cpu-v7m.c | 1 + target/arm/tcg/translate.c | 5 ++--- target/avr/cpu.c | 1 + target/avr/translate.c | 6 +++--- target/hexagon/cpu.c | 1 + target/hexagon/translate.c | 4 ++-- target/hppa/cpu.c | 1 + target/hppa/translate.c | 4 ++-- target/i386/tcg/tcg-cpu.c | 1 + target/i386/tcg/translate.c | 5 ++--- target/loongarch/cpu.c | 1 + target/loongarch/tcg/translate.c | 4 ++-- target/m68k/cpu.c | 1 + target/m68k/translate.c | 4 ++-- target/microblaze/cpu.c | 1 + target/microblaze/translate.c | 4 ++-- target/mips/cpu.c | 1 + target/mips/tcg/translate.c | 4 ++-- target/openrisc/cpu.c | 1 + target/openrisc/translate.c | 4 ++-- target/ppc/cpu_init.c | 1 + target/ppc/translate.c | 4 ++-- target/riscv/tcg/tcg-cpu.c | 1 + target/riscv/translate.c | 4 ++-- target/rx/cpu.c | 1 + target/rx/translate.c | 4 ++-- target/s390x/cpu.c | 1 + target/s390x/tcg/translate.c | 4 ++-- target/sh4/cpu.c | 1 + target/sh4/translate.c | 4 ++-- target/sparc/cpu.c | 1 + target/sparc/translate.c | 4 ++-- target/tricore/cpu.c | 1 + target/tricore/translate.c | 5 ++--- target/xtensa/cpu.c | 1 + target/xtensa/translate.c | 4 ++-- 62 files changed, 121 insertions(+), 62 deletions(-) diff --git a/include/exec/translator.h b/include/exec/translator.h index 41e2a41180..d70942a10f 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -21,20 +21,6 @@ #include "qemu/bswap.h" #include "exec/vaddr.h" -/** - * gen_intermediate_code - * @cpu: cpu context - * @tb: translation block - * @max_insns: max number of instructions to translate - * @pc: guest virtual program counter address - * @host_pc: host physical program counter address - * - * This function must be provided by the target, which should create - * the target-specific DisasContext, and then invoke translator_loop. - */ -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc); - /** * DisasJumpType: * @DISAS_NEXT: Next instruction in program order. diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 663efb9133..2e3f1690f1 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -24,6 +24,19 @@ struct TCGCPUOps { * Called when the first CPU is realized. */ void (*initialize)(void); + /** + * @translate_code: Translate guest instructions to TCGOps + * @cpu: cpu context + * @tb: translation block + * @max_insns: max number of instructions to translate + * @pc: guest virtual program counter address + * @host_pc: host physical program counter address + * + * This function must be provided by the target, which should create + * the target-specific DisasContext, and then invoke translator_loop. + */ + void (*translate_code)(CPUState *cpu, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); /** * @synchronize_from_tb: Synchronize state from a TCG #TranslationBlock * diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 3556d3227f..80562adfb5 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -431,6 +431,8 @@ enum { }; void alpha_translate_init(void); +void alpha_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); #define CPU_RESOLVING_TYPE TYPE_ALPHA_CPU diff --git a/target/arm/internals.h b/target/arm/internals.h index c3a5b1385f..863a84edf8 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -357,6 +357,8 @@ void init_cpreg_list(ARMCPU *cpu); void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu); void arm_translate_init(void); +void arm_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); void arm_cpu_register_gdb_commands(ARMCPU *cpu); void aarch64_cpu_register_gdb_commands(ARMCPU *cpu, GString *, diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 4725535102..06f5ae4d1b 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -183,6 +183,8 @@ static inline void set_avr_feature(CPUAVRState *env, int feature) } void avr_cpu_tcg_init(void); +void avr_cpu_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); int cpu_avr_exec(CPUState *cpu); diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 14e6e819c2..79e60d4bfa 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -150,6 +150,8 @@ static inline void cpu_get_tb_cpu_state(CPUHexagonState *env, vaddr *pc, typedef HexagonCPU ArchCPU; void hexagon_translate_init(void); +void hexagon_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); #include "exec/cpu-all.h" diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index e45ba50a59..22a6510e08 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -303,6 +303,8 @@ static inline int HPPA_BTLB_ENTRIES(CPUHPPAState *env) } void hppa_translate_init(void); +void hppa_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); #define CPU_RESOLVING_TYPE TYPE_HPPA_CPU diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 696d6ef016..54d845379c 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -59,6 +59,8 @@ static inline target_long lshift(target_long x, int n) /* translate.c */ void tcg_x86_init(void); +void x86_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); /* excp_helper.c */ G_NORETURN void raise_exception(CPUX86State *env, int exception_index); diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h index 0655ac948b..ad9cf4fc7a 100644 --- a/target/loongarch/internals.h +++ b/target/loongarch/internals.h @@ -17,6 +17,8 @@ #define TARGET_VIRT_MASK MAKE_64BIT_MASK(0, TARGET_VIRT_ADDR_SPACE_BITS) void loongarch_translate_init(void); +void loongarch_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); void G_NORETURN do_raise_exception(CPULoongArchState *env, uint32_t exception, diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index b5bbeedb7a..ddb0f29f4a 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -193,6 +193,8 @@ int m68k_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void m68k_tcg_init(void); +void m68k_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); void m68k_cpu_init_gdb(M68kCPU *cpu); uint32_t cpu_m68k_get_ccr(CPUM68KState *env); void cpu_m68k_set_ccr(CPUM68KState *env, uint32_t); diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 3e5a3e5c60..f6879eee35 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -398,6 +398,8 @@ static inline void mb_cpu_write_msr(CPUMBState *env, uint32_t val) } void mb_tcg_init(void); +void mb_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); #define CPU_RESOLVING_TYPE TYPE_MICROBLAZE_CPU diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h index aef032c48d..74fc1309a7 100644 --- a/target/mips/tcg/tcg-internal.h +++ b/target/mips/tcg/tcg-internal.h @@ -16,6 +16,8 @@ #include "cpu.h" void mips_tcg_init(void); +void mips_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); G_NORETURN void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index c9fe9ae12d..b97d2ffdd2 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -301,6 +301,8 @@ void openrisc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int openrisc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int openrisc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void openrisc_translate_init(void); +void openrisc_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); int print_insn_or1k(bfd_vma addr, disassemble_info *info); #ifndef CONFIG_USER_ONLY diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 2ffac2ed03..0b8b4c0517 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1581,6 +1581,8 @@ extern const VMStateDescription vmstate_ppc_cpu; /*****************************************************************************/ void ppc_translate_init(void); +void ppc_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); #if !defined(CONFIG_USER_ONLY) void ppc_store_sdr1(CPUPPCState *env, target_ulong value); diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 284b112821..252fdb8672 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -602,6 +602,9 @@ RISCVException smstateen_acc_ok(CPURISCVState *env, int index, uint64_t bit); void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv, bool virt_en); void riscv_translate_init(void); +void riscv_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); + G_NORETURN void riscv_raise_exception(CPURISCVState *env, uint32_t exception, uintptr_t pc); diff --git a/target/rx/cpu.h b/target/rx/cpu.h index c53593d7aa..5ba1874bd7 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -139,6 +139,8 @@ int rx_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int rx_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void rx_translate_init(void); +void rx_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte); #include "exec/cpu-all.h" diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 4cc435042c..a750e7a343 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -399,6 +399,8 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, /* translate.c */ void s390x_translate_init(void); +void s390x_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); void s390x_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data); diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index d928bcf006..d536d5d715 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -248,6 +248,8 @@ G_NORETURN void superh_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, uintptr_t retaddr); void sh4_translate_init(void); +void sh4_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); #if !defined(CONFIG_USER_ONLY) hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 5c981234bb..dda811503b 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -609,6 +609,8 @@ int sparc_cpu_memory_rw_debug(CPUState *cpu, vaddr addr, /* translate.c */ void sparc_tcg_init(void); +void sparc_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); /* fop_helper.c */ target_ulong cpu_get_fsr(CPUSPARCState *); diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 220af69fc2..8e431d7922 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -252,6 +252,8 @@ FIELD(TB_FLAGS, PRIV, 0, 2) void cpu_state_reset(CPUTriCoreState *s); void tricore_tcg_init(void); +void tricore_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); static inline void cpu_get_tb_cpu_state(CPUTriCoreState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 77e48eef19..0e6302c5bd 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -617,6 +617,8 @@ G_NORETURN void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, void xtensa_collect_sr_names(const XtensaConfig *config); void xtensa_translate_init(void); +void xtensa_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc); void **xtensa_get_regfile_by_name(const char *name, int entries, int bits); void xtensa_breakpoint_handler(CPUState *cs); void xtensa_register_core(XtensaConfigList *node); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index b507049ddb..d48b82a932 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1088,11 +1088,13 @@ bool tcg_exec_realizefn(CPUState *cpu, Error **errp) if (!tcg_target_initialized) { /* Check mandatory TCGCPUOps handlers */ + const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; #ifndef CONFIG_USER_ONLY - assert(cpu->cc->tcg_ops->cpu_exec_halt); - assert(cpu->cc->tcg_ops->cpu_exec_interrupt); + assert(tcg_ops->cpu_exec_halt); + assert(tcg_ops->cpu_exec_interrupt); #endif /* !CONFIG_USER_ONLY */ - cpu->cc->tcg_ops->initialize(); + assert(tcg_ops->translate_code); + tcg_ops->initialize(); tcg_target_initialized = true; } diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 572a8a8797..453eb20ec9 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -276,8 +276,10 @@ static int setjmp_gen_code(CPUArchState *env, TranslationBlock *tb, tcg_func_start(tcg_ctx); - tcg_ctx->cpu = env_cpu(env); - gen_intermediate_code(env_cpu(env), tb, max_insns, pc, host_pc); + CPUState *cs = env_cpu(env); + tcg_ctx->cpu = cs; + cs->cc->tcg_ops->translate_code(cs, tb, max_insns, pc, host_pc); + assert(tb->size != 0); tcg_ctx->cpu = NULL; *max_insns = tb->icount; @@ -364,7 +366,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, /* * Overflow of code_gen_buffer, or the current slice of it. * - * TODO: We don't need to re-do gen_intermediate_code, nor + * TODO: We don't need to re-do tcg_ops->translate_code, nor * should we re-do the tcg optimization currently hidden * inside tcg_gen_code. All that should be required is to * flush the TBs, allocate a new TB, re-initialize it per diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 9fa506bff9..e1b898e575 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -224,6 +224,7 @@ static const struct SysemuCPUOps alpha_sysemu_ops = { static const TCGCPUOps alpha_tcg_ops = { .initialize = alpha_translate_init, + .translate_code = alpha_translate_code, .synchronize_from_tb = alpha_cpu_synchronize_from_tb, .restore_state_to_opc = alpha_restore_state_to_opc, diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 629ff3cde9..2156c02214 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -2955,8 +2955,8 @@ static const TranslatorOps alpha_tr_ops = { .tb_stop = alpha_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void alpha_translate_code(CPUState *cpu, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cpu, tb, max_insns, pc, host_pc, &alpha_tr_ops, &dc.base); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 019183c9ea..dcedadc89e 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2682,6 +2682,7 @@ static const struct SysemuCPUOps arm_sysemu_ops = { #ifdef CONFIG_TCG static const TCGCPUOps arm_tcg_ops = { .initialize = arm_translate_init, + .translate_code = arm_translate_code, .synchronize_from_tb = arm_cpu_synchronize_from_tb, .debug_excp_handler = arm_debug_excp_handler, .restore_state_to_opc = arm_restore_state_to_opc, diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c index 58e54578d6..03acdf83e0 100644 --- a/target/arm/tcg/cpu-v7m.c +++ b/target/arm/tcg/cpu-v7m.c @@ -234,6 +234,7 @@ static void cortex_m55_initfn(Object *obj) static const TCGCPUOps arm_v7m_tcg_ops = { .initialize = arm_translate_init, + .translate_code = arm_translate_code, .synchronize_from_tb = arm_cpu_synchronize_from_tb, .debug_excp_handler = arm_debug_excp_handler, .restore_state_to_opc = arm_restore_state_to_opc, diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 9ee761fc64..c16b59ab88 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -8093,9 +8093,8 @@ static const TranslatorOps thumb_translator_ops = { .tb_stop = arm_tr_tb_stop, }; -/* generate intermediate code for basic block 'tb'. */ -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void arm_translate_code(CPUState *cpu, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc = { }; const TranslatorOps *ops = &arm_translator_ops; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 2dccb09c5e..8a126ff322 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -207,6 +207,7 @@ static const struct SysemuCPUOps avr_sysemu_ops = { static const TCGCPUOps avr_tcg_ops = { .initialize = avr_cpu_tcg_init, + .translate_code = avr_cpu_translate_code, .synchronize_from_tb = avr_cpu_synchronize_from_tb, .restore_state_to_opc = avr_restore_state_to_opc, .cpu_exec_interrupt = avr_cpu_exec_interrupt, diff --git a/target/avr/translate.c b/target/avr/translate.c index f13b997f8d..4ab71d8138 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -2599,7 +2599,7 @@ static bool trans_WDR(DisasContext *ctx, arg_WDR *a) * * - translate() * - canonicalize_skip() - * - gen_intermediate_code() + * - translate_code() * - restore_state_to_opc() * */ @@ -2795,8 +2795,8 @@ static const TranslatorOps avr_tr_ops = { .tb_stop = avr_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void avr_cpu_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc = { }; translator_loop(cs, tb, max_insns, pc, host_pc, &avr_tr_ops, &dc.base); diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index c9817c7192..0b7fc98f6c 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -325,6 +325,7 @@ static void hexagon_cpu_init(Object *obj) static const TCGCPUOps hexagon_tcg_ops = { .initialize = hexagon_translate_init, + .translate_code = hexagon_translate_code, .synchronize_from_tb = hexagon_cpu_synchronize_from_tb, .restore_state_to_opc = hexagon_restore_state_to_opc, }; diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 562105705a..fe7858703c 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -1026,8 +1026,8 @@ static const TranslatorOps hexagon_tr_ops = { .tb_stop = hexagon_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void hexagon_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index c9062e60b6..47d0160955 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -223,6 +223,7 @@ static const struct SysemuCPUOps hppa_sysemu_ops = { static const TCGCPUOps hppa_tcg_ops = { .initialize = hppa_translate_init, + .translate_code = hppa_translate_code, .synchronize_from_tb = hppa_cpu_synchronize_from_tb, .restore_state_to_opc = hppa_restore_state_to_opc, diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d13f80fe3e..dc04f9f3c0 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4869,8 +4869,8 @@ static const TranslatorOps hppa_tr_ops = { #endif }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void hppa_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx = { }; translator_loop(cs, tb, max_insns, pc, host_pc, &hppa_tr_ops, &ctx.base); diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 231ecac37d..14ee038079 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -109,6 +109,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs) static const TCGCPUOps x86_tcg_ops = { .initialize = tcg_x86_init, + .translate_code = x86_translate_code, .synchronize_from_tb = x86_cpu_synchronize_from_tb, .restore_state_to_opc = x86_restore_state_to_opc, .cpu_exec_enter = x86_cpu_exec_enter, diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 903553dc88..834aea1e59 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -3814,9 +3814,8 @@ static const TranslatorOps i386_tr_ops = { .tb_stop = i386_tr_tb_stop, }; -/* generate intermediate code for basic block 'tb'. */ -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void x86_translate_code(CPUState *cpu, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc; diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index f5bc8720d1..58415ffe99 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -795,6 +795,7 @@ static void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags) static const TCGCPUOps loongarch_tcg_ops = { .initialize = loongarch_translate_init, + .translate_code = loongarch_translate_code, .synchronize_from_tb = loongarch_cpu_synchronize_from_tb, .restore_state_to_opc = loongarch_restore_state_to_opc, diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/translate.c index 1fca4afc73..68be999410 100644 --- a/target/loongarch/tcg/translate.c +++ b/target/loongarch/tcg/translate.c @@ -333,8 +333,8 @@ static const TranslatorOps loongarch_tr_ops = { .tb_stop = loongarch_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void loongarch_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 9de8ce6707..41dfdf5804 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -551,6 +551,7 @@ static const struct SysemuCPUOps m68k_sysemu_ops = { static const TCGCPUOps m68k_tcg_ops = { .initialize = m68k_tcg_init, + .translate_code = m68k_translate_code, .restore_state_to_opc = m68k_restore_state_to_opc, #ifndef CONFIG_USER_ONLY diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 077151c62d..dec2967fce 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -6118,8 +6118,8 @@ static const TranslatorOps m68k_tr_ops = { .tb_stop = m68k_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void m68k_translate_code(CPUState *cpu, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cpu, tb, max_insns, pc, host_pc, &m68k_tr_ops, &dc.base); diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index eba819378d..f114789abd 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -423,6 +423,7 @@ static const struct SysemuCPUOps mb_sysemu_ops = { static const TCGCPUOps mb_tcg_ops = { .initialize = mb_tcg_init, + .translate_code = mb_translate_code, .synchronize_from_tb = mb_cpu_synchronize_from_tb, .restore_state_to_opc = mb_restore_state_to_opc, diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index d53995c26d..24005f05b2 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1779,8 +1779,8 @@ static const TranslatorOps mb_tr_ops = { .tb_stop = mb_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void mb_translate_code(CPUState *cpu, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cpu, tb, max_insns, pc, host_pc, &mb_tr_ops, &dc.base); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 1b0cf6df9c..e3af02a4e6 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -547,6 +547,7 @@ static const Property mips_cpu_properties[] = { #include "hw/core/tcg-cpu-ops.h" static const TCGCPUOps mips_tcg_ops = { .initialize = mips_tcg_init, + .translate_code = mips_translate_code, .synchronize_from_tb = mips_cpu_synchronize_from_tb, .restore_state_to_opc = mips_restore_state_to_opc, diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index bd1ef4e1fc..78b848a6d9 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -15231,8 +15231,8 @@ static const TranslatorOps mips_tr_ops = { .tb_stop = mips_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void mips_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 7913a0c3e1..b7bab0d7ab 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -236,6 +236,7 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = { static const TCGCPUOps openrisc_tcg_ops = { .initialize = openrisc_translate_init, + .translate_code = openrisc_translate_code, .synchronize_from_tb = openrisc_cpu_synchronize_from_tb, .restore_state_to_opc = openrisc_restore_state_to_opc, diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 028ba66631..7a6af183ae 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1646,8 +1646,8 @@ static const TranslatorOps openrisc_tr_ops = { .tb_stop = openrisc_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void openrisc_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 0fcef630f1..c05c2dc42d 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7431,6 +7431,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = { static const TCGCPUOps ppc_tcg_ops = { .initialize = ppc_translate_init, + .translate_code = ppc_translate_code, .restore_state_to_opc = ppc_restore_state_to_opc, #ifdef CONFIG_USER_ONLY diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 8ab87f42d6..80638ab535 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -6669,8 +6669,8 @@ static const TranslatorOps ppc_tr_ops = { .tb_stop = ppc_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void ppc_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index f0129811fd..8b89c99c0f 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -135,6 +135,7 @@ static void riscv_restore_state_to_opc(CPUState *cs, static const TCGCPUOps riscv_tcg_ops = { .initialize = riscv_translate_init, + .translate_code = riscv_translate_code, .synchronize_from_tb = riscv_cpu_synchronize_from_tb, .restore_state_to_opc = riscv_restore_state_to_opc, diff --git a/target/riscv/translate.c b/target/riscv/translate.c index a76f67c5dd..a992d4f3c6 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1346,8 +1346,8 @@ static const TranslatorOps riscv_tr_ops = { .tb_stop = riscv_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void riscv_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 558280c794..8c50c7a1bc 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -196,6 +196,7 @@ static const struct SysemuCPUOps rx_sysemu_ops = { static const TCGCPUOps rx_tcg_ops = { .initialize = rx_translate_init, + .translate_code = rx_translate_code, .synchronize_from_tb = rx_cpu_synchronize_from_tb, .restore_state_to_opc = rx_restore_state_to_opc, .tlb_fill = rx_cpu_tlb_fill, diff --git a/target/rx/translate.c b/target/rx/translate.c index 4f43654bad..bbda703be8 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -2258,8 +2258,8 @@ static const TranslatorOps rx_tr_ops = { .tb_stop = rx_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void rx_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 0a6847b027..97d41c23de 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -362,6 +362,7 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, static const TCGCPUOps s390_tcg_ops = { .initialize = s390x_translate_init, + .translate_code = s390x_translate_code, .restore_state_to_opc = s390x_restore_state_to_opc, #ifdef CONFIG_USER_ONLY diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 81554f2ad9..00073c5560 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6481,8 +6481,8 @@ static const TranslatorOps s390x_tr_ops = { .disas_log = s390x_tr_disas_log, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void s390x_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc; diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index e9d3e12a62..24a22724c6 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -251,6 +251,7 @@ static const struct SysemuCPUOps sh4_sysemu_ops = { static const TCGCPUOps superh_tcg_ops = { .initialize = sh4_translate_init, + .translate_code = sh4_translate_code, .synchronize_from_tb = superh_cpu_synchronize_from_tb, .restore_state_to_opc = superh_restore_state_to_opc, diff --git a/target/sh4/translate.c b/target/sh4/translate.c index f076da9bac..bcdd558818 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -2318,8 +2318,8 @@ static const TranslatorOps sh4_tr_ops = { .tb_stop = sh4_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void sh4_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 373a335c39..fbd38ec334 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -996,6 +996,7 @@ static const struct SysemuCPUOps sparc_sysemu_ops = { static const TCGCPUOps sparc_tcg_ops = { .initialize = sparc_tcg_init, + .translate_code = sparc_translate_code, .synchronize_from_tb = sparc_cpu_synchronize_from_tb, .restore_state_to_opc = sparc_restore_state_to_opc, diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 465e20f4f3..7e5c7351cb 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5819,8 +5819,8 @@ static const TranslatorOps sparc_tr_ops = { .tb_stop = sparc_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void sparc_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc = {}; diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 95fb546666..95202fadbf 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -172,6 +172,7 @@ static const struct SysemuCPUOps tricore_sysemu_ops = { static const TCGCPUOps tricore_tcg_ops = { .initialize = tricore_tcg_init, + .translate_code = tricore_translate_code, .synchronize_from_tb = tricore_cpu_synchronize_from_tb, .restore_state_to_opc = tricore_restore_state_to_opc, .tlb_fill = tricore_cpu_tlb_fill, diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 2b67395c09..0ef3743f3e 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8460,9 +8460,8 @@ static const TranslatorOps tricore_tr_ops = { .tb_stop = tricore_tr_tb_stop, }; - -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void tricore_translate_code(CPUState *cs, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext ctx; translator_loop(cs, tb, max_insns, pc, host_pc, diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 0d4d79b58b..0910a3d290 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -232,6 +232,7 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = { static const TCGCPUOps xtensa_tcg_ops = { .initialize = xtensa_translate_init, + .translate_code = xtensa_translate_code, .debug_excp_handler = xtensa_breakpoint_handler, .restore_state_to_opc = xtensa_restore_state_to_opc, diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 3c62c99b4f..4f02cefde3 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1228,8 +1228,8 @@ static const TranslatorOps xtensa_translator_ops = { .tb_stop = xtensa_tr_tb_stop, }; -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns, - vaddr pc, void *host_pc) +void xtensa_translate_code(CPUState *cpu, TranslationBlock *tb, + int *max_insns, vaddr pc, void *host_pc) { DisasContext dc = {}; translator_loop(cpu, tb, max_insns, pc, host_pc,