From: Paolo Bonzini <pbonzini@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH 02/20] tcg/optimize: Add one's mask to TempOptInfo
Date: Tue, 6 May 2025 13:05:11 +0200 [thread overview]
Message-ID: <b94f0dcf-6f55-45e9-866c-ad2e59ce85a7@redhat.com> (raw)
In-Reply-To: <20250505202751.3510517-3-richard.henderson@linaro.org>
On 5/5/25 22:27, Richard Henderson wrote:
> + /* Bits that are known 1 and bits that are known 0 must not overlap. */
> + tcg_debug_assert((o_mask & ~z_mask) == 0);
> +
> + /* All bits that are not known zero are known one is a constant. */
> + if (z_mask == o_mask) {
> + return tcg_opt_gen_movi(ctx, op, op->args[0], o_mask);
> + }
> + /* All bits known zero is zero. */
> if (z_mask == 0) {
> return tcg_opt_gen_movi(ctx, op, op->args[0], 0);
> }
Just a nit, but this second check is now redundant. z_mask == 0 implies
that o_mask == 0 (otherwise o_mask & z_mask is not zero); therefore the
"if (z_mask == o_mask)" must have returned from fold_masks_zos().
Really nice!
Paolo
next prev parent reply other threads:[~2025-05-06 11:06 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-05 20:27 [PATCH 00/20] tcg/optimize: Track and use known 1's Richard Henderson
2025-05-05 20:27 ` [PATCH 01/20] tcg/optimize: Introduce arg_const_val Richard Henderson
2025-06-24 22:21 ` Pierrick Bouvier
2025-05-05 20:27 ` [PATCH 02/20] tcg/optimize: Add one's mask to TempOptInfo Richard Henderson
2025-05-06 11:05 ` Paolo Bonzini [this message]
2025-05-06 14:12 ` Richard Henderson
2025-06-24 22:38 ` Pierrick Bouvier
2025-05-05 20:27 ` [PATCH 03/20] tcg/optimize: Build and use o_bits in fold_and Richard Henderson
2025-06-24 22:42 ` Pierrick Bouvier
2025-05-05 20:27 ` [PATCH 04/20] tcg/optimize: Build and use o_bits in fold_andc Richard Henderson
2025-06-24 23:20 ` Pierrick Bouvier
2025-05-05 20:27 ` [PATCH 05/20] tcg/optimize: Build and use z_bits and o_bits in fold_eqv Richard Henderson
2025-06-24 23:55 ` Pierrick Bouvier
2025-05-05 20:27 ` [PATCH 06/20] tcg/optimize: Build and use z_bits and o_bits in fold_nand Richard Henderson
2025-05-05 20:27 ` [PATCH 07/20] tcg/optimize: Build and use z_bits and o_bits in fold_nor Richard Henderson
2025-05-05 20:27 ` [PATCH 08/20] tcg/optimize: Build and use z_bits and o_bits in fold_not Richard Henderson
2025-05-05 20:27 ` [PATCH 09/20] tcg/optimize: Build and use one and affected bits in fold_or Richard Henderson
2025-05-05 20:27 ` [PATCH 10/20] tcg/optimize: Build and use zero, one and affected bits in fold_orc Richard Henderson
2025-05-05 20:27 ` [PATCH 11/20] tcg/optimize: Build and use o_bits in fold_xor Richard Henderson
2025-05-05 20:27 ` [PATCH 12/20] tcg/optimize: Build and use o_bits in fold_bswap Richard Henderson
2025-05-05 20:27 ` [PATCH 13/20] tcg/optimize: Build and use o_bits in fold_deposit Richard Henderson
2025-05-05 20:27 ` [PATCH 14/20] tcg/optimize: Build and use o_bits in fold_extract Richard Henderson
2025-05-05 20:27 ` [PATCH 15/20] tcg/optimize: Build and use z_bits and o_bits in fold_extract2 Richard Henderson
2025-05-06 11:12 ` Paolo Bonzini
2025-05-06 14:15 ` Richard Henderson
2025-05-05 20:27 ` [PATCH 16/20] tcg/optimize: Build and use o_bits in fold_exts Richard Henderson
2025-05-05 20:27 ` [PATCH 17/20] tcg/optimize: Build and use o_bits in fold_extu Richard Henderson
2025-05-05 20:27 ` [PATCH 18/20] tcg/optimize: Build and use o_bits in fold_movcond Richard Henderson
2025-05-05 20:27 ` [PATCH 19/20] tcg/optimize: Build and use o_bits in fold_sextract Richard Henderson
2025-05-05 20:27 ` [PATCH 20/20] tcg/optimize: Build and use o_bits in fold_shift Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b94f0dcf-6f55-45e9-866c-ad2e59ce85a7@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).