Browse Source

Fix integer version of glm::log2 for GCC

This pretty much reverts the fix done in commit
1ed0e3865b5de0ee993b064b37749bc85e928d7f

This temporarily breaks log2 for GCC in cases where GLM_FORCE_PURE
is not defined. The workaround introduced in commit
1ed0e3865b5de0ee993b064b37749bc85e928d7f seems to rely
on getting invalid results from the nlz function.

Broken nlz is caused by a broken findMSB function for GCC.

A fix for the findMSB function should be available in a nearby
separate commit.
Joonas Sarajärvi 13 years ago
parent
commit
da530ac46e
1 changed files with 1 additions and 3 deletions
  1. 1 3
      glm/gtx/integer.inl

+ 1 - 3
glm/gtx/integer.inl

@@ -60,10 +60,8 @@ namespace _detail
 		template <typename T>
 		GLM_FUNC_QUALIFIER T operator() (T const & Value) const
 		{
-#if(GLM_COMPILER & GLM_COMPILER_VC)
+#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC))
 			return Value <= T(1) ? T(0) : T(32) - nlz(Value - T(1));
-#elif(GLM_COMPILER & GLM_COMPILER_GCC)
-			return Value <= T(1) ? T(0) : nlz(Value - T(1)) + 1;
 #else
 			return T(32) - nlz(Value - T(1));
 #endif