From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6p4W-0005cl-30 for qemu-devel@nongnu.org; Sun, 30 Nov 2008 11:23:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6p4U-0005cY-Bi for qemu-devel@nongnu.org; Sun, 30 Nov 2008 11:22:59 -0500 Received: from [199.232.76.173] (port=39006 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6p4U-0005cV-6m for qemu-devel@nongnu.org; Sun, 30 Nov 2008 11:22:58 -0500 Received: from savannah.gnu.org ([199.232.41.3]:48758 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 1L6p4T-0006cy-Ri for qemu-devel@nongnu.org; Sun, 30 Nov 2008 11:22:58 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1L6p4T-0005qh-6w for qemu-devel@nongnu.org; Sun, 30 Nov 2008 16:22:57 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1L6p4S-0005qb-PS for qemu-devel@nongnu.org; Sun, 30 Nov 2008 16:22:57 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sun, 30 Nov 2008 16:22:56 +0000 Subject: [Qemu-devel] [5819] target-ppc: convert software TLB instructions to TCG 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: 5819 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5819 Author: aurel32 Date: 2008-11-30 16:22:56 +0000 (Sun, 30 Nov 2008) Log Message: ----------- target-ppc: convert software TLB instructions to TCG Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/helper.h trunk/target-ppc/op.c trunk/target-ppc/op_helper.c trunk/target-ppc/op_helper.h trunk/target-ppc/translate.c Modified: trunk/target-ppc/helper.h =================================================================== --- trunk/target-ppc/helper.h 2008-11-30 10:24:13 UTC (rev 5818) +++ trunk/target-ppc/helper.h 2008-11-30 16:22:56 UTC (rev 5819) @@ -139,4 +139,11 @@ DEF_HELPER_2(efdcmpgt, i32, i64, i64) DEF_HELPER_2(efdcmpeq, i32, i64, i64) +#if !defined(CONFIG_USER_ONLY) +DEF_HELPER_1(load_6xx_tlbd, void, tl) +DEF_HELPER_1(load_6xx_tlbi, void, tl) +DEF_HELPER_1(load_74xx_tlbd, void, tl) +DEF_HELPER_1(load_74xx_tlbi, void, tl) +#endif + #include "def-helper.h" Modified: trunk/target-ppc/op.c =================================================================== --- trunk/target-ppc/op.c 2008-11-30 10:24:13 UTC (rev 5818) +++ trunk/target-ppc/op.c 2008-11-30 16:22:56 UTC (rev 5819) @@ -378,34 +378,6 @@ #endif #endif -#if !defined(CONFIG_USER_ONLY) -/* PowerPC 602/603/755 software TLB load instructions */ -void OPPROTO op_6xx_tlbld (void) -{ - do_load_6xx_tlb(0); - RETURN(); -} - -void OPPROTO op_6xx_tlbli (void) -{ - do_load_6xx_tlb(1); - RETURN(); -} - -/* PowerPC 74xx software TLB load instructions */ -void OPPROTO op_74xx_tlbld (void) -{ - do_load_74xx_tlb(0); - RETURN(); -} - -void OPPROTO op_74xx_tlbli (void) -{ - do_load_74xx_tlb(1); - RETURN(); -} -#endif - /* 601 specific */ void OPPROTO op_load_601_rtcl (void) { Modified: trunk/target-ppc/op_helper.c =================================================================== --- trunk/target-ppc/op_helper.c 2008-11-30 10:24:13 UTC (rev 5818) +++ trunk/target-ppc/op_helper.c 2008-11-30 16:22:56 UTC (rev 5819) @@ -2460,7 +2460,7 @@ /* Software driven TLBs management */ /* PowerPC 602/603 software TLB load instructions helpers */ -void do_load_6xx_tlb (int is_code) +static void helper_load_6xx_tlb (target_ulong new_EPN, int is_code) { target_ulong RPN, CMP, EPN; int way; @@ -2482,12 +2482,23 @@ } #endif /* Store this TLB */ - ppc6xx_tlb_store(env, (uint32_t)(T0 & TARGET_PAGE_MASK), + ppc6xx_tlb_store(env, (uint32_t)(new_EPN & TARGET_PAGE_MASK), way, is_code, CMP, RPN); } -void do_load_74xx_tlb (int is_code) +void helper_load_6xx_tlbd (target_ulong EPN) { + helper_load_6xx_tlb(EPN, 0); +} + +void helper_load_6xx_tlbi (target_ulong EPN) +{ + helper_load_6xx_tlb(EPN, 1); +} + +/* PowerPC 74xx software TLB load instructions helpers */ +static void helper_load_74xx_tlb (target_ulong new_EPN, int is_code) +{ target_ulong RPN, CMP, EPN; int way; @@ -2503,10 +2514,20 @@ } #endif /* Store this TLB */ - ppc6xx_tlb_store(env, (uint32_t)(T0 & TARGET_PAGE_MASK), + ppc6xx_tlb_store(env, (uint32_t)(new_EPN & TARGET_PAGE_MASK), way, is_code, CMP, RPN); } +void helper_load_74xx_tlbd (target_ulong EPN) +{ + helper_load_74xx_tlb(EPN, 0); +} + +void helper_load_74xx_tlbi (target_ulong EPN) +{ + helper_load_74xx_tlb(EPN, 1); +} + static always_inline target_ulong booke_tlb_to_page_size (int size) { return 1024 << (2 * size); Modified: trunk/target-ppc/op_helper.h =================================================================== --- trunk/target-ppc/op_helper.h 2008-11-30 10:24:13 UTC (rev 5818) +++ trunk/target-ppc/op_helper.h 2008-11-30 16:22:56 UTC (rev 5819) @@ -67,8 +67,6 @@ void do_rfid (void); void do_hrfid (void); #endif -void do_load_6xx_tlb (int is_code); -void do_load_74xx_tlb (int is_code); #endif /* POWER / PowerPC 601 specific helpers */ Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2008-11-30 10:24:13 UTC (rev 5818) +++ trunk/target-ppc/translate.c 2008-11-30 16:22:56 UTC (rev 5819) @@ -4965,8 +4965,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); - gen_op_6xx_tlbld(); + gen_helper_load_6xx_tlbd(cpu_gpr[rB(ctx->opcode)]); #endif } @@ -4980,8 +4979,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); - gen_op_6xx_tlbli(); + gen_helper_load_6xx_tlbi(cpu_gpr[rB(ctx->opcode)]); #endif } @@ -4996,8 +4994,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); - gen_op_74xx_tlbld(); + gen_helper_load_74xx_tlbd(cpu_gpr[rB(ctx->opcode)]); #endif } @@ -5011,8 +5008,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); - gen_op_74xx_tlbli(); + gen_helper_load_74xx_tlbi(cpu_gpr[rB(ctx->opcode)]); #endif }