Revision 57fec1fe target-arm/translate.c
b/target-arm/translate.c | ||
---|---|---|
28 | 28 |
#include "cpu.h" |
29 | 29 |
#include "exec-all.h" |
30 | 30 |
#include "disas.h" |
31 |
#include "tcg-op.h" |
|
31 | 32 |
|
32 | 33 |
#define ENABLE_ARCH_5J 0 |
33 | 34 |
#define ENABLE_ARCH_6 arm_feature(env, ARM_FEATURE_V6) |
... | ... | |
68 | 69 |
#define DISAS_WFI 4 |
69 | 70 |
#define DISAS_SWI 5 |
70 | 71 |
|
71 |
#ifdef USE_DIRECT_JUMP |
|
72 |
#define TBPARAM(x) |
|
73 |
#else |
|
74 |
#define TBPARAM(x) (long)(x) |
|
75 |
#endif |
|
76 |
|
|
77 | 72 |
/* XXX: move that elsewhere */ |
78 |
static uint16_t *gen_opc_ptr; |
|
79 |
static uint32_t *gen_opparam_ptr; |
|
80 | 73 |
extern FILE *logfile; |
81 | 74 |
extern int loglevel; |
82 | 75 |
|
83 |
enum { |
|
84 |
#define DEF(s, n, copy_size) INDEX_op_ ## s, |
|
85 |
#include "opc.h" |
|
86 |
#undef DEF |
|
87 |
NB_OPS, |
|
88 |
}; |
|
89 |
|
|
90 |
#include "gen-op.h" |
|
91 |
|
|
92 | 76 |
#define PAS_OP(pfx) { \ |
93 | 77 |
gen_op_ ## pfx ## add16_T0_T1, \ |
94 | 78 |
gen_op_ ## pfx ## addsubx_T0_T1, \ |
... | ... | |
2432 | 2416 |
|
2433 | 2417 |
tb = s->tb; |
2434 | 2418 |
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { |
2435 |
if (n == 0) |
|
2436 |
gen_op_goto_tb0(TBPARAM(tb)); |
|
2437 |
else |
|
2438 |
gen_op_goto_tb1(TBPARAM(tb)); |
|
2419 |
tcg_gen_goto_tb(n); |
|
2439 | 2420 |
gen_op_movl_T0_im(dest); |
2440 | 2421 |
gen_op_movl_r15_T0(); |
2441 |
gen_op_movl_T0_im((long)tb + n); |
|
2442 |
gen_op_exit_tb(); |
|
2422 |
tcg_gen_exit_tb((long)tb + n); |
|
2443 | 2423 |
} else { |
2444 | 2424 |
gen_op_movl_T0_im(dest); |
2445 | 2425 |
gen_op_movl_r15_T0(); |
2446 |
gen_op_movl_T0_0(); |
|
2447 |
gen_op_exit_tb(); |
|
2426 |
tcg_gen_exit_tb(0); |
|
2448 | 2427 |
} |
2449 | 2428 |
} |
2450 | 2429 |
|
... | ... | |
7486 | 7465 |
|
7487 | 7466 |
dc->tb = tb; |
7488 | 7467 |
|
7489 |
gen_opc_ptr = gen_opc_buf; |
|
7490 | 7468 |
gen_opc_end = gen_opc_buf + OPC_MAX_SIZE; |
7491 |
gen_opparam_ptr = gen_opparam_buf; |
|
7492 | 7469 |
|
7493 | 7470 |
dc->is_jmp = DISAS_NEXT; |
7494 | 7471 |
dc->pc = pc_start; |
... | ... | |
7506 | 7483 |
} |
7507 | 7484 |
#endif |
7508 | 7485 |
next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE; |
7509 |
nb_gen_labels = 0; |
|
7510 | 7486 |
lj = -1; |
7511 | 7487 |
/* Reset the conditional execution bits immediately. This avoids |
7512 | 7488 |
complications trying to do it at the end of the block. */ |
... | ... | |
7625 | 7601 |
case DISAS_JUMP: |
7626 | 7602 |
case DISAS_UPDATE: |
7627 | 7603 |
/* indicate that the hash table must be used to find the next TB */ |
7628 |
gen_op_movl_T0_0(); |
|
7629 |
gen_op_exit_tb(); |
|
7604 |
tcg_gen_exit_tb(0); |
|
7630 | 7605 |
break; |
7631 | 7606 |
case DISAS_TB_JUMP: |
7632 | 7607 |
/* nothing more to generate */ |
... | ... | |
7654 | 7629 |
fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start)); |
7655 | 7630 |
target_disas(logfile, pc_start, dc->pc - pc_start, env->thumb); |
7656 | 7631 |
fprintf(logfile, "\n"); |
7657 |
if (loglevel & (CPU_LOG_TB_OP)) { |
|
7658 |
fprintf(logfile, "OP:\n"); |
|
7659 |
dump_ops(gen_opc_buf, gen_opparam_buf); |
|
7660 |
fprintf(logfile, "\n"); |
|
7661 |
} |
|
7662 | 7632 |
} |
7663 | 7633 |
#endif |
7664 | 7634 |
if (search_pc) { |
Also available in: Unified diff