Skip to content

Commit

Permalink
Fifo: only touch the SIMD state once in the single core loop
Browse files Browse the repository at this point in the history
  • Loading branch information
degasus committed Mar 15, 2015
1 parent 4e89ae3 commit f3dd175
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Source/Core/VideoCommon/Fifo.cpp
Expand Up @@ -419,6 +419,7 @@ void RunGpu()
// execute GPU
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread || g_use_deterministic_gpu_thread)
{
bool reset_simd_state = false;
while (fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint() )
{
if (g_use_deterministic_gpu_thread)
Expand All @@ -427,11 +428,14 @@ void RunGpu()
}
else
{
FPURoundMode::SaveSIMDState();
FPURoundMode::LoadDefaultSIMDState();
if (!reset_simd_state)
{
FPURoundMode::SaveSIMDState();
FPURoundMode::LoadDefaultSIMDState();
reset_simd_state = true;
}
ReadDataFromFifo(fifo.CPReadPointer);
s_video_buffer_read_ptr = OpcodeDecoder_Run(DataReader(s_video_buffer_read_ptr, s_video_buffer_write_ptr), nullptr, false);
FPURoundMode::LoadSIMDState();
}

//DEBUG_LOG(COMMANDPROCESSOR, "Fifo wraps to base");
Expand All @@ -444,6 +448,11 @@ void RunGpu()
fifo.CPReadWriteDistance -= 32;
}
CommandProcessor::SetCPStatusFromGPU();

if (reset_simd_state)
{
FPURoundMode::LoadSIMDState();
}
}

// wake up GPU thread
Expand Down

0 comments on commit f3dd175

Please sign in to comment.