[4736] TCGify a few more instructions.
Revision: 4736
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4736 Author: ths Date: 2008-06-12 03:15:13 +0000 (Thu, 12 Jun 2008)
Log Message:
-----------
TCGify a few more instructions.
Modified Paths:
--------------
trunk/target-mips/exec.h
trunk/target-mips/helper.h
trunk/target-mips/op.c
trunk/target-mips/op_helper.c
trunk/target-mips/translate.c
Modified: trunk/target-mips/exec.h
===================================================================
target-mips/exec.h +0 -1
@@ -78,7 +78,6 @@int (*fpu_fprintf)(FILE *f,const char *fmt, ...), int flags);void dump_sc (void ); -void do_pmon (int function);int cpu_mips_handle_mmu_fault (CPUState *env,target_ulong address,int rw,int mmu_idx,int is_softmmu);
Modified: trunk/target-mips/helper.h
===================================================================
target-mips/helper.h +4 -0
@@ -202,3 +202,7 @@ FOP_PROTO(le) FOP_PROTO(ngt) #undef FOP_PROTO + +/* Special functions */ +DEF_HELPER(void, do_pmon, (int function)) +DEF_HELPER(void, do_wait, (void))
Modified: trunk/target-mips/op.c
===================================================================
target-mips/op.c +0 -76
101 lines not on this page · raw message
Modified: trunk/target-mips/op_helper.c
===================================================================
target-mips/op_helper.c +6 -0
@@ -1401,6 +1401,12 @@ } } +void do_wait (void ) +{ + env->halted =1 ; +do_raise_exception (EXCP_HLT ); +} +#if !defined(CONFIG_USER_ONLY )static void do_unaligned_access (target_ulong addr,int is_write,int is_user,void *retaddr);
Modified: trunk/target-mips/translate.c
===================================================================
target-mips/translate.c +28 -12
@@ -789,7 +789,11 @@ ctx->saved_pc = ctx->pc; }if (ctx->hflags != ctx->saved_hflags) { -gen_op_save_state (ctx->hflags); +TCGv r_tmp =tcg_temp_new (TCG_TYPE_I32 ); + +tcg_gen_movi_i32 (r_tmp, ctx->hflags); +tcg_gen_st_i32 (r_tmp, cpu_env, offsetof(CPUState , hflags)); +tcg_temp_free (r_tmp); ctx->saved_hflags = ctx->hflags;switch (ctx->hflags &MIPS_HFLAG_BMASK ) {case MIPS_HFLAG_BR :
@@ -2238,7 +2242,13 @@ } }save_cpu_state (ctx,1 ); -gen_op_trap (); + { +int l1 =gen_new_label (); + +tcg_gen_brcondi_tl (TCG_COND_EQ , cpu_T[0 ],0 , l1); +tcg_gen_helper_0_1i (do_raise_exception,EXCP_TRAP ); +gen_set_label (l1); + } ctx->bstate =BS_STOP ; }
@@ -5316,25 +5326,25 @@ opn ="tlbwi" ;if (!env->tlb->do_tlbwi) goto die; -gen_op_tlbwi (); +tcg_gen_helper_0_0 (env->tlb->do_tlbwi);break ;case OPC_TLBWR : opn ="tlbwr" ;if (!env->tlb->do_tlbwr) goto die; -gen_op_tlbwr (); +tcg_gen_helper_0_0 (env->tlb->do_tlbwr);break ;case OPC_TLBP : opn ="tlbp" ;if (!env->tlb->do_tlbp) goto die; -gen_op_tlbp (); +tcg_gen_helper_0_0 (env->tlb->do_tlbp);break ;case OPC_TLBR : opn ="tlbr" ;if (!env->tlb->do_tlbr) goto die; -gen_op_tlbr (); +tcg_gen_helper_0_0 (env->tlb->do_tlbr);break ;case OPC_ERET : opn ="eret" ;
@@ -5362,7 +5372,7 @@ ctx->pc +=4 ;save_cpu_state (ctx,1 ); ctx->pc -=4 ; -gen_op_wait (); +tcg_gen_helper_0_0 (do_wait); ctx->bstate =BS_EXCP ;break ;default :
@@ -6617,7 +6627,13 @@tcg_gen_ld_tl (r_tmp, cpu_env, offsetof(CPUState , bcond));tcg_gen_brcondi_tl (TCG_COND_NE , r_tmp,0 , l1);tcg_temp_free (r_tmp); -gen_op_save_state (ctx->hflags & ~MIPS_HFLAG_BMASK ); + { +TCGv r_tmp2 =tcg_temp_new (TCG_TYPE_I32 ); + +tcg_gen_movi_i32 (r_tmp2, ctx->hflags & ~MIPS_HFLAG_BMASK ); +tcg_gen_st_i32 (r_tmp2, cpu_env, offsetof(CPUState , hflags)); +tcg_temp_free (r_tmp2); + }gen_goto_tb (ctx,1 , ctx->pc +4 );gen_set_label (l1); }
@@ -6671,7 +6687,7 @@MIPS_INVAL ("PMON / selsl" );generate_exception (ctx,EXCP_RI );#else -gen_op_pmon (sa); +tcg_gen_helper_0_1i (do_pmon, sa);#endif break ;case OPC_SYSCALL :
@@ -6827,7 +6843,7 @@break ;case 29 :#if defined (CONFIG_USER_ONLY ) -gen_op_tls_value (); +tcg_gen_ld_tl (cpu_T[0 ], cpu_env, offsetof(CPUState , tls_value));break ;#endif default :/* Invalid */
@@ -7243,7 +7259,7 @@if (env->breakpoints[j] == ctx.pc) {save_cpu_state (&ctx,1 ); ctx.bstate =BS_BRANCH ; -gen_op_debug (); +tcg_gen_helper_0_1i (do_raise_exception,EXCP_DEBUG );/* Include the breakpoint location or the tb won't * be flushed when it must be. */ ctx.pc +=4 ;
@@ -7285,7 +7301,7 @@ }if (env->singlestep_enabled) {save_cpu_state (&ctx, ctx.bstate ==BS_NONE ); -gen_op_debug (); +tcg_gen_helper_0_1i (do_raise_exception,EXCP_DEBUG ); }else {switch (ctx.bstate) {case BS_STOP :