From: Jim MacArthur <jim.macarthur@linaro.org>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org
Subject: Re: [PATCH v2 1/6] tcg/optimize: Lower unsupported deposit during optimize
Date: Wed, 25 Feb 2026 13:34:19 +0000 [thread overview]
Message-ID: <aZ76W5covvg5ejp2@linaro.org> (raw)
In-Reply-To: <20260204052456.970605-2-richard.henderson@linaro.org>
On Wed, Feb 04, 2026 at 03:24:51PM +1000, Richard Henderson wrote:
> The expansions that we chose in tcg-op.c may be less than optimial.
> Delay lowering until optimize, so that we have propagated constants
> and have computed known zero/one masks.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> + /* Lower invalid deposit into zero as AND + SHL or SHL + AND. */
> + if (!valid) {
> + if (TCG_TARGET_extract_valid(ctx->type, 0, ofs + len) &&
> + !TCG_TARGET_extract_valid(ctx->type, 0, len)) {
> + op2 = opt_insert_before(ctx, op, INDEX_op_shl, 3);
> + op2->args[0] = ret;
> + op2->args[1] = arg2;
> + op2->args[2] = arg_new_constant(ctx, ofs);
> +
> + op->opc = INDEX_op_extract;
> + op->args[1] = ret;
> + op->args[2] = 0;
> + op->args[3] = ofs + len;
> + goto done;
> + }
I also had questions about extract vs shift/and here. You've explained this on patch 6, but a comment here about it might help future developers.
Nonetheless,
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
next prev parent reply other threads:[~2026-02-25 13:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 5:24 [PATCH v2 0/6] tcg: Improve extract and deposit code gen Richard Henderson
2026-02-04 5:24 ` [PATCH v2 1/6] tcg/optimize: Lower unsupported deposit during optimize Richard Henderson
2026-02-25 13:34 ` Jim MacArthur [this message]
2026-02-04 5:24 ` [PATCH v2 2/6] tcg/optimize: Lower unsupported extract2 " Richard Henderson
2026-02-25 14:47 ` Jim MacArthur
2026-02-04 5:24 ` [PATCH v2 3/6] tcg: Expand missing rotri with extract2 Richard Henderson
2026-02-25 14:54 ` Jim MacArthur
2026-02-04 5:24 ` [PATCH v2 4/6] tcg: Add tcg_op_imm_match Richard Henderson
2026-02-25 15:06 ` Jim MacArthur
2026-02-04 5:24 ` [PATCH v2 5/6] tcg: target-dependent lowering of extract to shr/and Richard Henderson
2026-02-25 15:16 ` Jim MacArthur
2026-02-04 5:24 ` [PATCH v2 6/6] tcg/optimize: possibly expand deposit into zero with shifts Richard Henderson
2026-02-04 8:05 ` Paolo Bonzini
2026-02-04 9:06 ` Richard Henderson
2026-02-04 10:41 ` Paolo Bonzini
2026-02-04 20:45 ` Richard Henderson
2026-02-05 8:22 ` Paolo Bonzini
2026-02-05 22:29 ` Richard Henderson
2026-02-05 23:22 ` Paolo Bonzini
2026-02-06 1:09 ` 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=aZ76W5covvg5ejp2@linaro.org \
--to=jim.macarthur@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.