[*] Stupid MSVC optimization

This commit is contained in:
Reece Wilson 2022-01-20 13:43:37 +00:00
parent 1f825b4754
commit 46d5eed4c8

View File

@ -691,17 +691,15 @@ static auline bool AuBitScanForward(AuUInt8 &index, T value)
success = false;
index = 0;
if (value == 0)
{
return false;
}
#if defined(AURORA_COMPILER_MSVC)
if constexpr (sizeof(T) == sizeof(AuUInt64))
#if defined(AURORA_IS_32BIT)
if (!_BitScanForward(&ret, static_cast<AuUInt32>(value & 0xffffffff)))
{
_BitScanForward(&ret, static_cast<AuUInt32>((value >> 32) & 0xffffffff));
if (!_BitScanForward(&ret, static_cast<AuUInt32>((value >> 32) & 0xffffffff)))
{
return false;
}
ret += 32;
}
#else
@ -709,6 +707,11 @@ static auline bool AuBitScanForward(AuUInt8 &index, T value)
#endif
else success = _BitScanForward(&ret, static_cast<unsigned long>(value));
#elif defined(AURORA_COMPILER_GCC) || defined(AURORA_COMPILER_CLANG)
if (value == 0)
{
return false;
}
if constexpr (sizeof(T) == sizeof(AuUInt64))
#if defined(AURORA_IS_32BIT)
auto lower = static_cast<AuUInt32>(value & 0xffffffff));