diff options
Diffstat (limited to 'vec_builtin.h')
-rw-r--r-- | vec_builtin.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vec_builtin.h b/vec_builtin.h index a9a87cb..d8a8a45 100644 --- a/vec_builtin.h +++ b/vec_builtin.h @@ -686,6 +686,15 @@ 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); } + intvec_t lrint() const + { + if (sizeof(int_t) <= sizeof(long)) { + return map(builtin_lrint); + } else if (sizeof(int_t) <= sizeof(long long)) { + return map(builtin_llrint); + } + __builtin_unreachable(); + } realvec_t mad(realvec_t y, realvec_t z) const { return MF::vml_mad(*this, y, z); @@ -1298,6 +1307,12 @@ namespace vecmathlib { } template<typename real_t, int size> + inline intbuiltinvec<real_t, size> lrint(realbuiltinvec<real_t, size> x) + { + return x.lrint(); + } + + template<typename real_t, int size> inline realbuiltinvec<real_t, size> mad(realbuiltinvec<real_t, size> x, realbuiltinvec<real_t, size> y, realbuiltinvec<real_t, size> z) |