From 95b1cdbbfed628a49fd00c4ab18fd0e4f59b8e9f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 6 Nov 2019 10:56:44 +0100 Subject: [PATCH] Added fma implementation based on std::fma #969 --- glm/detail/func_common.inl | 14 +++++++++----- readme.md | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 85b9ae73..8a7681c4 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -737,11 +737,15 @@ namespace detail return reinterpret_cast&>(const_cast&>(v)); } - template - GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c) - { - return a * b + c; - } +# if GLM_HAS_CXX11_STL + using std::fma; +# else + template + GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c) + { + return a * b + c; + } +# endif template GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp) diff --git a/readme.md b/readme.md index 8440d5f5..f038fad2 100644 --- a/readme.md +++ b/readme.md @@ -57,6 +57,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate) #### Improvements: - Improved Neon support with more functions optimized #950 - Added CMake GLM interface #963 +- Added fma implementation based on std::fma #969 #### Fixes: - Fixed equal ULP variation when using negative sign #965