From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KN47x-0001Sl-4C for qemu-devel@nongnu.org; Sun, 27 Jul 2008 07:09:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KN47w-0001SJ-Nv for qemu-devel@nongnu.org; Sun, 27 Jul 2008 07:09:24 -0400 Received: from [199.232.76.173] (port=41056 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KN47w-0001SD-HJ for qemu-devel@nongnu.org; Sun, 27 Jul 2008 07:09:24 -0400 Received: from savannah.gnu.org ([199.232.41.3]:60922 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KN47w-0007MS-GT for qemu-devel@nongnu.org; Sun, 27 Jul 2008 07:09:24 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KN47v-0004Nz-8M for qemu-devel@nongnu.org; Sun, 27 Jul 2008 11:09:23 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KN47u-0004Nv-RU for qemu-devel@nongnu.org; Sun, 27 Jul 2008 11:09:23 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Sun, 27 Jul 2008 11:09:22 +0000 Subject: [Qemu-devel] [4955] Special-case some paths inside tcg_out_tlb_read Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4955 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4955 Author: malc Date: 2008-07-27 11:09:21 +0000 (Sun, 27 Jul 2008) Log Message: ----------- Special-case some paths inside tcg_out_tlb_read a. Use 32bit arithmetics in TARGET_LONG_BITS == 32 case b. Optimize byte access case in TARGET_LONG_BITS == 64 case Modified Paths: -------------- trunk/tcg/ppc64/tcg-target.c Modified: trunk/tcg/ppc64/tcg-target.c =================================================================== --- trunk/tcg/ppc64/tcg-target.c 2008-07-27 10:28:15 UTC (rev 4954) +++ trunk/tcg/ppc64/tcg-target.c 2008-07-27 11:09:21 UTC (rev 4955) @@ -523,10 +523,28 @@ static void tcg_out_tlb_read (TCGContext *s, int r0, int r1, int r2, int addr_reg, int s_bits, int offset) { -#if TARGET_LONG_BITS == 32 +#ifdef TARGET_LONG_BITS tcg_out_rld (s, RLDICL, addr_reg, addr_reg, 0, 32); -#endif + tcg_out32 (s, (RLWINM + | RA (r0) + | RS (addr_reg) + | SH (32 - (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS)) + | MB (32 - (CPU_TLB_BITS + CPU_TLB_ENTRY_BITS)) + | ME (31 - CPU_TLB_ENTRY_BITS) + ) + ); + tcg_out32 (s, ADD | RT (r0) | RA (r0) | RB (TCG_AREG0)); + tcg_out32 (s, (LWZU | RT (r1) | RA (r0) | offset)); + tcg_out32 (s, (RLWINM + | RA (r2) + | RS (addr_reg) + | SH (0) + | MB ((32 - s_bits) & 31) + | ME (31 - TARGET_PAGE_BITS) + ) + ); +#else tcg_out_rld (s, RLDICL, r0, addr_reg, 64 - TARGET_PAGE_BITS, 64 - CPU_TLB_BITS); @@ -537,10 +555,16 @@ tcg_out32 (s, ADD | TAB (r0, r0, TCG_AREG0)); tcg_out32 (s, LD_ADDR | RT (r1) | RA (r0) | offset); - tcg_out_rld (s, RLDICL, r2, addr_reg, - 64 - TARGET_PAGE_BITS, - TARGET_PAGE_BITS - s_bits); - tcg_out_rld (s, RLDICL, r2, r2, TARGET_PAGE_BITS, 0); + if (!s_bits) { + tcg_out_rld (s, RLDICR, r2, addr_reg, 0, 63 - TARGET_PAGE_BITS); + } + else { + tcg_out_rld (s, RLDICL, r2, addr_reg, + 64 - TARGET_PAGE_BITS, + TARGET_PAGE_BITS - s_bits); + tcg_out_rld (s, RLDICL, r2, r2, TARGET_PAGE_BITS, 0); + } +#endif } static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)