mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2025-03-14 18:29:23 +01:00
Use portUtilCountTrailingZeros64
from nvport
* Implemented using compiler intrinsics and architecture specific instructions, so even faster
This commit is contained in:
parent
8b24fa5b0a
commit
cf8d063626
@ -35,16 +35,11 @@
|
||||
//
|
||||
NvU32 nvLogBase2(NvU64 val)
|
||||
{
|
||||
NvU32 i = 0;
|
||||
|
||||
// Use two NV_ASSERTs for better error identification
|
||||
NV_ASSERT(val != 0);
|
||||
NV_ASSERT(((val) & (val - 1)) == 0);
|
||||
|
||||
while ((val >>= 1))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
NvU32 i = portUtilCountTrailingZeros64(val);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user