Revision 57fec1fe target-cris/translate.c
b/target-cris/translate.c | ||
---|---|---|
51 | 51 |
#include "cpu.h" |
52 | 52 |
#include "exec-all.h" |
53 | 53 |
#include "disas.h" |
54 |
#include "tcg-op.h" |
|
54 | 55 |
#include "crisv32-decode.h" |
55 | 56 |
|
56 | 57 |
#define CRIS_STATS 0 |
... | ... | |
67 | 68 |
#define DIS(x) |
68 | 69 |
#endif |
69 | 70 |
|
70 |
#ifdef USE_DIRECT_JUMP |
|
71 |
#define TBPARAM(x) |
|
72 |
#else |
|
73 |
#define TBPARAM(x) (long)(x) |
|
74 |
#endif |
|
75 |
|
|
76 | 71 |
#define BUG() (gen_BUG(dc, __FILE__, __LINE__)) |
77 | 72 |
#define BUG_ON(x) ({if (x) BUG();}) |
78 | 73 |
|
... | ... | |
85 | 80 |
#define CC_MASK_NZVC 0xf |
86 | 81 |
#define CC_MASK_RNZV 0x10e |
87 | 82 |
|
88 |
static uint16_t *gen_opc_ptr; |
|
89 |
static uint32_t *gen_opparam_ptr; |
|
90 |
|
|
91 |
enum { |
|
92 |
#define DEF(s, n, copy_size) INDEX_op_ ## s, |
|
93 |
#include "opc.h" |
|
94 |
#undef DEF |
|
95 |
NB_OPS, |
|
96 |
}; |
|
97 |
#include "gen-op.h" |
|
98 |
|
|
99 | 83 |
/* This is the state at translation time. */ |
100 | 84 |
typedef struct DisasContext { |
101 | 85 |
CPUState *env; |
... | ... | |
264 | 248 |
TranslationBlock *tb; |
265 | 249 |
tb = dc->tb; |
266 | 250 |
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { |
267 |
if (n == 0)
|
|
268 |
gen_op_goto_tb0(TBPARAM(tb));
|
|
269 |
else
|
|
270 |
gen_op_goto_tb1(TBPARAM(tb));
|
|
271 |
gen_op_movl_T0_0();
|
|
251 |
#if 0
|
|
252 |
/* XXX: this code is not finished */
|
|
253 |
tcg_gen_goto_tb(n);
|
|
254 |
#endif
|
|
255 |
tcg_gen_exit_tb(0);
|
|
272 | 256 |
} else { |
273 |
gen_op_movl_T0_0();
|
|
257 |
tcg_gen_exit_tb(0);
|
|
274 | 258 |
} |
275 |
gen_op_exit_tb(); |
|
276 | 259 |
} |
277 | 260 |
|
278 | 261 |
/* Sign extend at translation time. */ |
... | ... | |
2325 | 2308 |
dc->env = env; |
2326 | 2309 |
dc->tb = tb; |
2327 | 2310 |
|
2328 |
gen_opc_ptr = gen_opc_buf; |
|
2329 | 2311 |
gen_opc_end = gen_opc_buf + OPC_MAX_SIZE; |
2330 |
gen_opparam_ptr = gen_opparam_buf; |
|
2331 | 2312 |
|
2332 | 2313 |
dc->is_jmp = DISAS_NEXT; |
2333 | 2314 |
dc->pc = pc_start; |
... | ... | |
2374 | 2355 |
if (dc->delayed_branch == 0) |
2375 | 2356 |
{ |
2376 | 2357 |
if (dc->bcc == CC_A) { |
2377 |
gen_op_jmp (); |
|
2358 |
gen_op_jmp1 ();
|
|
2378 | 2359 |
dc->is_jmp = DISAS_UPDATE; |
2379 | 2360 |
} |
2380 | 2361 |
else { |
... | ... | |
2409 | 2390 |
case DISAS_UPDATE: |
2410 | 2391 |
/* indicate that the hash table must be used |
2411 | 2392 |
to find the next TB */ |
2412 |
/* T0 is used to index the jmp tables. */ |
|
2413 |
gen_op_movl_T0_0(); |
|
2414 |
gen_op_exit_tb(); |
|
2393 |
tcg_gen_exit_tb(0); |
|
2415 | 2394 |
break; |
2416 | 2395 |
case DISAS_TB_JUMP: |
2417 | 2396 |
/* nothing more to generate */ |
... | ... | |
2434 | 2413 |
fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start)); |
2435 | 2414 |
target_disas(logfile, pc_start, dc->pc + 4 - pc_start, 0); |
2436 | 2415 |
fprintf(logfile, "\n"); |
2437 |
if (loglevel & CPU_LOG_TB_OP) { |
|
2438 |
fprintf(logfile, "OP:\n"); |
|
2439 |
dump_ops(gen_opc_buf, gen_opparam_buf); |
|
2440 |
fprintf(logfile, "\n"); |
|
2441 |
} |
|
2442 | 2416 |
} |
2443 | 2417 |
#endif |
2444 | 2418 |
return 0; |
Also available in: Unified diff