summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorGravatar Rodrigo Locatti2021-01-15 04:48:58 -0300
committerGravatar GitHub2021-01-15 04:48:58 -0300
commit5b9aedfc215e2f7227a8604d2d28fb462949d537 (patch)
treeed1f105b1fef3fc9a5209c5106accaaee283ebf2 /src/video_core
parentMerge pull request #5354 from ReinUsesLisp/remove-common-color (diff)
parentcommon/bit_util: Replace CLZ/CTZ operations with standardized ones (diff)
downloadyuzu-5b9aedfc215e2f7227a8604d2d28fb462949d537.tar.gz
yuzu-5b9aedfc215e2f7227a8604d2d28fb462949d537.tar.xz
yuzu-5b9aedfc215e2f7227a8604d2d28fb462949d537.zip
Merge pull request #5356 from lioncash/clz
common/bit_util: Replace CLZ/CTZ operations with standardized ones
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/cdma_pusher.cpp4
-rw-r--r--src/video_core/cdma_pusher.h2
-rw-r--r--src/video_core/command_classes/codecs/h264.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/video_core/cdma_pusher.cpp b/src/video_core/cdma_pusher.cpp
index 94679d5d1..33b3c060b 100644
--- a/src/video_core/cdma_pusher.cpp
+++ b/src/video_core/cdma_pusher.cpp
@@ -18,10 +18,10 @@
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19// 19//
20 20
21#include <bit>
21#include "command_classes/host1x.h" 22#include "command_classes/host1x.h"
22#include "command_classes/nvdec.h" 23#include "command_classes/nvdec.h"
23#include "command_classes/vic.h" 24#include "command_classes/vic.h"
24#include "common/bit_util.h"
25#include "video_core/cdma_pusher.h" 25#include "video_core/cdma_pusher.h"
26#include "video_core/command_classes/nvdec_common.h" 26#include "video_core/command_classes/nvdec_common.h"
27#include "video_core/engines/maxwell_3d.h" 27#include "video_core/engines/maxwell_3d.h"
@@ -56,7 +56,7 @@ void CDmaPusher::Step() {
56 56
57 for (const u32 value : values) { 57 for (const u32 value : values) {
58 if (mask != 0) { 58 if (mask != 0) {
59 const u32 lbs = Common::CountTrailingZeroes32(mask); 59 const auto lbs = static_cast<u32>(std::countr_zero(mask));
60 mask &= ~(1U << lbs); 60 mask &= ~(1U << lbs);
61 ExecuteCommand(static_cast<u32>(offset + lbs), value); 61 ExecuteCommand(static_cast<u32>(offset + lbs), value);
62 continue; 62 continue;
diff --git a/src/video_core/cdma_pusher.h b/src/video_core/cdma_pusher.h
index 8ca70b6dd..e5f212c1a 100644
--- a/src/video_core/cdma_pusher.h
+++ b/src/video_core/cdma_pusher.h
@@ -126,7 +126,7 @@ private:
126 126
127 s32 count{}; 127 s32 count{};
128 s32 offset{}; 128 s32 offset{};
129 s32 mask{}; 129 u32 mask{};
130 bool incrementing{}; 130 bool incrementing{};
131 131
132 // Queue of command lists to be processed 132 // Queue of command lists to be processed
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp
index 65bbeac78..fea6aed98 100644
--- a/src/video_core/command_classes/codecs/h264.cpp
+++ b/src/video_core/command_classes/codecs/h264.cpp
@@ -19,7 +19,7 @@
19// 19//
20 20
21#include <array> 21#include <array>
22#include "common/bit_util.h" 22#include <bit>
23#include "video_core/command_classes/codecs/h264.h" 23#include "video_core/command_classes/codecs/h264.h"
24#include "video_core/gpu.h" 24#include "video_core/gpu.h"
25#include "video_core/memory_manager.h" 25#include "video_core/memory_manager.h"
@@ -266,7 +266,7 @@ void H264BitWriter::WriteExpGolombCodedInt(s32 value) {
266} 266}
267 267
268void H264BitWriter::WriteExpGolombCodedUInt(u32 value) { 268void H264BitWriter::WriteExpGolombCodedUInt(u32 value) {
269 const s32 size = 32 - Common::CountLeadingZeroes32(static_cast<s32>(value + 1)); 269 const s32 size = 32 - std::countl_zero(value + 1);
270 WriteBits(1, size); 270 WriteBits(1, size);
271 271
272 value -= (1U << (size - 1)) - 1; 272 value -= (1U << (size - 1)) - 1;