aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-10-06 00:18:55 +0200
committerRichard Henderson <rth@twiddle.net>2013-02-18 15:03:56 -0800
commit6fa38ed219587723fcab9b878f42269489d51705 (patch)
treea27b1e9a49b8d5cae1cfa46218d2a06ba41abf46
parentf5847c912d62d60a9917ed1e88cd6d4548fd40f3 (diff)
downloadqemu-6fa38ed219587723fcab9b878f42269489d51705.zip
qemu-6fa38ed219587723fcab9b878f42269489d51705.tar.gz
qemu-6fa38ed219587723fcab9b878f42269489d51705.tar.bz2
target-i386: clean up sahf
Discard CC_DST and set s->cc_op immediately after computing EFLAGS. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Richard Henderson <rth@twiddle.net>
-rw-r--r--target-i386/translate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 80483c0..64564e0 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -6502,10 +6502,12 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
if (s->cc_op != CC_OP_DYNAMIC)
gen_op_set_cc_op(s->cc_op);
gen_compute_eflags(cpu_cc_src);
+ tcg_gen_discard_tl(cpu_cc_dst);
+ s->cc_op = CC_OP_EFLAGS;
+
tcg_gen_andi_tl(cpu_cc_src, cpu_cc_src, CC_O);
tcg_gen_andi_tl(cpu_T[0], cpu_T[0], CC_S | CC_Z | CC_A | CC_P | CC_C);
tcg_gen_or_tl(cpu_cc_src, cpu_cc_src, cpu_T[0]);
- s->cc_op = CC_OP_EFLAGS;
break;
case 0x9f: /* lahf */
if (CODE64(s) && !(s->cpuid_ext3_features & CPUID_EXT3_LAHF_LM))