1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[util] Use raw tzcnt for BitMask iterator

Dereferencing an end iterator is UB, so we don't have to care about the 0
case.
This commit is contained in:
Georg Lehmann 2022-08-03 19:40:34 +02:00 committed by Philip Rebohle
parent fc7e934854
commit 8e37949a71

View File

@ -336,7 +336,16 @@ namespace dxvk::bit {
}
uint32_t operator * () const {
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__BMI__)
uint32_t res;
asm ("tzcnt %1,%0"
: "=r" (res)
: "r" (m_mask)
: "cc");
return res;
#else
return tzcnt(m_mask);
#endif
}
bool operator == (iterator other) const { return m_mask == other.m_mask; }