tcg: add extended MMU helpers to targets
RFC PATCH 2/4 tcg: add extended MMU helpers to targets
Add extended MMU helpers to softmmu targets, where the targets are alpha, arm, cris, i386, lm32, m68k, microblaze, mips, ppc, s390x, sh4, sparc and xtensa.
---
target-alpha/mem_helper.c | 22 ++++++++++++++++++++++ target-arm/op_helper.c | 23 +++++++++++++++++++++++ target-cris/op_helper.c | 22 ++++++++++++++++++++++ target-i386/mem_helper.c | 22 ++++++++++++++++++++++ target-lm32/op_helper.c | 23 ++++++++++++++++++++++- target-m68k/op_helper.c | 22 ++++++++++++++++++++++ target-microblaze/op_helper.c | 22 ++++++++++++++++++++++ target-mips/op_helper.c | 22 ++++++++++++++++++++++ target-ppc/mem_helper.c | 22 ++++++++++++++++++++++ target-s390x/op_helper.c | 22 ++++++++++++++++++++++ target-sh4/op_helper.c | 22 ++++++++++++++++++++++ target-sparc/ldst_helper.c | 23 +++++++++++++++++++++++ target-xtensa/op_helper.c | 22 ++++++++++++++++++++++ 13 files changed, 288 insertions(+), 1 deletions(-)
target-alpha/mem_helper.c +0 -0
@@ -132,6 +132,28 @@ void cpu_unassigned_access(CPUAlphaState *env, target_phys_addr_t addr,
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */
target-arm/op_helper.c +0 -0
@@ -69,6 +69,29 @@ uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def,
#define SHIFT 3
#include "softmmu_template.h"
+
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */
target-cris/op_helper.c +0 -0
@@ -52,6 +52,28 @@
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* Try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */
target-i386/mem_helper.c +0 -0
@@ -126,6 +126,28 @@ void helper_boundl(target_ulong a0, int v)
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
#endif
#if !defined(CONFIG_USER_ONLY)
target-lm32/op_helper.c +0 -0
@@ -18,6 +18,28 @@
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
void helper_raise_exception(uint32_t index)
{
env->exception_index = index;
@@ -101,4 +123,3 @@ void tlb_fill(CPULM32State *env1, target_ulong addr, int is_write, int mmu_idx,
env = saved_env;
}#endif
-
target-m68k/op_helper.c +0 -0
@@ -51,6 +51,28 @@ extern int semihosting_enabled;
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* Try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */
target-microblaze/op_helper.c +0 -0
@@ -39,6 +39,28 @@
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* Try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */
target-mips/op_helper.c +0 -0
@@ -2303,6 +2303,28 @@ static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
static void do_unaligned_access(target_ulong addr, int is_write,
int is_user, uintptr_t retaddr)
{
target-ppc/mem_helper.c +0 -0
@@ -268,6 +268,28 @@ STVE(stvewx, cpu_stl_data, bswap32, u32)
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */
target-s390x/op_helper.c +0 -0
@@ -52,6 +52,28 @@
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */
target-sh4/op_helper.c +0 -0
@@ -53,6 +53,28 @@ static void cpu_restore_state_from_retaddr(uintptr_t retaddr)
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
void tlb_fill(CPUSH4State *env1, target_ulong addr, int is_write, int mmu_idx,
uintptr_t retaddr)
{
target-sparc/ldst_helper.c +0 -0
@@ -80,6 +80,29 @@
#define SHIFT 3
#include "softmmu_template.h"
+
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
#endif
#if defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY)
target-xtensa/op_helper.c +0 -0
@@ -47,6 +47,28 @@ static void do_unaligned_access(CPUXtensaState *env,
#define SHIFT 3
#include "softmmu_template.h"
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
static void do_restore_state(CPUXtensaState *env, uintptr_t pc)
{
TranslationBlock *tb;__________________________________
Principal Engineer
VM Team
Yeongkyoon Lee
S-Core Co., Ltd.
D.L.: +82-31-696-7249
M.P.: +82-10-9965-1265
__________________________________