Skip to content

Commit

Permalink
Added fma implementation based on std::fma #969
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed Nov 6, 2019
1 parent 338bdea commit 95b1cdb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions glm/detail/func_common.inl
Original file line number Diff line number Diff line change
Expand Up @@ -737,11 +737,15 @@ namespace detail
return reinterpret_cast<vec<L, float, Q>&>(const_cast<vec<L, uint, Q>&>(v));
}

template<typename genType>
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<typename genType>
GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c)
{
return a * b + c;
}
# endif

template<typename genType>
GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp)
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95b1cdb

Please sign in to comment.