Revision 57fec1fe target-mips/translate.c
b/target-mips/translate.c | ||
---|---|---|
29 | 29 |
#include "cpu.h" |
30 | 30 |
#include "exec-all.h" |
31 | 31 |
#include "disas.h" |
32 |
#include "tcg-op.h" |
|
32 | 33 |
|
33 | 34 |
//#define MIPS_DEBUG_DISAS |
34 | 35 |
//#define MIPS_DEBUG_SIGN_EXTENSIONS |
35 | 36 |
//#define MIPS_SINGLE_STEP |
36 | 37 |
|
37 |
#ifdef USE_DIRECT_JUMP |
|
38 |
#define TBPARAM(x) |
|
39 |
#else |
|
40 |
#define TBPARAM(x) (long)(x) |
|
41 |
#endif |
|
42 |
|
|
43 |
enum { |
|
44 |
#define DEF(s, n, copy_size) INDEX_op_ ## s, |
|
45 |
#include "opc.h" |
|
46 |
#undef DEF |
|
47 |
NB_OPS, |
|
48 |
}; |
|
49 |
|
|
50 |
static uint16_t *gen_opc_ptr; |
|
51 |
static uint32_t *gen_opparam_ptr; |
|
52 |
|
|
53 |
#include "gen-op.h" |
|
54 |
|
|
55 | 38 |
/* MIPS major opcodes */ |
56 | 39 |
#define MASK_OP_MAJOR(op) (op & (0x3F << 26)) |
57 | 40 |
|
... | ... | |
1777 | 1760 |
TranslationBlock *tb; |
1778 | 1761 |
tb = ctx->tb; |
1779 | 1762 |
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { |
1780 |
if (n == 0) |
|
1781 |
gen_op_goto_tb0(TBPARAM(tb)); |
|
1782 |
else |
|
1783 |
gen_op_goto_tb1(TBPARAM(tb)); |
|
1763 |
tcg_gen_goto_tb(n); |
|
1784 | 1764 |
gen_save_pc(dest); |
1785 |
gen_op_set_T0((long)tb + n);
|
|
1765 |
tcg_gen_exit_tb((long)tb + n);
|
|
1786 | 1766 |
} else { |
1787 | 1767 |
gen_save_pc(dest); |
1788 |
gen_op_reset_T0();
|
|
1768 |
tcg_gen_exit_tb(0);
|
|
1789 | 1769 |
} |
1790 |
gen_op_exit_tb(); |
|
1791 | 1770 |
} |
1792 | 1771 |
|
1793 | 1772 |
/* Branches (before delay slot) */ |
... | ... | |
6642 | 6621 |
/* unconditional branch to register */ |
6643 | 6622 |
MIPS_DEBUG("branch to register"); |
6644 | 6623 |
gen_op_breg(); |
6645 |
gen_op_reset_T0(); |
|
6646 |
gen_op_exit_tb(); |
|
6624 |
tcg_gen_exit_tb(0); |
|
6647 | 6625 |
break; |
6648 | 6626 |
default: |
6649 | 6627 |
MIPS_DEBUG("unknown branch"); |
... | ... | |
6665 | 6643 |
fprintf (logfile, "search pc %d\n", search_pc); |
6666 | 6644 |
|
6667 | 6645 |
pc_start = tb->pc; |
6668 |
gen_opc_ptr = gen_opc_buf; |
|
6669 | 6646 |
gen_opc_end = gen_opc_buf + OPC_MAX_SIZE; |
6670 |
gen_opparam_ptr = gen_opparam_buf; |
|
6671 |
nb_gen_labels = 0; |
|
6672 | 6647 |
ctx.pc = pc_start; |
6673 | 6648 |
ctx.saved_pc = -1; |
6674 | 6649 |
ctx.tb = tb; |
... | ... | |
6748 | 6723 |
break; |
6749 | 6724 |
case BS_EXCP: |
6750 | 6725 |
gen_op_interrupt_restart(); |
6751 |
gen_op_reset_T0(); |
|
6752 |
gen_op_exit_tb(); |
|
6726 |
tcg_gen_exit_tb(0); |
|
6753 | 6727 |
break; |
6754 | 6728 |
case BS_BRANCH: |
6755 | 6729 |
default: |
... | ... | |
6777 | 6751 |
target_disas(logfile, pc_start, ctx.pc - pc_start, 0); |
6778 | 6752 |
fprintf(logfile, "\n"); |
6779 | 6753 |
} |
6780 |
if (loglevel & CPU_LOG_TB_OP) { |
|
6781 |
fprintf(logfile, "OP:\n"); |
|
6782 |
dump_ops(gen_opc_buf, gen_opparam_buf); |
|
6783 |
fprintf(logfile, "\n"); |
|
6784 |
} |
|
6785 | 6754 |
if (loglevel & CPU_LOG_TB_CPU) { |
6786 | 6755 |
fprintf(logfile, "---------------- %d %08x\n", ctx.bstate, ctx.hflags); |
6787 | 6756 |
} |
Also available in: Unified diff