From nobody Mon Feb 9 16:01:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500440509196167.27139066981476; Tue, 18 Jul 2017 22:01:49 -0700 (PDT) Received: from localhost ([::1]:59907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXh7K-00072y-VW for importer@patchew.org; Wed, 19 Jul 2017 01:01:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXh3H-0003Fo-KK for qemu-devel@nongnu.org; Wed, 19 Jul 2017 00:57:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXh3F-00025E-Oy for qemu-devel@nongnu.org; Wed, 19 Jul 2017 00:57:35 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:35206) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXh3F-000258-Ih for qemu-devel@nongnu.org; Wed, 19 Jul 2017 00:57:33 -0400 Received: by mail-pf0-x243.google.com with SMTP id q85so5085907pfq.2 for ; Tue, 18 Jul 2017 21:57:33 -0700 (PDT) Received: from bigtime.twiddle.net (14-203-207-215.tpgi.com.au. [14.203.207.215]) by smtp.gmail.com with ESMTPSA id m196sm9062855pga.33.2017.07.18.21.57.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 21:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=MsIYxhQNqgWeaRQ/kfNzJ1lWugsH1ATqV1sfy/jXO2A=; b=N3Mr9hZxRW958XV1EAX5FazXqyzu1PMvRwhlOoiMOyf3mJ14KNfsLLEWfQoRVTbeLX fXLIfZewtmtMruJ3z6FH46d8ZE9IK38Y86F2NopmXd1bdKm2emR5OpJranKyIWblni6l y5PrwfO/mEa1yWoKzl74h2GlLX9RoKnJHz1xRgzpsq9mub0d/GhfYGQcRXcBcenq9pre E9q+R0tgox1enUlwTCBifv5t5PA4nN3YciuM5OuRKYmy0c1kK7OdsY8omNJKVZ81Y4Dh LcoSNp2OrN9KsT0ue6sXCW7hfZaIKohGtkoy41SYtGnx9wVQzUgCsdjLlA4NGlR6xqZC d8fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=MsIYxhQNqgWeaRQ/kfNzJ1lWugsH1ATqV1sfy/jXO2A=; b=EDjRDlqeMp110zUAbP8lEw17ZkkYJOGIqPi6YfsAiZGPTpOWN8XdZ5uWp+1UvqEAfu trerPuMv5kY4yHIFi8xDH1Z1bx0dhppIc8E5inrtB7pC95VmJID0Da2YcDMTAqVhsaLz 5DyQI11TJPCebmhmXAB9uqkdq9BIhxmmzBHYhLnnw4KYcK7LMCgnnnqyUENBfweIuZPO TJ4GdG4r2mtbdsWjTYdehbCXFgUEJMjtk/IrQinNS/lNzhPQixe1Ig+vA40dIVolxgi6 4Y4KNK/X8FtDgbdvrQ6lzvE+bMu+mkrFLhWU80n+NPYPBfQZeEwPNQpgz8Gg1VHyVqoL 4n8w== X-Gm-Message-State: AIVw112Slbn8WZ1xmBCxtKvrEadVyaXvox8BgroDO9W7pIqrz6G1HgL5 xk4MgrqlgXctEz0vDXk= X-Received: by 10.101.76.206 with SMTP id n14mr1172569pgt.154.1500440252405; Tue, 18 Jul 2017 21:57:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 18:57:09 -1000 Message-Id: <20170719045722.25492-2-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170719045722.25492-1-rth@twiddle.net> References: <20170719045722.25492-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PULL 01/14] tcg/mips: reserve a register for the guest_base. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Jiang Biao Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jiang Biao Reserve a register for the guest_base using ppc code for reference. By doing so, we do not have to recompute it for every memory load. Signed-off-by: Jiang Biao Signed-off-by: Richard Henderson Message-Id: <1499677934-2249-1-git-send-email-jiang.biao2@zte.com.cn> --- tcg/mips/tcg-target.inc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c index 85756b8..1a8169f 100644 --- a/tcg/mips/tcg-target.inc.c +++ b/tcg/mips/tcg-target.inc.c @@ -85,6 +85,10 @@ static const char * const tcg_target_reg_names[TCG_TARGE= T_NB_REGS] =3D { #define TCG_TMP2 TCG_REG_T8 #define TCG_TMP3 TCG_REG_T7 =20 +#ifndef CONFIG_SOFTMMU +#define TCG_GUEST_BASE_REG TCG_REG_S1 +#endif + /* check if we really need so many registers :P */ static const int tcg_target_reg_alloc_order[] =3D { /* Call saved registers. */ @@ -1547,8 +1551,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGA= rg *args, bool is_64) } else if (guest_base =3D=3D (int16_t)guest_base) { tcg_out_opc_imm(s, ALIAS_PADDI, base, addr_regl, guest_base); } else { - tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, guest_base); - tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP0, addr_regl); + tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_GUEST_BASE_REG, addr_regl= ); } tcg_out_qemu_ld_direct(s, data_regl, data_regh, base, opc, is_64); #endif @@ -1652,8 +1655,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGA= rg *args, bool is_64) } else if (guest_base =3D=3D (int16_t)guest_base) { tcg_out_opc_imm(s, ALIAS_PADDI, base, addr_regl, guest_base); } else { - tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, guest_base); - tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP0, addr_regl); + tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_GUEST_BASE_REG, addr_regl= ); } tcg_out_qemu_st_direct(s, data_regl, data_regh, base, opc); #endif @@ -2452,6 +2454,13 @@ static void tcg_target_qemu_prologue(TCGContext *s) TCG_REG_SP, SAVE_OFS + i * REG_SIZE); } =20 +#ifndef CONFIG_SOFTMMU + if (guest_base) { + 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 + /* Call generated code */ tcg_out_opc_reg(s, OPC_JR, 0, tcg_target_call_iarg_regs[1], 0); /* delay slot */ --=20 2.9.4