Use portUtilCountTrailingZeros64 from nvport

* Implemented using compiler intrinsics and architecture specific
    instructions, so even faster
This commit is contained in:
Dhruv Maroo 2022-05-15 03:43:29 +05:30
parent 8b24fa5b0a
commit cf8d063626
No known key found for this signature in database
GPG Key ID: 9ED1310EE7C2F034

View File

@ -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;
}