diff options
| author | Fiora <fioraaeterna@gmail.com> | 2014-08-24 11:03:07 -0700 |
|---|---|---|
| committer | Fiora <fioraaeterna@gmail.com> | 2014-09-08 20:15:45 -0700 |
| commit | 94c20db36968bfcef67d43203ad19c4876f439d3 (patch) | |
| tree | b240e27e1197725f13067b500a787b6024a547f0 /Source/Core/Common | |
| parent | 0926f1d3448047de45003b963050f2e4ce38fa55 (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.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/Common/MathUtil.h b/Source/Core/Common/MathUtil.h index 9c0fe2c884..143398d6f7 100644 --- a/Source/Core/Common/MathUtil.h +++ b/Source/Core/Common/MathUtil.h @@ -175,16 +175,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); |
