Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jz7DZ-0000jU-5r for qemu-devel@nongnu.org; Thu, 22 May 2008 05:36:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jz7DW-0000ia-Ju for qemu-devel@nongnu.org; Thu, 22 May 2008 05:36:11 -0400 Received: from [199.232.76.173] (port=46980 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jz7DV-0000iL-La for qemu-devel@nongnu.org; Thu, 22 May 2008 05:36:10 -0400 Received: from savannah.gnu.org ([199.232.41.3]:60646 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jz7DV-0008AY-HK for qemu-devel@nongnu.org; Thu, 22 May 2008 05:36:09 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Jz7DU-0007cr-Qa for qemu-devel@nongnu.org; Thu, 22 May 2008 09:36:08 +0000 Received: from bellard by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Jz7DU-0007cj-Fh for qemu-devel@nongnu.org; Thu, 22 May 2008 09:36:08 +0000 MIME-Version: 1.0 Errors-To: bellard Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Fabrice Bellard Message-Id: Date: Thu, 22 May 2008 09:36:08 +0000 Subject: [Qemu-devel] [4521] cmpxchg 64 bit fix Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4521 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4521 Author: bellard Date: 2008-05-22 09:36:08 +0000 (Thu, 22 May 2008) Log Message: ----------- cmpxchg 64 bit fix Modified Paths: -------------- trunk/target-i386/translate.c Modified: trunk/target-i386/translate.c =================================================================== --- trunk/target-i386/translate.c 2008-05-22 09:20:43 UTC (rev 4520) +++ trunk/target-i386/translate.c 2008-05-22 09:36:08 UTC (rev 4521) @@ -4286,7 +4286,7 @@ case 0x1b0: case 0x1b1: /* cmpxchg Ev, Gv */ { - int label1; + int label1, label2; if ((b & 1) == 0) ot = OT_BYTE; @@ -4309,12 +4309,18 @@ tcg_gen_sub_tl(cpu_T3, cpu_T3, cpu_T[0]); gen_extu(ot, cpu_T3); tcg_gen_brcond_tl(TCG_COND_EQ, cpu_T3, tcg_const_tl(0), label1); - tcg_gen_mov_tl(cpu_T[1], cpu_T[0]); - gen_op_mov_reg_T0(ot, R_EAX); - gen_set_label(label1); if (mod == 3) { + label2 = gen_new_label(); + gen_op_mov_reg_T0(ot, R_EAX); + tcg_gen_br(label2); + gen_set_label(label1); gen_op_mov_reg_T1(ot, rm); + gen_set_label(label2); } else { + tcg_gen_mov_tl(cpu_T[1], cpu_T[0]); + gen_op_mov_reg_T0(ot, R_EAX); + gen_set_label(label1); + /* always store */ gen_op_st_T1_A0(ot + s->mem_index); } tcg_gen_mov_tl(cpu_cc_src, cpu_T[0]);