diff options
| author | 2014-05-17 11:59:18 -0400 | |
|---|---|---|
| committer | 2014-05-17 11:59:18 -0400 | |
| commit | 265c770a9d663b96a9a422201bac3dd454fa95c0 (patch) | |
| tree | e7a1682450b857d80cc2ed0f863f4a82b81142bd /src/core/arm/interpreter | |
| parent | Merge pull request #17 from bunnei/arm-vfp (diff) | |
| download | yuzu-265c770a9d663b96a9a422201bac3dd454fa95c0.tar.gz yuzu-265c770a9d663b96a9a422201bac3dd454fa95c0.tar.xz yuzu-265c770a9d663b96a9a422201bac3dd454fa95c0.zip | |
updated how we call ARM core to make things much faster
Diffstat (limited to 'src/core/arm/interpreter')
| -rw-r--r-- | src/core/arm/interpreter/arm_interpreter.cpp | 19 | ||||
| -rw-r--r-- | src/core/arm/interpreter/arm_interpreter.h | 7 | ||||
| -rw-r--r-- | src/core/arm/interpreter/armdefs.h | 1 | ||||
| -rw-r--r-- | src/core/arm/interpreter/armemu.cpp | 2 |
4 files changed, 14 insertions, 15 deletions
diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp index 4652803de..23d96d292 100644 --- a/src/core/arm/interpreter/arm_interpreter.cpp +++ b/src/core/arm/interpreter/arm_interpreter.cpp | |||
| @@ -85,16 +85,11 @@ u64 ARM_Interpreter::GetTicks() const { | |||
| 85 | return ARMul_Time(m_state); | 85 | return ARMul_Time(m_state); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | /// Execture next instruction | 88 | /** |
| 89 | void ARM_Interpreter::ExecuteInstruction() { | 89 | * Executes the given number of instructions |
| 90 | m_state->step++; | 90 | * @param num_instructions Number of instructions to executes |
| 91 | m_state->cycle++; | 91 | */ |
| 92 | m_state->EndCondition = 0; | 92 | void ARM_Interpreter::ExecuteInstructions(int num_instructions) { |
| 93 | m_state->stop_simulator = 0; | 93 | m_state->NumInstrsToExecute = num_instructions; |
| 94 | m_state->NextInstr = RESUME; | 94 | ARMul_Emulate32(m_state); |
| 95 | m_state->last_pc = m_state->Reg[15]; | ||
| 96 | m_state->Reg[15] = ARMul_DoInstr(m_state); | ||
| 97 | m_state->Cpsr = ((m_state->Cpsr & 0x0fffffdf) | (m_state->NFlag << 31) | (m_state->ZFlag << 30) | | ||
| 98 | (m_state->CFlag << 29) | (m_state->VFlag << 28) | (m_state->TFlag << 5)); | ||
| 99 | m_state->NextInstr |= PRIMEPIPE; // Flush pipe | ||
| 100 | } | 95 | } |
diff --git a/src/core/arm/interpreter/arm_interpreter.h b/src/core/arm/interpreter/arm_interpreter.h index 625c0c652..509025080 100644 --- a/src/core/arm/interpreter/arm_interpreter.h +++ b/src/core/arm/interpreter/arm_interpreter.h | |||
| @@ -56,8 +56,11 @@ public: | |||
| 56 | 56 | ||
| 57 | protected: | 57 | protected: |
| 58 | 58 | ||
| 59 | /// Execture next instruction | 59 | /** |
| 60 | void ExecuteInstruction(); | 60 | * Executes the given number of instructions |
| 61 | * @param num_instructions Number of instructions to executes | ||
| 62 | */ | ||
| 63 | void ExecuteInstructions(int num_instructions); | ||
| 61 | 64 | ||
| 62 | private: | 65 | private: |
| 63 | 66 | ||
diff --git a/src/core/arm/interpreter/armdefs.h b/src/core/arm/interpreter/armdefs.h index 821825ae6..5b2abc7f7 100644 --- a/src/core/arm/interpreter/armdefs.h +++ b/src/core/arm/interpreter/armdefs.h | |||
| @@ -288,6 +288,7 @@ struct ARMul_State | |||
| 288 | ARMword loaded_addr, decoded_addr; /* saved pipeline state addr*/ | 288 | ARMword loaded_addr, decoded_addr; /* saved pipeline state addr*/ |
| 289 | unsigned int NumScycles, NumNcycles, NumIcycles, NumCcycles, NumFcycles; /* emulated cycles used */ | 289 | unsigned int NumScycles, NumNcycles, NumIcycles, NumCcycles, NumFcycles; /* emulated cycles used */ |
| 290 | unsigned long long NumInstrs; /* the number of instructions executed */ | 290 | unsigned long long NumInstrs; /* the number of instructions executed */ |
| 291 | unsigned NumInstrsToExecute; | ||
| 291 | unsigned NextInstr; | 292 | unsigned NextInstr; |
| 292 | unsigned VectorCatch; /* caught exception mask */ | 293 | unsigned VectorCatch; /* caught exception mask */ |
| 293 | unsigned CallDebug; /* set to call the debugger */ | 294 | unsigned CallDebug; /* set to call the debugger */ |
diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp index 87141653f..32e315f4b 100644 --- a/src/core/arm/interpreter/armemu.cpp +++ b/src/core/arm/interpreter/armemu.cpp | |||
| @@ -4734,7 +4734,7 @@ TEST_EMULATE: | |||
| 4734 | else if (state->Emulate != RUN) | 4734 | else if (state->Emulate != RUN) |
| 4735 | break; | 4735 | break; |
| 4736 | } | 4736 | } |
| 4737 | while (!state->stop_simulator); | 4737 | while (state->NumInstrsToExecute--); |
| 4738 | 4738 | ||
| 4739 | state->decoded = decoded; | 4739 | state->decoded = decoded; |
| 4740 | state->loaded = loaded; | 4740 | state->loaded = loaded; |