diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2011-11-20 15:50:33 -0800 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2011-11-27 19:52:05 -0800 |
| commit | b62cac2ca93006c3deae1b4406588ec218d1d0ba (patch) | |
| tree | bfb90ea3dc0a4041e8a6c0fe064a8eb0963971ed /Source/Core/Common | |
| parent | 04026ae19ac902f946b8f238f96c4f8b2e740ff1 (diff) | |
Allow modifying main ram size at compile time by changing Memory::REALRAM_SIZE.
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/CommonFuncs.h | 7 |
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__)) |
