mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-14 22:29:15 +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:
parent
fc7e934854
commit
8e37949a71
@ -336,7 +336,16 @@ namespace dxvk::bit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t operator * () const {
|
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);
|
return tzcnt(m_mask);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator == (iterator other) const { return m_mask == other.m_mask; }
|
bool operator == (iterator other) const { return m_mask == other.m_mask; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user