all repos — mgba @ f7d17d62b52a2d684a0efdb4a86684dfb056f803

mGBA Game Boy Advance Emulator

Util: Make clz consistent
Jeffrey Pfau jeffrey@endrift.com
Fri, 10 Jun 2016 13:20:19 -0700
commit

f7d17d62b52a2d684a0efdb4a86684dfb056f803

parent

874fae7b5a041735c4165bb908cf6a0fa5a84d07

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M include/mgba-util/math.hinclude/mgba-util/math.h

@@ -18,6 +18,9 @@ }

static inline unsigned clz32(uint32_t bits) { #if defined(__GNUC__) || __clang__ + if (!bits) { + return 32; + } return __builtin_clz(bits); #else static const int table[256] = {