mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 10:14:35 +00:00
Fix integer version of glm::log2 for GCC
This pretty much reverts the fix done in commit1ed0e3865b
This temporarily breaks log2 for GCC in cases where GLM_FORCE_PURE is not defined. The workaround introduced in commit1ed0e3865b
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.
This commit is contained in:
parent
72a01d3432
commit
da530ac46e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user