mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
target/i386: Fix 32-bit AD[CO]X insns in 64-bit mode
Failure to truncate the inputs results in garbage for the carry-out. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1373 Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230115012103.3131796-1-richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
003ba52a8b
commit
6fbef9426b
3 changed files with 74 additions and 0 deletions
|
@ -1037,6 +1037,8 @@ static void gen_ADCOX(DisasContext *s, CPUX86State *env, MemOp ot, int cc_op)
|
|||
#ifdef TARGET_X86_64
|
||||
case MO_32:
|
||||
/* If TL is 64-bit just do everything in 64-bit arithmetic. */
|
||||
tcg_gen_ext32u_tl(s->T0, s->T0);
|
||||
tcg_gen_ext32u_tl(s->T1, s->T1);
|
||||
tcg_gen_add_i64(s->T0, s->T0, s->T1);
|
||||
tcg_gen_add_i64(s->T0, s->T0, carry_in);
|
||||
tcg_gen_shri_i64(carry_out, s->T0, 32);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue