summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2011-12-10 18:48:35 -0800
committerShawn Hoffman <godisgovernment@gmail.com>2011-12-10 18:48:35 -0800
commitb0ffa72e37c7e9fd6c94112bf4fbb16c852ac7e5 (patch)
treedc1ef0cb6da820e30436ed500eec0b61213ec6ff /Source/Core/Common
parent3d9c35f58e84aa2c1b69bf4dfe381a9b526a3dd2 (diff)
parent62858c8c140a281cc5145ca1b81b1aeffbb5015a (diff)
Merge branch 'large-mram'
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/CommonFuncs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/CommonFuncs.h b/Source/Core/Common/Src/CommonFuncs.h
index c79137780d..74d317d95f 100644
--- a/Source/Core/Common/Src/CommonFuncs.h
+++ b/Source/Core/Common/Src/CommonFuncs.h
@@ -27,6 +27,13 @@
template <bool> struct CompileTimeAssert;
template<> struct CompileTimeAssert<true> {};
+#define b2(x) ( (x) | ( (x) >> 1) )
+#define b4(x) ( b2(x) | ( b2(x) >> 2) )
+#define b8(x) ( b4(x) | ( b4(x) >> 4) )
+#define b16(x) ( b8(x) | ( b8(x) >> 8) )
+#define b32(x) (b16(x) | (b16(x) >>16) )
+#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
+
#if defined __GNUC__ && !defined __SSSE3__
#include <emmintrin.h>
static __inline __m128i __attribute__((__always_inline__))