diff --git a/Utilities/asm.h b/Utilities/asm.h index b3741ba52e..951dd2fd2a 100644 --- a/Utilities/asm.h +++ b/Utilities/asm.h @@ -4,23 +4,6 @@ namespace utils { - inline u8 popcnt32(u32 arg) - { -#ifdef _MSC_VER - const u32 a1 = arg & 0x55555555; - const u32 a2 = (arg >> 1) & 0x55555555; - const u32 a3 = a1 + a2; - const u32 b1 = a3 & 0x33333333; - const u32 b2 = (a3 >> 2) & 0x33333333; - const u32 b3 = b1 + b2; - const u32 c3 = (b3 + (b3 >> 4)) & 0x0f0f0f0f; - const u32 d3 = c3 + (c3 >> 8); - return static_cast(d3 + (d3 >> 16)); -#else - return __builtin_popcount(arg); -#endif - } - // Rotate helpers #if defined(__GNUG__) diff --git a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp index d81eebf8ad..5c446ca42e 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/asm.h" #include "Emu/Cell/SPUThread.h" #include "Emu/Cell/lv2/sys_lwmutex.h" #include "Emu/Cell/lv2/sys_lwcond.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSync.cpp b/rpcs3/Emu/Cell/Modules/cellSync.cpp index 58e50c600a..25fdb4955d 100644 --- a/rpcs3/Emu/Cell/Modules/cellSync.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSync.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/asm.h" #include "Emu/Cell/lv2/sys_event.h" #include "Emu/Cell/lv2/sys_process.h" #include "cellSync.h" diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 8205cc00e1..44a3972442 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -236,7 +236,7 @@ Type* PPUTranslator::ScaleType(Type* type, s32 pow2) uint scaled = type->getScalarSizeInBits(); - verify(HERE), utils::popcnt32(scaled) == 1; + verify(HERE), std::popcount(scaled) == 1; if (pow2 > 0) { diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 938de9405c..4e87c09005 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -10,7 +10,6 @@ #include "Utilities/Thread.h" #include "Utilities/VirtualMemory.h" #include "Utilities/address_range.h" -#include "Utilities/asm.h" #include "Emu/CPU/CPUThread.h" #include "Emu/Cell/lv2/sys_memory.h" #include "Emu/RSX/GSRender.h" @@ -1105,7 +1104,7 @@ namespace vm if (is_write) std::swap(src, dst); - if (size <= 16 && utils::popcnt32(size) == 1 && (addr & (size - 1)) == 0) + if (size <= 16 && std::popcount(size) == 1 && (addr & (size - 1)) == 0) { if (is_write) {