summaryrefslogtreecommitdiff
path: root/target-mips/translate.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-01 10:50:11 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-01 10:50:11 +0000
commit57fec1fee94aa9f7d2519e8c354f100fc36bc9fa (patch)
treedd3381d7ab3c77532719ea9366782b27f09bfc87 /target-mips/translate.c
parentc896fe29d6c8ae6cde3917727812ced3f2e536a4 (diff)
downloadqemu-57fec1fee94aa9f7d2519e8c354f100fc36bc9fa.tar.gz
qemu-57fec1fee94aa9f7d2519e8c354f100fc36bc9fa.tar.bz2
qemu-57fec1fee94aa9f7d2519e8c354f100fc36bc9fa.zip
use the TCG code generator
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3944 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/translate.c')
-rw-r--r--target-mips/translate.c43
1 files changed, 6 insertions, 37 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 719af3ae8f..1231c00cd3 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -29,29 +29,12 @@
#include "cpu.h"
#include "exec-all.h"
#include "disas.h"
+#include "tcg-op.h"
//#define MIPS_DEBUG_DISAS
//#define MIPS_DEBUG_SIGN_EXTENSIONS
//#define MIPS_SINGLE_STEP
-#ifdef USE_DIRECT_JUMP
-#define TBPARAM(x)
-#else
-#define TBPARAM(x) (long)(x)
-#endif
-
-enum {
-#define DEF(s, n, copy_size) INDEX_op_ ## s,
-#include "opc.h"
-#undef DEF
- NB_OPS,
-};
-
-static uint16_t *gen_opc_ptr;
-static uint32_t *gen_opparam_ptr;
-
-#include "gen-op.h"
-
/* MIPS major opcodes */
#define MASK_OP_MAJOR(op) (op & (0x3F << 26))
@@ -1777,17 +1760,13 @@ static always_inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong des
TranslationBlock *tb;
tb = ctx->tb;
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
- if (n == 0)
- gen_op_goto_tb0(TBPARAM(tb));
- else
- gen_op_goto_tb1(TBPARAM(tb));
+ tcg_gen_goto_tb(n);
gen_save_pc(dest);
- gen_op_set_T0((long)tb + n);
+ tcg_gen_exit_tb((long)tb + n);
} else {
gen_save_pc(dest);
- gen_op_reset_T0();
+ tcg_gen_exit_tb(0);
}
- gen_op_exit_tb();
}
/* Branches (before delay slot) */
@@ -6642,8 +6621,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx)
/* unconditional branch to register */
MIPS_DEBUG("branch to register");
gen_op_breg();
- gen_op_reset_T0();
- gen_op_exit_tb();
+ tcg_gen_exit_tb(0);
break;
default:
MIPS_DEBUG("unknown branch");
@@ -6665,10 +6643,7 @@ gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
fprintf (logfile, "search pc %d\n", search_pc);
pc_start = tb->pc;
- gen_opc_ptr = gen_opc_buf;
gen_opc_end = gen_opc_buf + OPC_MAX_SIZE;
- gen_opparam_ptr = gen_opparam_buf;
- nb_gen_labels = 0;
ctx.pc = pc_start;
ctx.saved_pc = -1;
ctx.tb = tb;
@@ -6748,8 +6723,7 @@ gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
break;
case BS_EXCP:
gen_op_interrupt_restart();
- gen_op_reset_T0();
- gen_op_exit_tb();
+ tcg_gen_exit_tb(0);
break;
case BS_BRANCH:
default:
@@ -6777,11 +6751,6 @@ done_generating:
target_disas(logfile, pc_start, ctx.pc - pc_start, 0);
fprintf(logfile, "\n");
}
- if (loglevel & CPU_LOG_TB_OP) {
- fprintf(logfile, "OP:\n");
- dump_ops(gen_opc_buf, gen_opparam_buf);
- fprintf(logfile, "\n");
- }
if (loglevel & CPU_LOG_TB_CPU) {
fprintf(logfile, "---------------- %d %08x\n", ctx.bstate, ctx.hflags);
}