0.9.4+: port r2844 from trunk

This commit is contained in:
gocha 2009-09-08 04:29:22 +00:00
parent e2643b4e69
commit 973bbe530e
1 changed files with 17 additions and 17 deletions

View File

@ -499,7 +499,8 @@ bool fixCycleCount = false;
template<int PROCNUM>
u32 armcpu_exec()
{
u32 c = fixCycleCount ? 0 : 1;
u32 cFetch = fixCycleCount ? 0 : 1;
u32 cExecute = 0;
//this assert is annoying. but sometimes it is handy.
//assert(ARMPROC.instruct_adr!=0x00000000);
@ -513,10 +514,10 @@ u32 armcpu_exec()
armcpu_irqException( &ARMPROC);
}
c += armcpu_prefetch(&ARMPROC);
cFetch += armcpu_prefetch(&ARMPROC);
if ( ARMPROC.stalled) {
return c;
return cFetch; //std::max(cFetch, cExecute);
}
#endif
@ -530,29 +531,28 @@ u32 armcpu_exec()
des_arm_instructions_set[INSTRUCTION_INDEX(ARMPROC.instruction)](ARMPROC.instruct_adr,ARMPROC.instruction,txt);
printf("%X: %X - %s\n", ARMPROC.instruct_adr,ARMPROC.instruction, txt);
#endif
c += arm_instructions_set_0[INSTRUCTION_INDEX(ARMPROC.instruction)]();
cExecute += arm_instructions_set_0[INSTRUCTION_INDEX(ARMPROC.instruction)]();
}
else
c += arm_instructions_set_1[INSTRUCTION_INDEX(ARMPROC.instruction)]();
cExecute += arm_instructions_set_1[INSTRUCTION_INDEX(ARMPROC.instruction)]();
}
else if (fixCycleCount)
c++;
cExecute++; // If condition=false: 1S cycle
#ifdef GDB_STUB
if ( ARMPROC.post_ex_fn != NULL) {
/* call the external post execute function */
ARMPROC.post_ex_fn( ARMPROC.post_ex_fn_data,
ARMPROC.instruct_adr, 0);
}
if ( ARMPROC.post_ex_fn != NULL) {
/* call the external post execute function */
ARMPROC.post_ex_fn(ARMPROC.post_ex_fn_data, ARMPROC.instruct_adr, 0);
}
#else
c += armcpu_prefetch<PROCNUM>();
cFetch += armcpu_prefetch<PROCNUM>();
#endif
return c;
return fixCycleCount ? std::max(cFetch, cExecute) : (cFetch + cExecute);
}
if(PROCNUM==0)
c += thumb_instructions_set_0[ARMPROC.instruction>>6]();
cExecute += thumb_instructions_set_0[ARMPROC.instruction>>6]();
else
c += thumb_instructions_set_1[ARMPROC.instruction>>6]();
cExecute += thumb_instructions_set_1[ARMPROC.instruction>>6]();
#ifdef GDB_STUB
if ( ARMPROC.post_ex_fn != NULL) {
@ -560,9 +560,9 @@ u32 armcpu_exec()
ARMPROC.post_ex_fn( ARMPROC.post_ex_fn_data, ARMPROC.instruct_adr, 1);
}
#else
c += armcpu_prefetch<PROCNUM>();
cFetch += armcpu_prefetch<PROCNUM>();
#endif
return c;
return fixCycleCount ? std::max(cFetch, cExecute) : (cFetch + cExecute);
}
//these templates needed to be instantiated manually