Don't use std::popcount (workaround)

It seems MSVC uses POPCNT instruction when compiling for SSE2.
This commit is contained in:
Nekotekina 2020-04-25 18:01:39 +03:00
commit 58ba6d68bb
2 changed files with 2 additions and 2 deletions

View file

@ -236,7 +236,7 @@ Type* PPUTranslator::ScaleType(Type* type, s32 pow2)
uint scaled = type->getScalarSizeInBits(); uint scaled = type->getScalarSizeInBits();
verify(HERE), std::popcount(scaled) == 1; verify(HERE), (scaled & (scaled - 1)) == 0;
if (pow2 > 0) if (pow2 > 0)
{ {

View file

@ -1182,7 +1182,7 @@ namespace vm
if (is_write) if (is_write)
std::swap(src, dst); std::swap(src, dst);
if (size <= 16 && std::popcount(size) == 1 && (addr & (size - 1)) == 0) if (size <= 16 && (size & (size - 1)) == 0 && (addr & (size - 1)) == 0)
{ {
if (is_write) if (is_write)
{ {