|
@@ -544,10 +544,13 @@ namespace glm
|
|
|
)
|
|
)
|
|
|
{
|
|
{
|
|
|
/**
|
|
/**
|
|
|
- * ctz returns the number or trailing 0-bits; see
|
|
|
|
|
|
|
+ * clz returns the number or trailing 0-bits; see
|
|
|
* http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Other-Builtins.html
|
|
* http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Other-Builtins.html
|
|
|
|
|
+ *
|
|
|
|
|
+ * NoteBecause __builtin_clz only works for unsigned ints, this
|
|
|
|
|
+ * implementation will not work for 64-bit integers.
|
|
|
*/
|
|
*/
|
|
|
- return __builtin_ctz(Value);
|
|
|
|
|
|
|
+ return 31 - __builtin_clz(Value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
#else
|