From patchwork Sat May 12 01:16:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 158662 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 B3A5AB7001 for ; Sat, 12 May 2012 11:17:15 +1000 (EST) Received: from localhost ([::1]:53999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ST0xN-0004XO-A8 for incoming@patchwork.ozlabs.org; Fri, 11 May 2012 21:17:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ST0xE-0004Ww-0E for qemu-devel@nongnu.org; Fri, 11 May 2012 21:17:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ST0xC-0002My-AI for qemu-devel@nongnu.org; Fri, 11 May 2012 21:17:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41116 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ST0xC-0002Mf-0t; Fri, 11 May 2012 21:17:02 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id ACABA9E28A; Sat, 12 May 2012 03:17:00 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 12 May 2012 03:16:57 +0200 Message-Id: <1336785418-9439-2-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1336785418-9439-1-git-send-email-afaerber@suse.de> References: <1336785418-9439-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: qemu-ppc@nongnu.org, agraf@suse.de, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH for-1.1 1/2] tcg/ppc64: Don't hardcode register numbers for qemu_ld/st 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 Facilitates using r3 for prepended AREG0. Signed-off-by: Andreas Färber --- tcg/ppc64/tcg-target.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index d0b067b..0573a72 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -642,7 +642,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) { int addr_reg, data_reg, r0, r1, rbase, bswap; #ifdef CONFIG_SOFTMMU - int r2, mem_index, s_bits; + int r2, mem_index, s_bits, ir; void *label1_ptr, *label2_ptr; #endif @@ -669,8 +669,9 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) #endif /* slow path */ - tcg_out_mov (s, TCG_TYPE_I64, 3, addr_reg); - tcg_out_movi (s, TCG_TYPE_I64, 4, mem_index); + ir = 3; + tcg_out_mov (s, TCG_TYPE_I64, ir++, addr_reg); + tcg_out_movi (s, TCG_TYPE_I64, ir++, mem_index); #ifdef CONFIG_TCG_PASS_AREG0 /* XXX/FIXME: suboptimal */ @@ -799,7 +800,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc) { int addr_reg, r0, r1, rbase, data_reg, bswap; #ifdef CONFIG_SOFTMMU - int r2, mem_index; + int r2, mem_index, ir; void *label1_ptr, *label2_ptr; #endif @@ -825,9 +826,10 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc) #endif /* slow path */ - tcg_out_mov (s, TCG_TYPE_I64, 3, addr_reg); - tcg_out_rld (s, RLDICL, 4, data_reg, 0, 64 - (1 << (3 + opc))); - tcg_out_movi (s, TCG_TYPE_I64, 5, mem_index); + ir = 3; + tcg_out_mov (s, TCG_TYPE_I64, ir++, addr_reg); + tcg_out_rld (s, RLDICL, ir++, data_reg, 0, 64 - (1 << (3 + opc))); + tcg_out_movi (s, TCG_TYPE_I64, ir++, mem_index); #ifdef CONFIG_TCG_PASS_AREG0 /* XXX/FIXME: suboptimal */