From patchwork Tue Feb 19 17:39:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 221883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 18C6C2C008E for ; Wed, 20 Feb 2013 07:51:02 +1100 (EST) Received: from localhost ([::1]:56409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7u9U-0001ND-8N for incoming@patchwork.ozlabs.org; Tue, 19 Feb 2013 15:51:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7rC0-0005pd-Jx for qemu-devel@nongnu.org; Tue, 19 Feb 2013 12:41:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7rBY-0007xV-Gz for qemu-devel@nongnu.org; Tue, 19 Feb 2013 12:41:19 -0500 Received: from mail-pb0-f52.google.com ([209.85.160.52]:50085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7rBY-0007x2-1w for qemu-devel@nongnu.org; Tue, 19 Feb 2013 12:40:56 -0500 Received: by mail-pb0-f52.google.com with SMTP id ma3so2345862pbc.25 for ; Tue, 19 Feb 2013 09:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=REr25x3onnKrAf1cf1TtKHQmUthNTOHvrHBmn5VJlBg=; b=vvmyWQh8DHCjdvq6dKzMiHi+of4H8dROriv4uYgacIvaJrQOZAiDdf4fxj/esOw3YI Pslnjc+Kd87WX5YMbfPlvlEOfuDiHgDYcOCwYiCL6DGNn2q3Fo2QUJJduDSXm3dlyfGo 9RPYC3RZ5wjeozXj7LKDpFU2OGDRLs90DeQBe9uq/TtvwlrroKcRxQFzG0/ap2/4ChSP 5fQM6r0cqBhu1viIiB0zEhvZ2Y32p3TmnVQX6bzihRRRA7v6S7OXLNiTiDmjO4O51sHr AjfNrxv6DISTmdUhc0kzex+T3Pf8RTbio1kqNmx76YY2zJQ1mewRCi/ieeD0sAUWNPGW 2uxw== X-Received: by 10.66.163.8 with SMTP id ye8mr35701348pab.82.1361295655201; Tue, 19 Feb 2013 09:40:55 -0800 (PST) Received: from anchor.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id 1sm18659295pbg.18.2013.02.19.09.40.53 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 19 Feb 2013 09:40:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Feb 2013 09:39:44 -0800 Message-Id: <1361295631-21316-11-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1361295631-21316-1-git-send-email-rth@twiddle.net> References: <1361295631-21316-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.52 Cc: blauwirbel@gmail.com, pbonzini@redhat.com, afaerber@suse.de, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 10/57] target-i386: clean up sahf 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 From: Paolo Bonzini Discard CC_DST and set s->cc_op immediately after computing EFLAGS. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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))