@samitouri / QOSamiQemu / commits / a663957f40

target/i386/tcg: inline gen_ext_tl

It has been mostly replaced by tcg_gen_ext_tl(), other than for a single appearance in gen_op_j_ecx(). No need to have a separate function. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo Bonzini committed Jun 19, 2026 at 08:15 UTC a663957f40e638692b742763ba8b5477b18cdd5f
2 files changed +8 -18
target/i386/tcg/emit.c.inc
-4
@@ -1686,10 +1686,6 @@ static void gen_CMPccXADD(DisasContext *s, X86DecodedInsn *decode)
1686 ot_full |= MO_SIGN;
1687 }
1688
1689 - /*
1690 - * cmpv will be moved to cc_src *after* cpu_regs[] is written back, so use
1691 - * tcg_gen_ext_tl instead of gen_ext_tl.
1692 - */
1689 tcg_gen_ext_tl(cmpv, cpu_regs[decode->op[1].n], ot_full);
1690
1691 /*
target/i386/tcg/translate.c
+8 -14
@@ -640,23 +640,17 @@ static inline void gen_string_movl_A0_EDI(DisasContext *s)
640 gen_lea_v_seg(s, cpu_regs[R_EDI], R_ES, -1);
641 }
642
643 -static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size, bool sign)
644 -{
645 - if (size == MO_TL) {
646 - return src;
647 - }
648 - if (!dst) {
649 - dst = tcg_temp_new();
650 - }
651 - tcg_gen_ext_tl(dst, src, size | (sign ? MO_SIGN : 0));
652 - return dst;
653 -}
654 -
643 static void gen_op_j_ecx(DisasContext *s, TCGCond cond, TCGLabel *label1)
644 {
657 - TCGv tmp = gen_ext_tl(NULL, cpu_regs[R_ECX], s->aflag, false);
645 + TCGv cmpval;
646 + if (s->aflag == MO_TL) {
647 + cmpval = cpu_regs[R_ECX];
648 + } else {
649 + cmpval = tcg_temp_new();
650 + tcg_gen_ext_tl(cmpval, cpu_regs[R_ECX], s->aflag);
651 + }
652
659 - tcg_gen_brcondi_tl(cond, tmp, 0, label1);
653 + tcg_gen_brcondi_tl(cond, cmpval, 0, label1);
654 }
655
656 static inline void gen_op_jz_ecx(DisasContext *s, TCGLabel *label1)