From a564f1011437ea8a8dfe99b9c01399755abf60d2 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Tue, 25 Mar 2025 17:23:57 +0100 Subject: [PATCH] Add `unlikely` keyword to the split packet handling branches Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com> --- src/video_core/amdgpu/liverpool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index fc75374d4..bfe99c754 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -736,7 +736,7 @@ Liverpool::Task Liverpool::ProcessCompute(const u32* acb, u32 acb_dwords, u32 vq u32 next_dw_off = header->type3.NumWords() + 1; // If we have a buffered packet, use it. - if (queue.tmp_dwords > 0) { + if (queue.tmp_dwords > 0) [[unlikely]] { header = reinterpret_cast(queue.tmp_packet.data()); next_dw_off = header->type3.NumWords() + 1 - queue.tmp_dwords; std::memcpy(queue.tmp_packet.data() + queue.tmp_dwords, acb, next_dw_off * sizeof(u32)); @@ -744,7 +744,7 @@ Liverpool::Task Liverpool::ProcessCompute(const u32* acb, u32 acb_dwords, u32 vq } // If the packet is split across ring boundary, buffer until next submission - if (next_dw_off > acb_dwords) { + if (next_dw_off > acb_dwords) [[unlikely]] { std::memcpy(queue.tmp_packet.data(), acb, acb_dwords * sizeof(u32)); queue.tmp_dwords = acb_dwords; if constexpr (!is_indirect) {