diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index ae455a83..c7ee7e13 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -100,31 +100,29 @@ namespace detail } }; -# if (GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) - - template - struct compute_findLSB - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) +# if(GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) + template + struct compute_findLSB { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanForward(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - }; + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanForward(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + }; - template - struct compute_findLSB - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) + template + struct compute_findLSB { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanForward64(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - }; - -# endif + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanForward64(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + }; +# endif//GLM_ARCH != GLM_ARCH_PURE template class vecType, bool EXEC = true> struct compute_findMSB_step_vec @@ -160,44 +158,41 @@ namespace detail } }; -# if (GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) - - template - GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanReverse(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - - template - GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - - template class vecType> - struct compute_findMSB_vec - { - GLM_FUNC_QUALIFIER static int call(vecType const & x) +# if(GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) + template + GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value) { - return detail::functor1::call(compute_findMSB_32, x); + unsigned long Result(0); + unsigned char IsNotNull = _BitScanReverse(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; } - }; - template class vecType> - struct compute_findMSB_vec - { - GLM_FUNC_QUALIFIER static int call(vecType const & x) + template + GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) { - return detail::functor1::call(compute_findMSB_64, x); + unsigned long Result(0); + unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; } - }; -# endif + template class vecType> + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static int call(vecType const & x) + { + return detail::functor1::call(compute_findMSB_32, x); + } + }; + template class vecType> + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static int call(vecType const & x) + { + return detail::functor1::call(compute_findMSB_64, x); + } + }; +# endif//GLM_ARCH != GLM_ARCH_PURE }//namespace detail // uaddCarry