Skip to content

Commit

Permalink
target-i386: Fix CC_OP_CLR vs PF
Browse files Browse the repository at this point in the history
Parity should be set for a zero result.

Cc: qemu-stable@nongnu.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
(cherry picked from commit d2fe51b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
rth7680 authored and mdroth committed Jun 25, 2014
1 parent 91ae1d3 commit 2e191f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion target-i386/cc_helper.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion target-i386/translate.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2e191f8

Please sign in to comment.