Browse Source
common/bit_util: Replace CLZ/CTZ operations with standardized ones
common/bit_util: Replace CLZ/CTZ operations with standardized ones
Makes for less code that we need to maintain.nce_cpp
10 changed files with 17 additions and 113 deletions
-
76src/common/bit_util.h
-
4src/core/hle/kernel/k_priority_queue.h
-
8src/core/hle/kernel/k_scheduler.cpp
-
4src/core/hle/kernel/memory/page_heap.h
-
4src/core/hle/kernel/process_capability.cpp
-
1src/tests/CMakeLists.txt
-
23src/tests/common/bit_utils.cpp
-
4src/video_core/cdma_pusher.cpp
-
2src/video_core/cdma_pusher.h
-
4src/video_core/command_classes/codecs/h264.cpp
@ -1,23 +0,0 @@ |
|||
// Copyright 2017 Citra Emulator Project
|
|||
// Licensed under GPLv2 or any later version
|
|||
// Refer to the license.txt file included.
|
|||
|
|||
#include <catch2/catch.hpp>
|
|||
#include <math.h>
|
|||
#include "common/bit_util.h"
|
|||
|
|||
namespace Common { |
|||
|
|||
TEST_CASE("BitUtils::CountTrailingZeroes", "[common]") { |
|||
REQUIRE(Common::CountTrailingZeroes32(0) == 32); |
|||
REQUIRE(Common::CountTrailingZeroes64(0) == 64); |
|||
REQUIRE(Common::CountTrailingZeroes32(9) == 0); |
|||
REQUIRE(Common::CountTrailingZeroes32(8) == 3); |
|||
REQUIRE(Common::CountTrailingZeroes32(0x801000) == 12); |
|||
REQUIRE(Common::CountTrailingZeroes64(9) == 0); |
|||
REQUIRE(Common::CountTrailingZeroes64(8) == 3); |
|||
REQUIRE(Common::CountTrailingZeroes64(0x801000) == 12); |
|||
REQUIRE(Common::CountTrailingZeroes64(0x801000000000UL) == 36); |
|||
} |
|||
|
|||
} // namespace Common
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue