diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2005-12-23 13:32:31 -0500 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2005-12-23 13:32:31 -0500 |
commit | 0cdcb08d908bc20f614dd164f8e43287406e81a3 (patch) | |
tree | ba6da1e59f9ca5c67c9aa067f374c77129722a52 /base/intmath.hh | |
parent | 627f540e3119e09747005e208daa8153b22d9967 (diff) | |
download | gem5-0cdcb08d908bc20f614dd164f8e43287406e81a3.tar.xz |
Change base/intmath.{cc,hh} to follow m5 style.
arch/alpha/alpha_tru64_process.cc:
base/intmath.hh:
base/statistics.cc:
base/str.cc:
cpu/o3/btb.cc:
sim/process.cc:
sim/syscall_emul.hh:
Rename intmath.hh functions to follow m5 style
(RoundUp -> roundUp, etc.).
base/intmath.cc:
Rename intmath.hh functions to follow m5 style
(RoundUp -> roundUp, etc.).
Also reindent code in m5 style.
--HG--
extra : convert_revision : 57b853002bc3c9911e122599d9062b41a06d8e6a
Diffstat (limited to 'base/intmath.hh')
-rw-r--r-- | base/intmath.hh | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/base/intmath.hh b/base/intmath.hh index 28d47fadd..3922a326b 100644 --- a/base/intmath.hh +++ b/base/intmath.hh @@ -34,12 +34,12 @@ #include "sim/host.hh" // Returns the prime number one less than n. -int PrevPrime(int n); +int prevPrime(int n); // Determine if a number is prime template <class T> inline bool -IsPrime(T n) +isPrime(T n) { T i; @@ -60,20 +60,20 @@ IsPrime(T n) template <class T> inline T -LeastSigBit(T n) +leastSigBit(T n) { return n & ~(n - 1); } template <class T> inline bool -IsPowerOf2(T n) +isPowerOf2(T n) { - return n != 0 && LeastSigBit(n) == n; + return n != 0 && leastSigBit(n) == n; } inline int -FloorLog2(unsigned x) +floorLog2(unsigned x) { assert(x > 0); @@ -89,7 +89,7 @@ FloorLog2(unsigned x) } inline int -FloorLog2(unsigned long x) +floorLog2(unsigned long x) { assert(x > 0); @@ -108,7 +108,7 @@ FloorLog2(unsigned long x) } inline int -FloorLog2(unsigned long long x) +floorLog2(unsigned long long x) { assert(x > 0); @@ -125,76 +125,76 @@ FloorLog2(unsigned long long x) } inline int -FloorLog2(int x) +floorLog2(int x) { assert(x > 0); - return FloorLog2((unsigned)x); + return floorLog2((unsigned)x); } inline int -FloorLog2(long x) +floorLog2(long x) { assert(x > 0); - return FloorLog2((unsigned long)x); + return floorLog2((unsigned long)x); } inline int -FloorLog2(long long x) +floorLog2(long long x) { assert(x > 0); - return FloorLog2((unsigned long long)x); + return floorLog2((unsigned long long)x); } #if defined(__APPLE__) inline int -FloorLog2(size_t x) +floorLog2(size_t x) { assert(x > 0); assert(sizeof(size_t) == 4 || sizeof(size_t) == 8); // It's my hope that this is optimized away? if (sizeof(size_t) == 4) - return FloorLog2((uint32_t)x); + return floorLog2((uint32_t)x); else if (sizeof(size_t) == 8) - return FloorLog2((uint64_t)x); + return floorLog2((uint64_t)x); } #endif template <class T> inline int -CeilLog2(T n) +ceilLog2(T n) { if (n == 1) return 0; - return FloorLog2(n - (T)1) + 1; + return floorLog2(n - (T)1) + 1; } template <class T> inline T -FloorPow2(T n) +floorPow2(T n) { - return (T)1 << FloorLog2(n); + return (T)1 << floorLog2(n); } template <class T> inline T -CeilPow2(T n) +ceilPow2(T n) { - return (T)1 << CeilLog2(n); + return (T)1 << ceilLog2(n); } template <class T> inline T -DivCeil(T a, T b) +divCeil(T a, T b) { return (a + b - 1) / b; } template <class T> inline T -RoundUp(T val, T align) +roundUp(T val, T align) { T mask = align - 1; return (val + mask) & ~mask; @@ -202,14 +202,14 @@ RoundUp(T val, T align) template <class T> inline T -RoundDown(T val, T align) +roundDown(T val, T align) { T mask = align - 1; return val & ~mask; } inline bool -IsHex(char c) +isHex(char c) { return c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || @@ -217,19 +217,19 @@ IsHex(char c) } inline bool -IsOct(char c) +isOct(char c) { return c >= '0' && c <= '7'; } inline bool -IsDec(char c) +isDec(char c) { return c >= '0' && c <= '9'; } inline int -Hex2Int(char c) +hex2Int(char c) { if (c >= '0' && c <= '9') return (c - '0'); |