CRIS: Translator updates.

* RFN (Return From NMI) insn.
* Avoid unnecessary T0 transfers.
* Dont do tcg related init more than once.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4717 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
edgar_igl 2008-06-09 23:06:31 +00:00
parent e72210e194
commit a7cfbba0cf

View File

@ -1530,7 +1530,6 @@ static unsigned int dec_btstq(DisasContext *dc)
cris_cc_mask(dc, CC_MASK_NZ); cris_cc_mask(dc, CC_MASK_NZ);
t_gen_mov_TN_reg(cpu_T[0], dc->op2);
cris_alu(dc, CC_OP_BTST, cris_alu(dc, CC_OP_BTST,
cpu_T[0], cpu_R[dc->op2], tcg_const_tl(dc->op1), 4); cpu_T[0], cpu_R[dc->op2], tcg_const_tl(dc->op1), 4);
cris_update_cc_op(dc, CC_OP_FLAGS, 4); cris_update_cc_op(dc, CC_OP_FLAGS, 4);
@ -1968,11 +1967,10 @@ static unsigned int dec_movs_r(DisasContext *dc)
dc->op1, dc->op2)); dc->op1, dc->op2));
cris_cc_mask(dc, CC_MASK_NZ); cris_cc_mask(dc, CC_MASK_NZ);
t_gen_mov_TN_reg(cpu_T[0], dc->op1);
/* Size can only be qi or hi. */ /* Size can only be qi or hi. */
t_gen_sext(cpu_T[1], cpu_R[dc->op1], size); t_gen_sext(cpu_T[1], cpu_R[dc->op1], size);
cris_alu(dc, CC_OP_MOVE, cris_alu(dc, CC_OP_MOVE,
cpu_R[dc->op2], cpu_T[0], cpu_T[1], 4); cpu_R[dc->op2], cpu_R[dc->op1], cpu_T[1], 4);
return 2; return 2;
} }
@ -2788,7 +2786,9 @@ static unsigned int dec_rfe_etc(DisasContext *dc)
break; break;
case 5: case 5:
/* rfn. */ /* rfn. */
BUG(); cris_evaluate_flags(dc);
tcg_gen_helper_0_0(helper_rfn);
dc->is_jmp = DISAS_UPDATE;
break; break;
case 6: case 6:
/* break. */ /* break. */
@ -3271,12 +3271,20 @@ void cpu_dump_state (CPUState *env, FILE *f,
CPUCRISState *cpu_cris_init (const char *cpu_model) CPUCRISState *cpu_cris_init (const char *cpu_model)
{ {
CPUCRISState *env; CPUCRISState *env;
static int tcg_initialized = 0;
int i; int i;
env = qemu_mallocz(sizeof(CPUCRISState)); env = qemu_mallocz(sizeof(CPUCRISState));
if (!env) if (!env)
return NULL; return NULL;
cpu_exec_init(env); cpu_exec_init(env);
cpu_reset(env);
if (tcg_initialized)
return env;
tcg_initialized = 1;
cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env"); cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env");
#if TARGET_LONG_BITS > HOST_LONG_BITS #if TARGET_LONG_BITS > HOST_LONG_BITS
@ -3337,6 +3345,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)
TCG_HELPER(helper_movl_sreg_reg); TCG_HELPER(helper_movl_sreg_reg);
TCG_HELPER(helper_movl_reg_sreg); TCG_HELPER(helper_movl_reg_sreg);
TCG_HELPER(helper_rfe); TCG_HELPER(helper_rfe);
TCG_HELPER(helper_rfn);
TCG_HELPER(helper_evaluate_flags_muls); TCG_HELPER(helper_evaluate_flags_muls);
TCG_HELPER(helper_evaluate_flags_mulu); TCG_HELPER(helper_evaluate_flags_mulu);
@ -3346,8 +3355,6 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)
TCG_HELPER(helper_evaluate_flags_move_2); TCG_HELPER(helper_evaluate_flags_move_2);
TCG_HELPER(helper_evaluate_flags); TCG_HELPER(helper_evaluate_flags);
TCG_HELPER(helper_top_evaluate_flags); TCG_HELPER(helper_top_evaluate_flags);
cpu_reset(env);
return env; return env;
} }