ARM: Run tighter loop in CPU
Jeffrey Pfau jeffrey@endrift.com
Sun, 16 Nov 2014 20:51:36 -0800
2 files changed,
6 insertions(+),
3 deletions(-)
M
src/arm/arm.c
→
src/arm/arm.c
@@ -290,10 +290,12 @@ }
} void ARMRunLoop(struct ARMCore* cpu) { - while (cpu->cycles < cpu->nextEvent) { - if (cpu->executionMode == MODE_THUMB) { + if (cpu->executionMode == MODE_THUMB) { + while (cpu->cycles < cpu->nextEvent) { ThumbStep(cpu); - } else { + } + } else { + while (cpu->cycles < cpu->nextEvent) { ARMStep(cpu); } }
M
src/arm/isa-inlines.h
→
src/arm/isa-inlines.h
@@ -74,6 +74,7 @@ break;
case MODE_THUMB: cpu->cpsr.t = 1; } + cpu->nextEvent = 0; } static inline void _ARMReadCPSR(struct ARMCore* cpu) {