qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org
Subject: [PATCH 01/14] target/i386: use tcg_gen_ext_tl when applicable
Date: Sun, 20 Oct 2024 17:53:11 +0200	[thread overview]
Message-ID: <20241020155324.35273-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20241020155324.35273-1-pbonzini@redhat.com>

Prefer it to gen_ext_tl in the common case where the destination is known.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/translate.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index ef190416b49..dc308f31041 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -883,16 +883,16 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, TCGv reg)
     case CC_OP_SUBB ... CC_OP_SUBQ:
         /* (DATA_TYPE)CC_SRCT < (DATA_TYPE)CC_SRC */
         size = s->cc_op - CC_OP_SUBB;
-        gen_ext_tl(s->cc_srcT, s->cc_srcT, size, false);
-        gen_ext_tl(cpu_cc_src, cpu_cc_src, size, false);
+        tcg_gen_ext_tl(s->cc_srcT, s->cc_srcT, size);
+        tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size);
         return (CCPrepare) { .cond = TCG_COND_LTU, .reg = s->cc_srcT,
                              .reg2 = cpu_cc_src, .use_reg2 = true };
 
     case CC_OP_ADDB ... CC_OP_ADDQ:
         /* (DATA_TYPE)CC_DST < (DATA_TYPE)CC_SRC */
         size = s->cc_op - CC_OP_ADDB;
-        gen_ext_tl(cpu_cc_dst, cpu_cc_dst, size, false);
-        gen_ext_tl(cpu_cc_src, cpu_cc_src, size, false);
+        tcg_gen_ext_tl(cpu_cc_dst, cpu_cc_dst, size);
+        tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size);
         return (CCPrepare) { .cond = TCG_COND_LTU, .reg = cpu_cc_dst,
                              .reg2 = cpu_cc_src, .use_reg2 = true };
 
@@ -1041,8 +1041,8 @@ static CCPrepare gen_prepare_cc(DisasContext *s, int b, TCGv reg)
         size = s->cc_op - CC_OP_SUBB;
         switch (jcc_op) {
         case JCC_BE:
-            gen_ext_tl(s->cc_srcT, s->cc_srcT, size, false);
-            gen_ext_tl(cpu_cc_src, cpu_cc_src, size, false);
+            tcg_gen_ext_tl(s->cc_srcT, s->cc_srcT, size);
+            tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size);
             cc = (CCPrepare) { .cond = TCG_COND_LEU, .reg = s->cc_srcT,
                                .reg2 = cpu_cc_src, .use_reg2 = true };
             break;
@@ -1052,8 +1052,8 @@ static CCPrepare gen_prepare_cc(DisasContext *s, int b, TCGv reg)
         case JCC_LE:
             cond = TCG_COND_LE;
         fast_jcc_l:
-            gen_ext_tl(s->cc_srcT, s->cc_srcT, size, true);
-            gen_ext_tl(cpu_cc_src, cpu_cc_src, size, true);
+            tcg_gen_ext_tl(s->cc_srcT, s->cc_srcT, size | MO_SIGN);
+            tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size | MO_SIGN);
             cc = (CCPrepare) { .cond = cond, .reg = s->cc_srcT,
                                .reg2 = cpu_cc_src, .use_reg2 = true };
             break;
-- 
2.46.2



  reply	other threads:[~2024-10-20 15:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-20 15:53 [PATCH 00/14] target/i386: miscellaneous flags improvements Paolo Bonzini
2024-10-20 15:53 ` Paolo Bonzini [this message]
2024-10-20 19:50   ` [PATCH 01/14] target/i386: use tcg_gen_ext_tl when applicable Richard Henderson
2024-10-20 15:53 ` [PATCH 02/14] target/i386: Tidy cc_op_str usage Paolo Bonzini
2024-10-20 15:53 ` [PATCH 03/14] target/i386: remove CC_OP_CLR Paolo Bonzini
2024-10-20 19:55   ` Richard Henderson
2024-10-20 15:53 ` [PATCH 04/14] target/i386: Rearrange CCOp Paolo Bonzini
2024-10-20 15:53 ` [PATCH 05/14] target/i386: Introduce cc_op_size Paolo Bonzini
2024-10-20 15:53 ` [PATCH 06/14] target/i386: Wrap cc_op_live with a validity check Paolo Bonzini
2024-10-20 20:05   ` Richard Henderson
2024-10-20 15:53 ` [PATCH 07/14] target/i386: optimize computation of ZF from CC_OP_DYNAMIC Paolo Bonzini
2024-10-20 20:18   ` Richard Henderson
2024-10-20 15:53 ` [PATCH 08/14] target/i386: optimize TEST+Jxx sequences Paolo Bonzini
2024-10-20 20:19   ` Richard Henderson
2024-10-20 15:53 ` [PATCH 09/14] target/i386: add a few more trivial CCPrepare cases Paolo Bonzini
2024-10-20 20:23   ` Richard Henderson
2024-10-20 15:53 ` [PATCH 10/14] target/i386: add a note about gen_jcc1 Paolo Bonzini
2024-10-20 15:53 ` [PATCH 11/14] target/i386: make flag variables unsigned Paolo Bonzini
2024-10-20 20:26   ` Richard Henderson
2024-10-20 15:53 ` [PATCH 12/14] target/i386: use builtin popcnt or parity to compute PF, if available Paolo Bonzini
2024-10-20 20:40   ` Richard Henderson
2024-10-20 15:53 ` [PATCH 13/14] target/i386: use higher-precision arithmetic to compute CF Paolo Bonzini
2024-10-20 15:53 ` [PATCH 14/14] target/i386: use + to put flags together Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2024-10-28 15:18 [PATCH v2 00/14] target/i386: miscellaneous flags improvements Paolo Bonzini
2024-10-28 15:18 ` [PATCH 01/14] target/i386: use tcg_gen_ext_tl when applicable Paolo Bonzini

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=20241020155324.35273-2-pbonzini@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).