#include "cpu.h"
#include "exec-all.h"
#include "disas.h"
+#include "tcg-op.h"
#include "m68k-qreg.h"
//#define DEBUG_DISPATCH 1
static void *gen_throws_exception;
#define gen_last_qop NULL
-static uint16_t *gen_opc_ptr;
-static uint32_t *gen_opparam_ptr;
extern FILE *logfile;
extern int loglevel;
-enum {
-#define DEF(s, n, copy_size) INDEX_op_ ## s,
-#include "opc.h"
-#undef DEF
- NB_OPS,
-};
-
-#include "gen-op.h"
-
#if defined(CONFIG_USER_ONLY)
#define gen_st(s, name, addr, val) gen_op_st##name##_raw(addr, val)
#define gen_ld(s, name, val, addr) gen_op_ld##name##_raw(val, addr)
gen_flush_flags(s);
switch (cond) {
case 0: /* T */
- gen_op_jmp(l1);
+ gen_op_jmp_im(l1);
break;
case 1: /* F */
break;
gen_op_xor32(tmp, tmp, QREG_CC_DEST);
gen_op_and32(tmp, tmp, gen_im32(CCF_V));
gen_op_jmp_nz32(tmp, l2);
- gen_op_jmp(l1);
+ gen_op_jmp_im(l1);
gen_set_label(l2);
}
break;
gen_exception(s, dest, EXCP_DEBUG);
} else if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) ||
(s->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
- gen_op_goto_tb(0, n, (long)tb);
+ tcg_gen_goto_tb(n);
gen_op_mov32(QREG_PC, gen_im32(dest));
- gen_op_mov32(QREG_T0, gen_im32((long)tb + n));
- gen_op_exit_tb();
+ tcg_gen_exit_tb((long)tb + n);
} else {
gen_jmp(s, gen_im32(dest));
- gen_op_mov32(QREG_T0, gen_im32(0));
- gen_op_exit_tb();
+ tcg_gen_exit_tb(0);
}
s->is_jmp = DISAS_TB_JUMP;
}
gen_op_add32(arg0, arg0, gen_im32(1));
gen_op_mov32(QREG_CC_OP, gen_im32(CC_OP_ADDX));
gen_op_set_leu32(QREG_CC_X, arg0, arg1);
- gen_op_jmp(l2);
+ gen_op_jmp_im(l2);
gen_set_label(l1);
gen_op_mov32(QREG_CC_OP, gen_im32(CC_OP_ADD));
gen_op_set_ltu32(QREG_CC_X, arg0, arg1);
gen_op_set_leu32(QREG_CC_X, arg0, arg1);
gen_op_sub32(arg0, arg0, gen_im32(1));
gen_op_mov32(QREG_CC_OP, gen_im32(CC_OP_SUBX));
- gen_op_jmp(l2);
+ gen_op_jmp_im(l2);
gen_set_label(l1);
gen_op_set_ltu32(QREG_CC_X, arg0, arg1);
gen_op_mov32(QREG_CC_OP, gen_im32(CC_OP_SUB));
dc->tb = tb;
- gen_opc_ptr = gen_opc_buf;
gen_opc_end = gen_opc_buf + OPC_MAX_SIZE;
- gen_opparam_ptr = gen_opparam_buf;
dc->env = env;
dc->is_jmp = DISAS_NEXT;
dc->fpcr = env->fpcr;
dc->user = (env->sr & SR_S) == 0;
dc->is_mem = 0;
- nb_gen_labels = 0;
lj = -1;
do {
free_qreg = 0;
case DISAS_UPDATE:
gen_flush_cc_op(dc);
/* indicate that the hash table must be used to find the next TB */
- gen_op_mov32(QREG_T0, gen_im32(0));
- gen_op_exit_tb();
+ tcg_gen_exit_tb(0);
break;
case DISAS_TB_JUMP:
/* nothing more to generate */
fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start));
target_disas(logfile, pc_start, dc->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");
- }
}
#endif
if (search_pc) {
u.d = env->fregs[i];
cpu_fprintf (f, "D%d = %08x A%d = %08x F%d = %08x%08x (%12g)\n",
i, env->dregs[i], i, env->aregs[i],
- i, u.l.upper, u.l.lower, u.d);
+ i, u.l.upper, u.l.lower, *(double *)&u.d);
}
cpu_fprintf (f, "PC = %08x ", env->pc);
sr = env->sr;
cpu_fprintf (f, "SR = %04x %c%c%c%c%c ", sr, (sr & 0x10) ? 'X' : '-',
(sr & CCF_N) ? 'N' : '-', (sr & CCF_Z) ? 'Z' : '-',
(sr & CCF_V) ? 'V' : '-', (sr & CCF_C) ? 'C' : '-');
- cpu_fprintf (f, "FPRESULT = %12g\n", env->fp_result);
+ cpu_fprintf (f, "FPRESULT = %12g\n", *(double *)&env->fp_result);
}