summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorFiora <fioraaeterna@gmail.com>2014-08-24 11:03:07 -0700
committerFiora <fioraaeterna@gmail.com>2014-09-01 20:41:07 -0700
commitb51aa4fa89c819f12c718a794ee8a62969e8b2d2 (patch)
treeb4b447318c1c6880e929f51f17a8de683fdda2d8 /Source/Core/Common
parentaec639470f2ae32826b7c0d00e0323a6e3d87f18 (diff)
Rename Log2 and add IsPow2 to MathUtils for future use
Also remove unused pow2/pow2f functions.
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/MathUtil.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/Common/MathUtil.h b/Source/Core/Common/MathUtil.h
index db35cbedcf..013e0b9733 100644
--- a/Source/Core/Common/MathUtil.h
+++ b/Source/Core/Common/MathUtil.h
@@ -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);