diff --git a/Utilities/types.h b/Utilities/types.h index 695f271eaf..9f5e558539 100644 --- a/Utilities/types.h +++ b/Utilities/types.h @@ -890,34 +890,3 @@ inline void busy_wait(std::size_t cycles = 3000) const u64 s = __rdtsc(); do _mm_pause(); while (__rdtsc() - s < cycles); } - -// TODO: Remove when moving to c++20 -template -inline constexpr uintmax_t floor2(T value) -{ - value >>= 1; - - for (uintmax_t i = 0;; i++, value >>= 1) - { - if (value == 0) - { - return i; - } - } -} - -template -inline constexpr uintmax_t ceil2(T value) -{ - const uintmax_t ispow2 = value & (value - 1); // if power of 2 the result is 0 - - value >>= 1; - - for (uintmax_t i = 0;; i++, value >>= 1) - { - if (value == 0) - { - return i + std::min(ispow2, 1); - } - } -} diff --git a/rpcs3/Emu/RSX/rsx_decode.h b/rpcs3/Emu/RSX/rsx_decode.h index f95993323e..969bc6db9c 100644 --- a/rpcs3/Emu/RSX/rsx_decode.h +++ b/rpcs3/Emu/RSX/rsx_decode.h @@ -6,7 +6,6 @@ #include #include "gcm_enums.h" #include "rsx_utils.h" -#pragma warning(disable:4503) namespace rsx { @@ -43,8 +42,8 @@ struct registers_decoder {}; // Use the smallest type by default -template (static_cast((UINTMAX_C(1) << ::ceil2(N)) / CHAR_BIT), 1)>> -static constexpr inline T bf_decoder(const u32& bits) +template > +constexpr T bf_decoder(u32 bits) { return static_cast(bf_t::extract(bits)); }