mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-05 11:12:34 -07:00
7 lines
158 B
Metal
7 lines
158 B
Metal
template<typename T>
|
|
inline T findMSBU32(T x)
|
|
{
|
|
T v = select(x, T(-1) - x, x < T(0));
|
|
return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));
|
|
}
|