From patchwork Thu May 6 15:50:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 51856 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 07CF7B7D5B for ; Fri, 7 May 2010 03:49:13 +1000 (EST) Received: from localhost ([127.0.0.1]:44631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA5Bs-0008Nj-W8 for incoming@patchwork.ozlabs.org; Thu, 06 May 2010 13:48:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OA50p-0005CI-0f for qemu-devel@nongnu.org; Thu, 06 May 2010 13:37:27 -0400 Received: from [140.186.70.92] (port=51394 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA50i-0004zS-Vc for qemu-devel@nongnu.org; Thu, 06 May 2010 13:37:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OA50R-0004nH-DZ for qemu-devel@nongnu.org; Thu, 06 May 2010 13:37:08 -0400 Received: from are.twiddle.net ([75.149.56.221]:47606) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OA50R-0004mi-5h for qemu-devel@nongnu.org; Thu, 06 May 2010 13:37:03 -0400 Received: from anchor.twiddle.home (anchor.twiddle.home [172.31.0.4]) by are.twiddle.net (Postfix) with ESMTPS id A6853FDD; Thu, 6 May 2010 10:37:01 -0700 (PDT) Received: from anchor.twiddle.home (anchor.twiddle.home [127.0.0.1]) by anchor.twiddle.home (8.14.4/8.14.4) with ESMTP id o46Fol6x002917; Thu, 6 May 2010 08:50:47 -0700 Received: (from rth@localhost) by anchor.twiddle.home (8.14.4/8.14.4/Submit) id o46Fol9J002916; Thu, 6 May 2010 08:50:47 -0700 From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 6 May 2010 08:50:42 -0700 Message-Id: <1273161045-2880-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.0.1 In-Reply-To: <1273161045-2880-1-git-send-email-rth@twiddle.net> References: <1273161045-2880-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 2/5] tcg-hppa: Load GUEST_BASE as an immediate. 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 Now that the prologue is generated after GUEST_BASE is fixed, we can load it as an immediate, and also avoid reserving the register if it isn't necessary. Signed-off-by: Richard Henderson --- tcg/hppa/tcg-target.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c index 012e486..a5f2162 100644 --- a/tcg/hppa/tcg-target.c +++ b/tcg/hppa/tcg-target.c @@ -1629,11 +1629,10 @@ void tcg_target_qemu_prologue(TCGContext *s) } #ifdef CONFIG_USE_GUEST_BASE - /* Note that GUEST_BASE can change after the prologue is generated. - To combat that, load the value from the variable instead of - embedding a constant here. */ - tcg_out_ld(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, - TCG_REG_R0, (tcg_target_long)&guest_base); + if (GUEST_BASE != 0) { + tcg_out_movi(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, GUEST_BASE); + tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); + } #endif /* Jump to TB, and adjust R18 to be the return address. */ @@ -1679,9 +1678,6 @@ void tcg_target_init(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_REG_DP); /* data pointer */ tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP); /* stack pointer */ tcg_regset_set_reg(s->reserved_regs, TCG_REG_R31); /* ble link reg */ -#ifdef CONFIG_USE_GUEST_BASE - tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); -#endif tcg_add_target_add_op_defs(hppa_op_defs); }