From 2171ffdab2f2af789311b2264fa9e8183dca8e2a Mon Sep 17 00:00:00 2001 From: plappermaul Date: Mon, 14 Oct 2019 20:26:31 +0200 Subject: [PATCH] minor optimization for FIFO_control::read_put() (#6768) --- rpcs3/Emu/RSX/RSXFIFO.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/RSXFIFO.cpp b/rpcs3/Emu/RSX/RSXFIFO.cpp index 8ec6f4c2f8..0eca963bcb 100644 --- a/rpcs3/Emu/RSX/RSXFIFO.cpp +++ b/rpcs3/Emu/RSX/RSXFIFO.cpp @@ -31,7 +31,7 @@ namespace rsx } template - u32 FIFO_control::read_put() + inline u32 FIFO_control::read_put() { if constexpr (!full) { @@ -39,7 +39,15 @@ namespace rsx } else { - return m_ctrl->put.and_fetch(~3); + u32 put = m_ctrl->put; + if (LIKELY((put & 3) == 0)) + { + return put; + } + else + { + return m_ctrl->put.and_fetch(~3); + } } } @@ -578,4 +586,4 @@ namespace rsx fifo_ctrl->sync_get(); } -} \ No newline at end of file +}