From 80d472d7531d541d953adf94228e0555f38296fe Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 10 Sep 2013 14:22:35 -0400 Subject: Introduce mad(), as low-accuracy version of fma() --- vec_builtin.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vec_builtin.h') diff --git a/vec_builtin.h b/vec_builtin.h index decab46..a9a87cb 100644 --- a/vec_builtin.h +++ b/vec_builtin.h @@ -686,6 +686,10 @@ namespace vecmathlib { realvec_t log10() const { return map(builtin_log10); } realvec_t log1p() const { return map(builtin_log1p); } realvec_t log2() const { return map(builtin_log2); } + realvec_t mad(realvec_t y, realvec_t z) const + { + return MF::vml_mad(*this, y, z); + } realvec_t nextafter(realvec_t y) const { return map(builtin_nextafter, y); } realvec_t pow(realvec_t y) const { return map(builtin_pow, y); } realvec_t rcp() const { return RV(1.0) / *this; } @@ -1294,6 +1298,14 @@ namespace vecmathlib { } template + inline realbuiltinvec mad(realbuiltinvec x, + realbuiltinvec y, + realbuiltinvec z) + { + return x.mad(y, z); + } + + template inline realbuiltinvec nextafter(realbuiltinvec x, realbuiltinvec y) { -- cgit v1.1