From patchwork Tue Feb 11 21:03:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xabier Ugarte-Pedrero X-Patchwork-Id: 319419 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A3A582C0089 for ; Wed, 12 Feb 2014 08:32:08 +1100 (EST) Received: from localhost ([::1]:36081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDKvn-0002UC-2D for incoming@patchwork.ozlabs.org; Tue, 11 Feb 2014 16:31:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDKv8-0002JI-S1 for qemu-devel@nongnu.org; Tue, 11 Feb 2014 16:31:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDKv1-00086x-69 for qemu-devel@nongnu.org; Tue, 11 Feb 2014 16:31:10 -0500 Received: from ppp-seco21th2-46-193-160-128.wb.wifirst.net ([46.193.160.128]:41884 helo=xabi-desktop) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDKv0-00085R-JQ for qemu-devel@nongnu.org; Tue, 11 Feb 2014 16:31:03 -0500 Received: from xabi-desktop (xabi-desktop.local [192.168.0.1]) by xabi-desktop (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s1BL8Xgr026788; Tue, 11 Feb 2014 22:08:34 +0100 Received: (from xabi@localhost) by xabi-desktop (8.14.4/8.14.4/Submit) id s1BL8SDA026784; Tue, 11 Feb 2014 22:08:28 +0100 From: Xabier Ugarte-Pedrero To: qemu-devel@nongnu.org Date: Tue, 11 Feb 2014 22:03:01 +0100 Message-Id: <1392152582-26703-5-git-send-email-xabier.ugarte@deusto.es> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392152582-26703-1-git-send-email-xabier.ugarte@deusto.es> References: <1392152582-26703-1-git-send-email-xabier.ugarte@deusto.es> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 46.193.160.128 Cc: Xabier Ugarte-Pedrero Subject: [Qemu-devel] [PATCH 3/3] X86: The xor_zero case should also update the parity flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The xor of a register with itself should set the Z and the P flag, not only the Z flag. Signed-off-by: Xabier Ugarte-Pedrero --- 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 ee04092..05dd12b 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 d800ae3..c97d686 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -748,7 +748,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; }