diff options
author | 2014-10-08 19:15:21 +0000 | |
---|---|---|
committer | 2014-10-08 19:15:21 +0000 | |
commit | 175b2732f7e55a07094c30aa08d946189b4af97e (patch) | |
tree | 79d5ee5444a5be70130d9a75dd51831c4b15687b /runtime/utils.h | |
parent | edc34c88b8f8abd04f9c4668787403608cf0b2d4 (diff) | |
parent | 7e70b002c4552347ed1af8c002a0e13f08864f20 (diff) |
Merge "Header file clean up."
Diffstat (limited to 'runtime/utils.h')
-rw-r--r-- | runtime/utils.h | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/runtime/utils.h b/runtime/utils.h index 3f2d829b68..4fcd380a8d 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -145,18 +145,6 @@ static inline uint32_t High32Bits(uint64_t value) { return static_cast<uint32_t>(value >> 32); } -// A static if which determines whether to return type A or B based on the condition boolean. -template <bool condition, typename A, typename B> -struct TypeStaticIf { - typedef A type; -}; - -// Specialization to handle the false case. -template <typename A, typename B> -struct TypeStaticIf<false, A, B> { - typedef B type; -}; - // Type identity. template <typename T> struct TypeIdentity { @@ -199,18 +187,6 @@ static inline T* AlignUp(T* x, uintptr_t n) { return reinterpret_cast<T*>(RoundUp(reinterpret_cast<uintptr_t>(x), n)); } -// Implementation is from "Hacker's Delight" by Henry S. Warren, Jr., -// figure 3-3, page 48, where the function is called clp2. -static inline uint32_t RoundUpToPowerOfTwo(uint32_t x) { - x = x - 1; - x = x | (x >> 1); - x = x | (x >> 2); - x = x | (x >> 4); - x = x | (x >> 8); - x = x | (x >> 16); - return x + 1; -} - template<typename T> static constexpr int CLZ(T x) { return (sizeof(T) == sizeof(uint32_t)) |