Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Platform Namespace Reference

Functions

U64 countLeadingZeroes (U64 value)
 
U32 countLeadingZeroes (U32 value)
 
U64 countTrailingZeroes (U64 value)
 
U32 countTrailingZeroes (U32 value)
 
U64 floorLogTwo (U64 value)
 
U32 floorLogTwo (U32 value)
 
U64 ceilLogTwo (U64 value)
 
U32 ceilLogTwo (U32 value)
 

Function Documentation

◆ ceilLogTwo() [1/2]

U32 Platform::ceilLogTwo ( U32 value)
inline

Definition at line 32 of file Platform.h.

32{ return floorLogTwo(value * 2 - 1); }
U64 floorLogTwo(U64 value)
Definition Platform.h:29
#define value
Definition pkcs11.h:157
Here is the call graph for this function:

◆ ceilLogTwo() [2/2]

U64 Platform::ceilLogTwo ( U64 value)
inline

Definition at line 31 of file Platform.h.

31{ return floorLogTwo(value * 2 - 1); }
Here is the call graph for this function:

◆ countLeadingZeroes() [1/2]

U32 Platform::countLeadingZeroes ( U32 value)
inline

Definition at line 26 of file Platform.h.

26{ return value == 0 ? 32 : __builtin_clz(value); }

◆ countLeadingZeroes() [2/2]

U64 Platform::countLeadingZeroes ( U64 value)
inline

Definition at line 25 of file Platform.h.

25{ return value == 0 ? 64 : __builtin_clzll(value); }
Here is the caller graph for this function:

◆ countTrailingZeroes() [1/2]

U32 Platform::countTrailingZeroes ( U32 value)
inline

Definition at line 28 of file Platform.h.

28{ return value == 0 ? 32 : __builtin_ctz(value); }

◆ countTrailingZeroes() [2/2]

U64 Platform::countTrailingZeroes ( U64 value)
inline

Definition at line 27 of file Platform.h.

27{ return value == 0 ? 64 : __builtin_ctzll(value); }
Here is the caller graph for this function:

◆ floorLogTwo() [1/2]

U32 Platform::floorLogTwo ( U32 value)
inline

Definition at line 30 of file Platform.h.

30{ return value <= 1 ? 0 : 31 - countLeadingZeroes(value); }
U64 countLeadingZeroes(U64 value)
Definition Platform.h:25
Here is the call graph for this function:

◆ floorLogTwo() [2/2]

U64 Platform::floorLogTwo ( U64 value)
inline

Definition at line 29 of file Platform.h.

29{ return value <= 1 ? 0 : 63 - countLeadingZeroes(value); }
Here is the call graph for this function:
Here is the caller graph for this function: