From 2e191f8e545c3235849508bd555e4856347e9cc5 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 10 Jan 2014 12:38:40 -0800 Subject: [PATCH] target-i386: Fix CC_OP_CLR vs PF Parity should be set for a zero result. Cc: qemu-stable@nongnu.org Reviewed-by: Paolo Bonzini Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson (cherry picked from commit d2fe51bda8adf33d07c21e034fdc13a1e1fa4e19) Signed-off-by: Michael Roth --- target-i386/cc_helper.c | 2 +- target-i386/translate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/cc_helper.c b/target-i386/cc_helper.c index ee04092b4e..05dd12b5a7 100644 --- a/target-i386/cc_helper.c +++ b/target-i386/cc_helper.c @@ -103,7 +103,7 @@ target_ulong helper_cc_compute_all(target_ulong dst, target_ulong src1, case CC_OP_EFLAGS: return src1; case CC_OP_CLR: - return CC_Z; + return CC_Z | CC_P; case CC_OP_MULB: return compute_all_mulb(dst, src1); diff --git a/target-i386/translate.c b/target-i386/translate.c index 7916e5b1f6..b19ea14458 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -915,7 +915,7 @@ static void gen_compute_eflags(DisasContext *s) return; } if (s->cc_op == CC_OP_CLR) { - tcg_gen_movi_tl(cpu_cc_src, CC_Z); + tcg_gen_movi_tl(cpu_cc_src, CC_Z | CC_P); set_cc_op(s, CC_OP_EFLAGS); return; }