Rename Log2 and add IsPow2 to MathUtils for future use

Also remove unused pow2/pow2f functions.
This commit is contained in:
Fiora 2014-08-24 11:03:07 -07:00
parent aec639470f
commit b51aa4fa89
5 changed files with 16 additions and 17 deletions

View file

@ -166,16 +166,15 @@ struct Rectangle
} // namespace MathUtil
inline float pow2f(float x) {return x * x;}
inline double pow2(double x) {return x * x;}
float MathFloatVectorSum(const std::vector<float>&);
#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
#define ROUND_DOWN(x, a) ((x) & ~((a) - 1))
inline bool IsPow2(u32 imm) {return (imm & (imm - 1)) == 0;}
// Rounds down. 0 -> undefined
inline int Log2(u64 val)
inline int IntLog2(u64 val)
{
#if defined(__GNUC__)
return 63 - __builtin_clzll(val);