diff options
author | eschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a> | 2013-01-18 22:45:50 +0000 |
---|---|---|
committer | eschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a> | 2013-01-18 22:45:50 +0000 |
commit | 8a908ac6b1ee28850827530d0d007eb62dfce348 (patch) | |
tree | 548c5fc0aa7ae9006496dd13497d65ac43923a3e | |
parent | f4e59032c42c1df52717d2663760072cd0510f30 (diff) |
Provide C++ wrapper for madd (multiply-add)
git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/Vectors/trunk@78 105869f7-3296-0410-a4ea-f4349344b45a
-rw-r--r-- | src/vectors.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vectors.h b/src/vectors.h index 08b9f91..8ed8528 100644 --- a/src/vectors.h +++ b/src/vectors.h @@ -297,6 +297,11 @@ struct vecprops { { return x/y; } + static inline CCTK_ATTRIBUTE_ALWAYS_INLINE + vector_t madd (vector_t const& x, vector_t const& y, vector_t const& z) + { + return x*y+z; + } }; template<> @@ -348,6 +353,11 @@ struct vecprops<CCTK_REAL4> { { return k4div(x,y); } + static inline CCTK_ATTRIBUTE_ALWAYS_INLINE + vector_t madd (vector_t const& x, vector_t const& y, vector_t const& z) + { + return k4madd(x,y,z); + } }; template<> @@ -399,6 +409,11 @@ struct vecprops<CCTK_REAL8> { { return k8div(x,y); } + static inline CCTK_ATTRIBUTE_ALWAYS_INLINE + vector_t madd (vector_t const& x, vector_t const& y, vector_t const& z) + { + return k8madd(x,y,z); + } }; template<typename T> |