Searched refs:powerOf2 (Results 1 – 2 of 2) sorted by relevance
266 template <class T> bool IsPow2(T powerOf2)268 if (powerOf2 <= 0)271 return (powerOf2 & (powerOf2 - 1)) == 0;276 template <class T> void RoundToPow2(T& number, int powerOf2)278 assert(IsPow2(powerOf2));279 number = (number + powerOf2 - 1) & ~(powerOf2 - 1);282 template <class T> bool IsMultipleOfPow2(T number, int powerOf2)284 assert(IsPow2(powerOf2));285 return ! (number & (powerOf2 - 1));
718 DE_INLINE int deIntIsPow2(int powerOf2) in deIntIsPow2() argument720 if (powerOf2 <= 0) in deIntIsPow2()722 return (powerOf2 & (powerOf2 - (int)1)) == (int)0; in deIntIsPow2()725 DE_INLINE int deIntRoundToPow2(int number, int powerOf2) in deIntRoundToPow2() argument727 DE_ASSERT(deIntIsPow2(powerOf2)); in deIntRoundToPow2()728 return (number + (int)powerOf2 - (int)1) & (int)(~(powerOf2 - 1)); in deIntRoundToPow2()