From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5819] target-ppc: convert software TLB instructions to TCG
Date: Sun, 30 Nov 2008 16:22:56 +0000 [thread overview]
Message-ID: <E1L6p4S-0005qb-PS@cvs.savannah.gnu.org> (raw)
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 <aurelien@aurel32.net>
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
}
reply other threads:[~2008-11-30 16:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1L6p4S-0005qb-PS@cvs.savannah.gnu.org \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).