diff --git a/common/Align.h b/common/BitUtils.h similarity index 79% rename from common/Align.h rename to common/BitUtils.h index 1794476db9..375857f392 100644 --- a/common/Align.h +++ b/common/BitUtils.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2021 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -14,8 +14,29 @@ */ #pragma once + #include "common/Pcsx2Defs.h" +#include + +#ifdef _MSC_VER + +#include + +#else + +static inline int _BitScanReverse(unsigned long* const Index, const unsigned long Mask) +{ + if (Mask == 0) + return 0; + + // For some reason, clang won't emit bsr if we use std::countl_zeros()... + *Index = 31 - __builtin_clz(Mask); + return 1; +} + +#endif + namespace Common { template @@ -96,4 +117,18 @@ namespace Common static_assert(Common::IsPow2(__pagesize), "Page size is a power of 2"); return Common::AlignUpPow2(size, __pagesize); } + + __fi static u32 CountLeadingSignBits(s32 n) + { + // If the sign bit is 1, we invert the bits to 0 for count-leading-zero. + if (n < 0) + n = ~n; + + // If BSR is used directly, it would have an undefined value for 0. + if (n == 0) + return 32; + + // Perform our count leading zero. + return std::countl_zero(static_cast(n)); + } } // namespace Common diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 9957c98f12..d8eaa3167b 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -61,10 +61,10 @@ target_sources(common PRIVATE # x86emitter headers target_sources(common PRIVATE - Align.h AlignedMalloc.h Assertions.h boost_spsc_queue.hpp + BitUtils.h ByteSwap.h Console.h CrashHandler.h diff --git a/common/Linux/LnxHostSys.cpp b/common/Linux/LnxHostSys.cpp index 631215ff4d..870963f8cd 100644 --- a/common/Linux/LnxHostSys.cpp +++ b/common/Linux/LnxHostSys.cpp @@ -25,7 +25,7 @@ #include "fmt/core.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Assertions.h" #include "common/Console.h" #include "common/General.h" diff --git a/common/MathUtils.h b/common/MathUtils.h deleted file mode 100644 index 5a85d97d28..0000000000 --- a/common/MathUtils.h +++ /dev/null @@ -1,41 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2014- PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#pragma once -// Hopefully this file will be used for cross-source math utilities. -// Currently these are strewn across the code base. Please collect them all! - -#include "common/Pcsx2Defs.h" - -// On GCC >= 4.7, this is equivalent to __builtin_clrsb(n); -inline u32 count_leading_sign_bits(s32 n) -{ - // If the sign bit is 1, we invert the bits to 0 for count-leading-zero. - if (n < 0) - n = ~n; - - // If BSR is used directly, it would have an undefined value for 0. - if (n == 0) - return 32; - -// Perform our count leading zero. -#ifdef _MSC_VER - unsigned long ret; - _BitScanReverse(&ret, n); - return 31 - (u32)ret; -#else - return __builtin_clz(n); -#endif -} diff --git a/common/Windows/WinHostSys.cpp b/common/Windows/WinHostSys.cpp index 8ff42f3052..3f55d2b055 100644 --- a/common/Windows/WinHostSys.cpp +++ b/common/Windows/WinHostSys.cpp @@ -15,7 +15,7 @@ #if defined(_WIN32) -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/RedtapeWindows.h" #include "common/Console.h" #include "common/General.h" diff --git a/common/common.vcxproj b/common/common.vcxproj index d3ac561dec..f5300e575b 100644 --- a/common/common.vcxproj +++ b/common/common.vcxproj @@ -103,7 +103,7 @@ - + @@ -134,7 +134,6 @@ - diff --git a/common/common.vcxproj.filters b/common/common.vcxproj.filters index b866f5a12f..415d2f7199 100644 --- a/common/common.vcxproj.filters +++ b/common/common.vcxproj.filters @@ -201,9 +201,6 @@ Header Files - - Header Files - Header Files @@ -270,7 +267,7 @@ Header Files - + Header Files diff --git a/pcsx2-qt/Settings/InputBindingDialog.cpp b/pcsx2-qt/Settings/InputBindingDialog.cpp index 9b1e46e220..c4eac29d8c 100644 --- a/pcsx2-qt/Settings/InputBindingDialog.cpp +++ b/pcsx2-qt/Settings/InputBindingDialog.cpp @@ -27,8 +27,7 @@ #include "fmt/format.h" -// _BitScanForward() -#include "pcsx2/GS/GSIntrin.h" +#include InputBindingDialog::InputBindingDialog(SettingsInterface* sif, InputBindingInfo::Type bind_type, std::string section_name, std::string key_name, std::vector bindings, QWidget* parent) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index e0d2f95360..30295c89f3 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -549,7 +549,6 @@ set(pcsx2GSHeaders GS/GSDump.h GS/GSExtra.h GS/GSGL.h - GS/GSIntrin.h GS/GSRegs.h GS/GS.h GS/GSLocalMemory.h diff --git a/pcsx2/GS/GSCapture.cpp b/pcsx2/GS/GSCapture.cpp index 336c6c1904..50a531ff7d 100644 --- a/pcsx2/GS/GSCapture.cpp +++ b/pcsx2/GS/GSCapture.cpp @@ -25,7 +25,7 @@ #include "Host.h" #include "IconsFontAwesome5.h" #include "common/Assertions.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/DynamicLibrary.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/GSExtra.h b/pcsx2/GS/GSExtra.h index 122c85c573..a336ff7c46 100644 --- a/pcsx2/GS/GSExtra.h +++ b/pcsx2/GS/GSExtra.h @@ -17,7 +17,7 @@ #include "GS/GSVector.h" #include "pcsx2/Config.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include diff --git a/pcsx2/GS/GSIntrin.h b/pcsx2/GS/GSIntrin.h deleted file mode 100644 index 7b28eb61cc..0000000000 --- a/pcsx2/GS/GSIntrin.h +++ /dev/null @@ -1,55 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2021 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#pragma once - -#include -#include - -#include -#include - -#if _M_SSE >= 0x500 - #include -#endif - -#if !defined(_MSC_VER) -// http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin_x86.h?view=markup - -static inline int _BitScanForward(unsigned long* const Index, const unsigned long Mask) -{ - if (Mask == 0) - return 0; -#if __has_builtin(__builtin_ctz) - *Index = __builtin_ctz(Mask); -#else - __asm__("bsfl %k[Mask], %k[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask) : "cc"); -#endif - return 1; -} - -static inline int _BitScanReverse(unsigned long* const Index, const unsigned long Mask) -{ - if (Mask == 0) - return 0; -#if __has_builtin(__builtin_clz) - *Index = 31 - __builtin_clz(Mask); -#else - __asm__("bsrl %k[Mask], %k[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask) : "cc"); -#endif - return 1; -} - -#endif diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index b5ad36762a..2abcc7adf0 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -19,6 +19,7 @@ #include "GS/GSGL.h" #include "GS/GSPerfMon.h" #include "GS/GSUtil.h" +#include "common/BitUtils.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/GSVector.h b/pcsx2/GS/GSVector.h index 910822d0e9..a208dbcde7 100644 --- a/pcsx2/GS/GSVector.h +++ b/pcsx2/GS/GSVector.h @@ -13,12 +13,20 @@ * If not, see . */ -#include "PrecompiledHeader.h" -#include "GSIntrin.h" -#include - #pragma once +#include "PrecompiledHeader.h" + +#include +#include +#include +#include +#if _M_SSE >= 0x500 +#include +#endif + +#include + #ifdef _WIN32 #define gsforceinline __forceinline #else diff --git a/pcsx2/GS/Renderers/Common/GSDevice.cpp b/pcsx2/GS/Renderers/Common/GSDevice.cpp index b0c43bddbb..586f79f2c1 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.cpp +++ b/pcsx2/GS/Renderers/Common/GSDevice.cpp @@ -20,7 +20,7 @@ #include "GS/GS.h" #include "Host.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/StringUtil.h" #include "imgui.h" diff --git a/pcsx2/GS/Renderers/Common/GSTexture.cpp b/pcsx2/GS/Renderers/Common/GSTexture.cpp index 945180b423..f5182a03c8 100644 --- a/pcsx2/GS/Renderers/Common/GSTexture.cpp +++ b/pcsx2/GS/Renderers/Common/GSTexture.cpp @@ -17,7 +17,7 @@ #include "GS/Renderers/Common/GSTexture.h" #include "GS/Renderers/Common/GSDevice.h" #include "GS/GSPng.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/StringUtil.h" #include diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp index 9fa3900e11..5327d206a0 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp @@ -22,7 +22,7 @@ #include "GS/GSUtil.h" #include "Host.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/DX11/GSTexture11.cpp b/pcsx2/GS/Renderers/DX11/GSTexture11.cpp index d1d620070b..9d0c84ae25 100644 --- a/pcsx2/GS/Renderers/DX11/GSTexture11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSTexture11.cpp @@ -18,7 +18,7 @@ #include "GSTexture11.h" #include "GS/GSPng.h" #include "GS/GSPerfMon.h" -#include "common/Align.h" +#include "common/BitUtils.h" GSTexture11::GSTexture11(wil::com_ptr_nothrow texture, const D3D11_TEXTURE2D_DESC& desc, GSTexture::Type type, GSTexture::Format format) diff --git a/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.cpp b/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.cpp index 1b3caca60f..4eeb88fb05 100644 --- a/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.cpp +++ b/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.cpp @@ -18,7 +18,7 @@ #include "GS/Renderers/DX12/D3D12StreamBuffer.h" #include "GS/Renderers/DX12/GSDevice12.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Assertions.h" #include "common/Console.h" diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index a8ed8498b5..60bcc8edd4 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -26,7 +26,7 @@ #include "Host.h" #include "ShaderCacheVersion.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/ScopedGuard.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/DX12/GSTexture12.cpp b/pcsx2/GS/Renderers/DX12/GSTexture12.cpp index 877be138d7..bb955fe1cc 100644 --- a/pcsx2/GS/Renderers/DX12/GSTexture12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSTexture12.cpp @@ -22,7 +22,7 @@ #include "GS/GSGL.h" #include "common/Assertions.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/StringUtil.h" #include "D3D12MemAlloc.h" diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 7a67169ec9..7572c12baf 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -20,7 +20,7 @@ #include "GS/GSPerfMon.h" #include "GS/GSUtil.h" #include "Host.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/StringUtil.h" GSRendererHW::GSRendererHW() diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index da3c3af57b..f9abd6bcdb 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -19,11 +19,10 @@ #include "GSRendererHW.h" #include "GS/GSState.h" #include "GS/GSGL.h" -#include "GS/GSIntrin.h" #include "GS/GSPerfMon.h" #include "GS/GSUtil.h" #include "GS/GSXXH.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/HashCombine.h" #ifdef __APPLE__ diff --git a/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp b/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp index b7f2a6caca..de3469288c 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp @@ -15,7 +15,7 @@ #include "PrecompiledHeader.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/FileSystem.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/Metal/GSTextureMTL.mm b/pcsx2/GS/Renderers/Metal/GSTextureMTL.mm index 489408cb71..6f94cbe7a6 100644 --- a/pcsx2/GS/Renderers/Metal/GSTextureMTL.mm +++ b/pcsx2/GS/Renderers/Metal/GSTextureMTL.mm @@ -17,7 +17,7 @@ #include "GS/Renderers/Metal/GSTextureMTL.h" #include "GS/Renderers/Metal/GSDeviceMTL.h" #include "GS/GSPerfMon.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Console.h" #ifdef __APPLE__ diff --git a/pcsx2/GS/Renderers/OpenGL/GLStreamBuffer.cpp b/pcsx2/GS/Renderers/OpenGL/GLStreamBuffer.cpp index acbe8e0805..524bd332d6 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLStreamBuffer.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GLStreamBuffer.cpp @@ -17,7 +17,7 @@ #include "GS/Renderers/OpenGL/GLStreamBuffer.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/AlignedMalloc.h" #include "common/Assertions.h" diff --git a/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp index a5ad59a6fd..598307d0ab 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp @@ -22,7 +22,7 @@ #include "GS/GSPerfMon.h" #include "GS/GSPng.h" #include "GS/GSGL.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/AlignedMalloc.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index f8ef0d2edf..0aafe3986a 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -26,7 +26,7 @@ #include "Host.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Path.h" #include "common/ScopedGuard.h" diff --git a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp index 27e5421503..0131c4acb5 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp @@ -21,7 +21,7 @@ #include "GS/GSPerfMon.h" #include "GS/GSGL.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Assertions.h" static constexpr const VkComponentMapping s_identity_swizzle{VK_COMPONENT_SWIZZLE_IDENTITY, diff --git a/pcsx2/GS/Renderers/Vulkan/VKStreamBuffer.cpp b/pcsx2/GS/Renderers/Vulkan/VKStreamBuffer.cpp index c1a259369d..c353cb9b1b 100644 --- a/pcsx2/GS/Renderers/Vulkan/VKStreamBuffer.cpp +++ b/pcsx2/GS/Renderers/Vulkan/VKStreamBuffer.cpp @@ -19,7 +19,7 @@ #include "GS/Renderers/Vulkan/VKStreamBuffer.h" #include "GS/Renderers/Vulkan/VKBuilders.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Assertions.h" #include "common/Console.h" diff --git a/pcsx2/ImGui/ImGuiOverlays.cpp b/pcsx2/ImGui/ImGuiOverlays.cpp index 03e93a9770..2263898675 100644 --- a/pcsx2/ImGui/ImGuiOverlays.cpp +++ b/pcsx2/ImGui/ImGuiOverlays.cpp @@ -35,7 +35,7 @@ #include "VMManager.h" #include "pcsx2/Recording/InputRecording.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/StringUtil.h" #include "common/Timer.h" diff --git a/pcsx2/IopGte.cpp b/pcsx2/IopGte.cpp index 791a4b02e0..09abff3bed 100644 --- a/pcsx2/IopGte.cpp +++ b/pcsx2/IopGte.cpp @@ -21,7 +21,7 @@ #include "R3000A.h" #include "IopMem.h" -#include "common/MathUtils.h" +#include "common/BitUtils.h" #ifdef GTE_DUMP #define G_OP(name,delay) fprintf(gteLog, "* : %08X : %02d : %s\n", psxRegs.code, delay, name); #define G_SD(reg) fprintf(gteLog, "+D%02d : %08X\n", reg, psxRegs.CP2D.r[reg]); @@ -208,7 +208,7 @@ __inline void MTC2(unsigned long value, int reg) { case 30: psxRegs.CP2D.r[30] = value; - psxRegs.CP2D.r[31] = count_leading_sign_bits(value); + psxRegs.CP2D.r[31] = Common::CountLeadingSignBits(value); break; default: diff --git a/pcsx2/MMI.cpp b/pcsx2/MMI.cpp index 50575736b4..1f5f27c170 100644 --- a/pcsx2/MMI.cpp +++ b/pcsx2/MMI.cpp @@ -16,7 +16,7 @@ #include "PrecompiledHeader.h" #include "Common.h" -#include "common/MathUtils.h" +#include "common/BitUtils.h" namespace R5900 { namespace Interpreter { @@ -151,8 +151,8 @@ void PLZCW() { return; // Return the leading sign bits, excluding the original bit - cpuRegs.GPR.r[_Rd_].UL[0] = count_leading_sign_bits(cpuRegs.GPR.r[_Rs_].SL[0]) - 1; - cpuRegs.GPR.r[_Rd_].UL[1] = count_leading_sign_bits(cpuRegs.GPR.r[_Rs_].SL[1]) - 1; + cpuRegs.GPR.r[_Rd_].UL[0] = Common::CountLeadingSignBits(cpuRegs.GPR.r[_Rs_].SL[0]) - 1; + cpuRegs.GPR.r[_Rd_].UL[1] = Common::CountLeadingSignBits(cpuRegs.GPR.r[_Rs_].SL[1]) - 1; } __fi void PMFHL_CLAMP(u16& dst, s32 src) diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 904c09dac3..6070139a71 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -28,7 +28,7 @@ #include "SysForwardDefs.h" #include "x86/newVif.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Perf.h" #include "common/StringUtil.h" diff --git a/pcsx2/VirtualMemory.cpp b/pcsx2/VirtualMemory.cpp index e3d033d330..8be39e9af2 100644 --- a/pcsx2/VirtualMemory.cpp +++ b/pcsx2/VirtualMemory.cpp @@ -17,7 +17,7 @@ #include "VirtualMemory.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "common/Console.h" #include "common/Perf.h" diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index 842ec7d6cf..a7123198a0 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -610,7 +610,6 @@ - diff --git a/pcsx2/pcsx2.vcxproj.filters b/pcsx2/pcsx2.vcxproj.filters index 386c58c6dc..5994ad37ad 100644 --- a/pcsx2/pcsx2.vcxproj.filters +++ b/pcsx2/pcsx2.vcxproj.filters @@ -1880,9 +1880,6 @@ System\Ps2\GS - - System\Ps2\GS - System\Ps2\GS diff --git a/pcsx2/vtlb.cpp b/pcsx2/vtlb.cpp index 7dceebdbbc..b32b717f79 100644 --- a/pcsx2/vtlb.cpp +++ b/pcsx2/vtlb.cpp @@ -38,7 +38,7 @@ #include "Host.h" #include "VMManager.h" -#include "common/Align.h" +#include "common/BitUtils.h" #include "fmt/core.h" diff --git a/pcsx2/x86/iMMI.cpp b/pcsx2/x86/iMMI.cpp index a96ba15f09..6ee7b39cab 100644 --- a/pcsx2/x86/iMMI.cpp +++ b/pcsx2/x86/iMMI.cpp @@ -25,7 +25,7 @@ #include "R5900OpcodeTables.h" #include "iR5900.h" #include "iMMI.h" -#include "common/MathUtils.h" +#include "common/BitUtils.h" using namespace x86Emitter; @@ -73,8 +73,8 @@ void recPLZCW() GPR_SET_CONST(_Rd_); // Return the leading sign bits, excluding the original bit - g_cpuConstRegs[_Rd_].UL[0] = count_leading_sign_bits(g_cpuConstRegs[_Rs_].SL[0]) - 1; - g_cpuConstRegs[_Rd_].UL[1] = count_leading_sign_bits(g_cpuConstRegs[_Rs_].SL[1]) - 1; + g_cpuConstRegs[_Rd_].UL[0] = Common::CountLeadingSignBits(g_cpuConstRegs[_Rs_].SL[0]) - 1; + g_cpuConstRegs[_Rd_].UL[1] = Common::CountLeadingSignBits(g_cpuConstRegs[_Rs_].SL[1]) - 1; return; }