mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-01 07:52:37 +00:00
Rename Log2 and add IsPow2 to MathUtils for future use
Also remove unused pow2/pow2f functions.
This commit is contained in:
parent
aec639470f
commit
b51aa4fa89
5 changed files with 16 additions and 17 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue