From patchwork Tue Oct 6 14:29:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Desnogues X-Patchwork-Id: 35116 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 44AA7B7BAD for ; Wed, 7 Oct 2009 01:47:46 +1100 (EST) Received: from localhost ([127.0.0.1]:55016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvBKI-0002R5-LY for incoming@patchwork.ozlabs.org; Tue, 06 Oct 2009 10:47:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvB2o-00083I-BL for qemu-devel@nongnu.org; Tue, 06 Oct 2009 10:29:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvB2n-00082S-IQ for qemu-devel@nongnu.org; Tue, 06 Oct 2009 10:29:37 -0400 Received: from [199.232.76.173] (port=36451 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvB2n-00082E-AD for qemu-devel@nongnu.org; Tue, 06 Oct 2009 10:29:37 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]:27938) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvB2m-0000if-SF for qemu-devel@nongnu.org; Tue, 06 Oct 2009 10:29:37 -0400 Received: by fg-out-1718.google.com with SMTP id e21so693482fga.10 for ; Tue, 06 Oct 2009 07:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=JVAEt7JN5SGlcJ6Npu4O5AMt4lQj2z6zinhLetofss4=; b=VP7dr1/mUxUMWe2+353MNJkOOu+dQMp0EsbTNfRUg2knlVXLxS2bIlzTkjY04ScyD4 0IKzO7hidhYp0I/mArR9Rbk6mT/7P7qjoYdtxQWMtQGrTqMbb6lYss4/NiNw+Kt8vlzI EdTVhvllbkYOt4wJoyKFwJDV7YwaMuPxTkOWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NkP5/wQZSZa0YbgtSSuSOgg7kmRULjs8Z+gCBMh37Oq27V2n21jy9AdeDDo8Yk5w80 pOelMmWugBxqvftetYN6A7ETCmluG1M8h9TdIOX3/mxgG9w71a0FdioYfCrUO/y3a6lW c96+DIvWuPxsnI6H4FzYOheVmAS3UUL1bO/2g= MIME-Version: 1.0 Received: by 10.86.187.7 with SMTP id k7mr578227fgf.30.1254839375873; Tue, 06 Oct 2009 07:29:35 -0700 (PDT) In-Reply-To: <20091005215606.GA22831@volta.aurel32.net> References: <761ea48b0910050818g6d3e9974h51a2d1d11fde5ee6@mail.gmail.com> <20091005215606.GA22831@volta.aurel32.net> Date: Tue, 6 Oct 2009 16:29:35 +0200 Message-ID: <761ea48b0910060729r4ec322f5jaebc6ee128899aaa@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH] i386 target: fix ARPL From: Laurent Desnogues To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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 On Mon, Oct 5, 2009 at 11:56 PM, Aurelien Jarno wrote: [...] > This looks indeed correct. I wonder however if it would be better to do > the tcg_temp_local_new() / tcg_temp_free() in the if (mod != 3) path > only. I'm not sure it will make any difference (arpl is probably not used extensively). Anywyay here is an updated patch. Laurent Signed-off-by: Laurent Desnogues diff --git a/target-i386/translate.c b/target-i386/translate.c index e3cb49f..2511943 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -7305,7 +7305,7 @@ 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; @@ -7320,8 +7320,11 @@ 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); + a0 = tcg_temp_local_new(); + tcg_gen_mov_tl(a0, cpu_A0); } else { gen_op_mov_v_reg(ot, t0, rm); + TCGV_UNUSED(a0); } gen_op_mov_v_reg(ot, t1, reg); tcg_gen_andi_tl(cpu_tmp0, t0, 3); @@ -7334,8 +7337,9 @@ 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); - } else { + gen_op_st_v(ot + s->mem_index, t0, a0); + tcg_temp_free(a0); + } else { gen_op_mov_reg_v(ot, rm, t0); } if (s->cc_op != CC_OP_DYNAMIC)