[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/22] target/i386: do not use s->tmp0 for jumps on ECX ==/!= 0
From: |
Paolo Bonzini |
Subject: |
[PATCH 16/22] target/i386: do not use s->tmp0 for jumps on ECX ==/!= 0 |
Date: |
Fri, 22 Dec 2023 19:15:57 +0100 |
Create a new temporary, to ease the register allocator's work.
Creation of the temporary is pushed into gen_ext_tl, which
also allows NULL as the first parameter now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index afe0fa6c65f..e5f71170967 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -720,6 +720,9 @@ static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size, bool
sign)
if (size == MO_TL) {
return src;
}
+ if (!dst) {
+ dst = tcg_temp_new();
+ }
tcg_gen_ext_tl(dst, src, size | (sign ? MO_SIGN : 0));
return dst;
}
@@ -736,9 +739,9 @@ static void gen_exts(MemOp ot, TCGv reg)
static void gen_op_j_ecx(DisasContext *s, TCGCond cond, TCGLabel *label1)
{
- tcg_gen_mov_tl(s->tmp0, cpu_regs[R_ECX]);
- gen_extu(s->aflag, s->tmp0);
- tcg_gen_brcondi_tl(cond, s->tmp0, 0, label1);
+ TCGv tmp = gen_ext_tl(NULL, cpu_regs[R_ECX], s->aflag, false);
+
+ tcg_gen_brcondi_tl(cond, tmp, 0, label1);
}
static inline void gen_op_jz_ecx(DisasContext *s, TCGLabel *label1)
--
2.43.0
- [PATCH 14/22] target/i386: split eflags computation out of gen_compute_eflags, (continued)
- [PATCH 14/22] target/i386: split eflags computation out of gen_compute_eflags, Paolo Bonzini, 2023/12/22
- [PATCH 18/22] target/i386: prepare for implementation of STOS/SCAS in new decoder, Paolo Bonzini, 2023/12/22
- [PATCH 06/22] target/i386: document more deviations from the manual, Paolo Bonzini, 2023/12/22
- [PATCH 10/22] target/i386: add X86_SPECIALs for MOVSX and MOVZX, Paolo Bonzini, 2023/12/22
- [PATCH 13/22] target/i386: do not clobber T0 on string operations, Paolo Bonzini, 2023/12/22
- [PATCH 16/22] target/i386: do not use s->tmp0 for jumps on ECX ==/!= 0,
Paolo Bonzini <=
- [PATCH 15/22] target/i386: do not use s->tmp4 for push, Paolo Bonzini, 2023/12/22
- [PATCH 19/22] target/i386: move operand load and writeback out of gen_cmovcc1, Paolo Bonzini, 2023/12/22
- [PATCH 20/22] target/i386: adjust decoding of J operand, Paolo Bonzini, 2023/12/22
- [PATCH 05/22] target/i386: clean up cpu_cc_compute_all, Paolo Bonzini, 2023/12/22
- [PATCH 07/22] target/i386: reimplement check for validity of LOCK prefix, Paolo Bonzini, 2023/12/22