projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
gallium: add start_slot parameter to set_vertex_buffers
[mesa.git]
/
src
/
gallium
/
auxiliary
/
util
/
u_math.h
diff --git
a/src/gallium/auxiliary/util/u_math.h
b/src/gallium/auxiliary/util/u_math.h
index 4047bd9b0162366e084ceb718335baeb2a166860..607fbecb02f5bd7d51dab8efff397e7b7688a99b 100644
(file)
--- a/
src/gallium/auxiliary/util/u_math.h
+++ b/
src/gallium/auxiliary/util/u_math.h
@@
-482,12
+482,16
@@
unsigned ffs( unsigned u )
*/
static INLINE unsigned util_last_bit(unsigned u)
{
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304)
+ return u == 0 ? 0 : 32 - __builtin_clz(u);
+#else
unsigned r = 0;
while (u) {
r++;
u >>= 1;
}
return r;
+#endif
}