From: Richard Henderson Date: Sat, 18 Jan 2025 06:05:48 +0000 (-0800) Subject: tcg/i386: Honor carry_live in tcg_out_movi X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f049cc5fda405c46de94f9328f0e3f84c0c993b;p=thirdparty%2Fqemu.git tcg/i386: Honor carry_live in tcg_out_movi Do not clobber flags if they're live. Required in order to perform register allocation on add/sub carry opcodes. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 04e31cae12..8e0ccbc722 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1092,7 +1092,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, { tcg_target_long diff; - if (arg == 0) { + if (arg == 0 && !s->carry_live) { tgen_arithr(s, ARITH_XOR, ret, ret); return; }