From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 3/5] target/i386: tcg: remove subf from SHLD/SHRD expansion
Date: Thu, 3 Apr 2025 11:22:49 +0200 [thread overview]
Message-ID: <20250403092251.54441-4-pbonzini@redhat.com> (raw)
In-Reply-To: <20250403092251.54441-1-pbonzini@redhat.com>
It is computing 33-count but 32-count is used in the same TB, so shift
further by one.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 5529327680d..822dbb2e9ae 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -1633,17 +1633,16 @@ static TCGv gen_shiftd_rm_T1(DisasContext *s, MemOp ot,
} else {
tcg_gen_shl_tl(cc_src, s->T0, tmp);
- if (ot == MO_16) {
- /* Only needed if count > 16, for Intel behaviour. */
- tcg_gen_subfi_tl(tmp, 33, count);
- tcg_gen_shr_tl(tmp, s->T1, tmp);
- tcg_gen_or_tl(cc_src, cc_src, tmp);
- }
-
/* mask + 1 - count = mask - tmp = mask ^ tmp */
tcg_gen_xori_tl(hishift, tmp, mask);
tcg_gen_shl_tl(s->T0, s->T0, count);
tcg_gen_shr_tl(s->T1, s->T1, hishift);
+
+ if (ot == MO_16) {
+ /* Only needed if count > 16, for Intel behaviour. */
+ tcg_gen_shri_tl(tmp, s->T1, 1);
+ tcg_gen_or_tl(cc_src, cc_src, tmp);
+ }
}
tcg_gen_movcond_tl(TCG_COND_EQ, s->T1,
count, tcg_constant_tl(0),
--
2.49.0
next prev parent reply other threads:[~2025-04-03 9:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 9:22 [PATCH for 10.1 0/5] target/i386: TCG changes Paolo Bonzini
2025-04-03 9:22 ` [PATCH 1/5] target/i386: special case ADC/SBB x,0 and SBB x,x Paolo Bonzini
2025-04-22 15:23 ` Richard Henderson
2025-04-03 9:22 ` [PATCH 2/5] target/i386: tcg: remove tmp0 and tmp4 from SHLD/SHRD Paolo Bonzini
2025-04-22 15:28 ` Richard Henderson
2025-04-03 9:22 ` Paolo Bonzini [this message]
2025-04-22 16:57 ` [PATCH 3/5] target/i386: tcg: remove subf from SHLD/SHRD expansion Richard Henderson
2025-04-03 9:22 ` [PATCH 4/5] target/i386: tcg: remove tmp0 Paolo Bonzini
2025-04-22 16:59 ` Richard Henderson
2025-04-03 9:22 ` [PATCH 5/5] target/i386: tcg: remove some more uses of temporaries Paolo Bonzini
2025-04-22 17:01 ` 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=20250403092251.54441-4-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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).