From patchwork Mon Oct 5 15:18:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Desnogues X-Patchwork-Id: 35019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 460C1B7B8D for ; Tue, 6 Oct 2009 02:19:10 +1100 (EST) Received: from localhost ([127.0.0.1]:52189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MupL8-0000fL-Um for incoming@patchwork.ozlabs.org; Mon, 05 Oct 2009 11:19:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MupKX-0000cv-Lt for qemu-devel@nongnu.org; Mon, 05 Oct 2009 11:18:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MupKX-0000bt-1M for qemu-devel@nongnu.org; Mon, 05 Oct 2009 11:18:29 -0400 Received: from [199.232.76.173] (port=50071 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MupKW-0000be-UG for qemu-devel@nongnu.org; Mon, 05 Oct 2009 11:18:28 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]:53705) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MupKW-0000xB-Gl for qemu-devel@nongnu.org; Mon, 05 Oct 2009 11:18:28 -0400 Received: by fg-out-1718.google.com with SMTP id d23so979400fga.10 for ; Mon, 05 Oct 2009 08:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=PUTkzjbTIAtij/nehja8Xt7tt7EZEL2PlhI9hr579x4=; b=tww5M1zofwJbxQBG1taKL2KFhm1hwtSCPxxes3BOjrkJYEbtWu39snjJpsDI1zB7Kx SCJZkHFIeraG2zE341Pby1NTWXzebFXYiia2FsxmTRGP7EunWtrZYt+fGXOHY8CaeORq FOastTyCl3MOGBAvwtf2Wy10VlkiOAOO0xs+g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=b4DKh6B8RPLE8MRnsw2ouroyGKG0w3IoCqbdH8/jwGfGWME9iyilh8ifxTBNjH4i7/ /6gPcpjV/sDpCXU24UeruWDGG+VtlVidfnA7imJpuHJt+dpfCbLA/CYfT+qWLu5DJPbf azXqODT24vWf/ysQQthL4kBM5lZJfWPqKGylQ= MIME-Version: 1.0 Received: by 10.86.211.38 with SMTP id j38mr83616fgg.26.1254755906687; Mon, 05 Oct 2009 08:18:26 -0700 (PDT) Date: Mon, 5 Oct 2009 17:18:26 +0200 Message-ID: <761ea48b0910050818g6d3e9974h51a2d1d11fde5ee6@mail.gmail.com> From: Laurent Desnogues To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH] i386 target: fix ARPL X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hello, The arpl implementation in target-i386/translate.c uses cpu_A0 temporary across a brcond op. This patch fixes that issue. Note I didn't test it, I only looked at generated code to check it was making sense. Laurent diff --git a/target-i386/translate.c b/target-i386/translate.c index e3cb49f..807707f 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -7305,13 +7305,14 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) #endif { int label1; - TCGv t0, t1, t2; + TCGv t0, t1, t2, a0; if (!s->pe || s->vm86) goto illegal_op; t0 = tcg_temp_local_new(); t1 = tcg_temp_local_new(); t2 = tcg_temp_local_new(); + a0 = tcg_temp_local_new(); ot = OT_WORD; modrm = ldub_code(s->pc++); reg = (modrm >> 3) & 7; @@ -7320,6 +7321,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) if (mod != 3) { gen_lea_modrm(s, modrm, ®_addr, &offset_addr); gen_op_ld_v(ot + s->mem_index, t0, cpu_A0); + tcg_gen_mov_tl(a0, cpu_A0); } else { gen_op_mov_v_reg(ot, t0, rm); } @@ -7334,7 +7336,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) tcg_gen_movi_tl(t2, CC_Z); gen_set_label(label1); if (mod != 3) { - gen_op_st_v(ot + s->mem_index, t0, cpu_A0); + gen_op_st_v(ot + s->mem_index, t0, a0); } else { gen_op_mov_reg_v(ot, rm, t0); } @@ -7347,6 +7349,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) tcg_temp_free(t0); tcg_temp_free(t1); tcg_temp_free(t2); + tcg_temp_free(a0); } break; case 0x102: /* lar */