From 6ed8c3dbb3d64b0bc3af44cea9d1bfe7630d5f06 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 4 Jan 2014 13:27:06 +0100 Subject: [PATCH] Added vectorized implementation of fast inversesqrt --- glm/detail/func_exponential.inl | 91 ++++++++++++++------------------- glm/detail/func_geometric.hpp | 4 +- glm/gtx/fast_square_root.inl | 13 +++-- 3 files changed, 49 insertions(+), 59 deletions(-) diff --git a/glm/detail/func_exponential.inl b/glm/detail/func_exponential.inl index 9c03129e..c6d59e62 100644 --- a/glm/detail/func_exponential.inl +++ b/glm/detail/func_exponential.inl @@ -153,68 +153,53 @@ namespace detail VECTORIZE_VEC(sqrt) - template - GLM_FUNC_QUALIFIER genType inversesqrt - ( - genType const & x - ) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559, - "'inversesqrt' only accept floating-point inputs"); - - assert(x > genType(0)); - - return genType(1) / std::sqrt(x); - } - - VECTORIZE_VEC(inversesqrt) - namespace detail { - template - genType fastInversesqrt(genType const & v) + template