commit 6184c8f248e566058de89513a77b117283809b38 parent 374e2c03d0d1b6032624c5e7ec073608a35256f1 Author: d.levin256@gmail.com <d.levin256@gmail.com> Date: Sat, 30 Jul 2016 23:11:24 +0300 Construct function wrapper Diffstat:
26 files changed, 145 insertions(+), 139 deletions(-)
diff --git a/include/kfr/base/abs.hpp b/include/kfr/base/abs.hpp @@ -85,6 +85,6 @@ KFR_INTRIN T1 abs(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::abs, E1> abs(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::abs(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/asin_acos.hpp b/include/kfr/base/asin_acos.hpp @@ -61,7 +61,7 @@ KFR_INTRIN flt_type<T1> asin(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::asin, E1> asin(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::asin(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -73,6 +73,6 @@ KFR_INTRIN flt_type<T1> acos(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::acos, E1> acos(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::acos(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/atan.hpp b/include/kfr/base/atan.hpp @@ -217,7 +217,7 @@ KFR_INTRIN ftype<T1> atan(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::atan, E1> atan(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::atan(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -229,7 +229,7 @@ KFR_INTRIN ftype<T1> atandeg(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::atandeg, E1> atandeg(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::atandeg(), std::forward<E1>(x) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> @@ -241,7 +241,7 @@ KFR_INTRIN common_type<T1, T2> atan2(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::atan2, E1, E2> atan2(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::atan2(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> @@ -253,6 +253,6 @@ KFR_INTRIN common_type<T1, T2> atan2deg(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::atan2deg, E1, E2> atan2deg(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::atan2deg(), std::forward<E1>(x), std::forward<E2>(y) }; } } diff --git a/include/kfr/base/clamp.hpp b/include/kfr/base/clamp.hpp @@ -54,7 +54,7 @@ KFR_INTRIN Tout clamp(const T1& x, const T2& lo, const T3& hi) template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)> KFR_INTRIN expr_func<fn::clamp, E1, E2, E3> clamp(E1&& x, E2&& lo, E3&& hi) { - return { {}, std::forward<E1>(x), std::forward<E2>(lo), std::forward<E3>(hi) }; + return { fn::clamp(), std::forward<E1>(x), std::forward<E2>(lo), std::forward<E3>(hi) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), @@ -67,6 +67,6 @@ KFR_INTRIN Tout clamp(const T1& x, const T2& hi) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::clamp, E1, E2> clamp(E1&& x, E2&& hi) { - return { {}, std::forward<E1>(x), std::forward<E2>(hi) }; + return { fn::clamp(), std::forward<E1>(x), std::forward<E2>(hi) }; } } diff --git a/include/kfr/base/complex.hpp b/include/kfr/base/complex.hpp @@ -440,7 +440,7 @@ KFR_INTRIN T1 csin(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::csin, E1> csin(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::csin(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 csinh(const T1& x) @@ -450,7 +450,7 @@ KFR_INTRIN T1 csinh(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::csinh, E1> csinh(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::csinh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 ccos(const T1& x) @@ -460,7 +460,7 @@ KFR_INTRIN T1 ccos(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::ccos, E1> ccos(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::ccos(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 ccosh(const T1& x) @@ -470,7 +470,7 @@ KFR_INTRIN T1 ccosh(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::ccosh, E1> ccosh(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::ccosh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN realtype<T1> cabs(const T1& x) @@ -480,7 +480,7 @@ KFR_INTRIN realtype<T1> cabs(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cabs, E1> cabs(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cabs(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN realtype<T1> carg(const T1& x) @@ -490,7 +490,7 @@ KFR_INTRIN realtype<T1> carg(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::carg, E1> carg(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::carg(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 clog(const T1& x) @@ -500,7 +500,7 @@ KFR_INTRIN T1 clog(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::clog, E1> clog(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::clog(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 clog2(const T1& x) @@ -510,7 +510,7 @@ KFR_INTRIN T1 clog2(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::clog2, E1> clog2(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::clog2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 clog10(const T1& x) @@ -520,7 +520,7 @@ KFR_INTRIN T1 clog10(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::clog10, E1> clog10(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::clog10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 cexp(const T1& x) @@ -530,7 +530,7 @@ KFR_INTRIN T1 cexp(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cexp, E1> cexp(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cexp(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 cexp2(const T1& x) @@ -540,7 +540,7 @@ KFR_INTRIN T1 cexp2(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cexp2, E1> cexp2(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cexp2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 cexp10(const T1& x) @@ -550,7 +550,7 @@ KFR_INTRIN T1 cexp10(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cexp10, E1> cexp10(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cexp10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 polar(const T1& x) @@ -560,7 +560,7 @@ KFR_INTRIN T1 polar(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::polar, E1> polar(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::polar(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 cartesian(const T1& x) @@ -570,7 +570,7 @@ KFR_INTRIN T1 cartesian(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cartesian, E1> cartesian(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cartesian(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 csqrt(const T1& x) @@ -580,6 +580,6 @@ KFR_INTRIN T1 csqrt(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::csqrt, E1> csqrt(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::csqrt(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/expression.hpp b/include/kfr/base/expression.hpp @@ -110,7 +110,7 @@ private: { using ratio = func_ratio<Fn>; constexpr size_t Nin = N * ratio::input / ratio::output; - using Tout = conditional<is_same<generic, value_type>::value, T, common_type<T, value_type>>; + using Tout = conditional<is_same<generic, value_type>::value, T, common_type<T, value_type>>; return cast<T>(fn(cast<Tout>(std::get<indices>(this->args)( cinput, index * ratio::input / ratio::output, vec_t_for<Args, Nin, Tout>()))...)); diff --git a/include/kfr/base/gamma.hpp b/include/kfr/base/gamma.hpp @@ -73,7 +73,7 @@ KFR_INTRIN T1 gamma(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::gamma, E1> gamma(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::gamma(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -85,7 +85,7 @@ KFR_INTRIN T1 factorial_approx(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::factorial_approx, E1> factorial_approx(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::factorial_approx(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/hyperbolic.hpp b/include/kfr/base/hyperbolic.hpp @@ -100,7 +100,7 @@ KFR_INTRIN T1 sinh(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sinh, E1> sinh(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sinh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -112,7 +112,7 @@ KFR_INTRIN T1 cosh(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cosh, E1> cosh(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cosh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -124,7 +124,7 @@ KFR_INTRIN T1 tanh(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::tanh, E1> tanh(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::tanh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -136,7 +136,7 @@ KFR_INTRIN T1 coth(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::coth, E1> coth(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::coth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -148,7 +148,7 @@ KFR_INTRIN T1 sinhcosh(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sinhcosh, E1> sinhcosh(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sinhcosh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -160,6 +160,6 @@ KFR_INTRIN T1 coshsinh(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::coshsinh, E1> coshsinh(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::coshsinh(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/log_exp.hpp b/include/kfr/base/log_exp.hpp @@ -347,7 +347,7 @@ KFR_INTRIN T1 exp(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::exp, E1> exp(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::exp(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -359,7 +359,7 @@ KFR_INTRIN T1 exp2(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::exp2, E1> exp2(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::exp2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -371,7 +371,7 @@ KFR_INTRIN T1 exp10(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::exp10, E1> exp10(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::exp10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -383,7 +383,7 @@ KFR_INTRIN T1 log(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::log, E1> log(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::log(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -395,7 +395,7 @@ KFR_INTRIN T1 log2(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::log2, E1> log2(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::log2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -407,7 +407,7 @@ KFR_INTRIN T1 log10(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::log10, E1> log10(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::log10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -419,7 +419,7 @@ KFR_INTRIN T1 logb(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::logb, E1> logb(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::logb(), std::forward<E1>(x) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> @@ -431,7 +431,7 @@ KFR_INTRIN common_type<T1, T2> logn(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::logn, E1, E2> logn(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::logn(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> @@ -443,7 +443,7 @@ KFR_INTRIN common_type<T1, T2> logm(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::logm, E1, E2> logm(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::logm(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value)> @@ -455,7 +455,7 @@ KFR_INTRIN common_type<T1, T2, T3> exp_fmadd(const T1& x, const T2& y, const T3& template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)> KFR_INTRIN expr_func<fn::exp_fmadd, E1, E2, E3> exp_fmadd(E1&& x, E2&& y, E3&& z) { - return { {}, std::forward<E1>(x), std::forward<E2>(y), std::forward<E3>(z) }; + return { fn::exp_fmadd(), std::forward<E1>(x), std::forward<E2>(y), std::forward<E3>(z) }; } template <typename T1, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value)> @@ -467,7 +467,7 @@ KFR_INTRIN common_type<T1, T2, T3> log_fmadd(const T1& x, const T2& y, const T3& template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)> KFR_INTRIN expr_func<fn::log_fmadd, E1, E2, E3> log_fmadd(E1&& x, E2&& y, E3&& z) { - return { {}, std::forward<E1>(x), std::forward<E2>(y), std::forward<E3>(z) }; + return { fn::log_fmadd(), std::forward<E1>(x), std::forward<E2>(y), std::forward<E3>(z) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> @@ -479,7 +479,7 @@ KFR_INTRIN common_type<T1, T2> pow(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::pow, E1, E2> pow(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::pow(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> @@ -491,7 +491,7 @@ KFR_INTRIN common_type<T1, T2> root(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::root, E1, E2> root(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::root(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -503,6 +503,6 @@ KFR_INTRIN T1 cbrt(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cbrt, E1> cbrt(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cbrt(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/memory.hpp b/include/kfr/base/memory.hpp @@ -194,6 +194,7 @@ struct aligned_new }; #define KFR_CLASS_REFCOUNT(cl) \ + \ public: \ void addref() const { m_refcount++; } \ void release() const \ @@ -203,7 +204,7 @@ public: delete this; \ } \ } \ - \ + \ private: \ mutable std::atomic_uintptr_t m_refcount = ATOMIC_VAR_INIT(0); } diff --git a/include/kfr/base/min_max.hpp b/include/kfr/base/min_max.hpp @@ -173,7 +173,7 @@ KFR_INTRIN Tout min(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::min, E1, E2> min(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::min(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), @@ -186,7 +186,7 @@ KFR_INTRIN Tout max(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::max, E1, E2> max(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::max(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), @@ -199,7 +199,7 @@ KFR_INTRIN Tout absmin(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::absmin, E1, E2> absmin(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::absmin(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), @@ -212,6 +212,6 @@ KFR_INTRIN Tout absmax(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::absmax, E1, E2> absmax(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::absmax(), std::forward<E1>(x), std::forward<E2>(y) }; } } diff --git a/include/kfr/base/modzerobessel.hpp b/include/kfr/base/modzerobessel.hpp @@ -106,7 +106,7 @@ KFR_INTRIN T1 modzerobessel(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::modzerobessel, E1> modzerobessel(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::modzerobessel(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/read_write.hpp b/include/kfr/base/read_write.hpp @@ -109,7 +109,8 @@ KFR_INLINE vec<T, N * groupsize> gather(const T* base, const vec<IT, N>& offset) } template <size_t groupsize, typename T, size_t N, size_t Nout = N* groupsize, typename IT, size_t... Indices> -KFR_INLINE void scatter_helper(T* base, const vec<IT, N>& offset, const vec<T, Nout>& value, csizes_t<Indices...>) +KFR_INLINE void scatter_helper(T* base, const vec<IT, N>& offset, const vec<T, Nout>& value, + csizes_t<Indices...>) { swallow{ (write(base + groupsize * (*offset)[Indices], slice<Indices * groupsize, groupsize>(value)), 0)... }; diff --git a/include/kfr/base/round.hpp b/include/kfr/base/round.hpp @@ -220,7 +220,7 @@ KFR_INTRIN T1 floor(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::floor, E1> floor(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::floor(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -232,7 +232,7 @@ KFR_INTRIN T1 ceil(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::ceil, E1> ceil(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::ceil(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -244,7 +244,7 @@ KFR_INTRIN T1 round(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::round, E1> round(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::round(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -256,7 +256,7 @@ KFR_INTRIN T1 trunc(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::trunc, E1> trunc(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::trunc(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -268,7 +268,7 @@ KFR_INTRIN T1 fract(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::fract, E1> fract(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::fract(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -280,7 +280,7 @@ KFR_INTRIN itype<T1> ifloor(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::ifloor, E1> ifloor(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::ifloor(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -292,7 +292,7 @@ KFR_INTRIN itype<T1> iceil(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::iceil, E1> iceil(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::iceil(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -304,7 +304,7 @@ KFR_INTRIN itype<T1> iround(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::iround, E1> iround(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::iround(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -316,7 +316,7 @@ KFR_INTRIN itype<T1> itrunc(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::itrunc, E1> itrunc(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::itrunc(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/saturation.hpp b/include/kfr/base/saturation.hpp @@ -142,7 +142,7 @@ KFR_INTRIN Tout satadd(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::satadd, E1, E2> satadd(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::satadd(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), @@ -155,6 +155,6 @@ KFR_INTRIN Tout satsub(const T1& x, const T2& y) template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> KFR_INTRIN expr_func<fn::satsub, E1, E2> satsub(E1&& x, E2&& y) { - return { {}, std::forward<E1>(x), std::forward<E2>(y) }; + return { fn::satsub(), std::forward<E1>(x), std::forward<E2>(y) }; } } diff --git a/include/kfr/base/select.hpp b/include/kfr/base/select.hpp @@ -153,6 +153,6 @@ KFR_INTRIN vec<Tout, N> select(const mask<T1, N>& m, const T2& x, const T3& y) template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)> KFR_INTRIN expr_func<fn::select, E1, E2, E3> select(E1&& m, E2&& x, E3&& y) { - return { {}, std::forward<E1>(m), std::forward<E2>(x), std::forward<E3>(y) }; + return { fn::select(), std::forward<E1>(m), std::forward<E2>(x), std::forward<E3>(y) }; } } diff --git a/include/kfr/base/shuffle.hpp b/include/kfr/base/shuffle.hpp @@ -221,7 +221,8 @@ struct shuffle_index_shuffle } template <size_t... Indices, typename T, size_t N> -KFR_INLINE vec<T, N> shuffle(const vec<T, N>& x, const vec<T, N>& y, elements_t<Indices...> = elements_t<Indices...>()) +KFR_INLINE vec<T, N> shuffle(const vec<T, N>& x, const vec<T, N>& y, + elements_t<Indices...> = elements_t<Indices...>()) { return shufflevector<N, internal::shuffle_index_shuffle<N, Indices...>>(x, y); } @@ -346,7 +347,8 @@ struct shuffle_index_blend } template <size_t... Indices, typename T, size_t N> -KFR_INLINE vec<T, N> blend(const vec<T, N>& x, const vec<T, N>& y, elements_t<Indices...> = elements_t<Indices...>()) +KFR_INLINE vec<T, N> blend(const vec<T, N>& x, const vec<T, N>& y, + elements_t<Indices...> = elements_t<Indices...>()) { return shufflevector<N, internal::shuffle_index_blend<N, Indices...>, 1>(x, y); } diff --git a/include/kfr/base/sin_cos.hpp b/include/kfr/base/sin_cos.hpp @@ -342,7 +342,7 @@ KFR_INTRIN ftype<T1> sin(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sin, E1> sin(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sin(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -354,7 +354,7 @@ KFR_INTRIN ftype<T1> cos(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cos, E1> cos(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cos(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -366,7 +366,7 @@ KFR_INTRIN ftype<T1> fastsin(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::fastsin, E1> fastsin(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::fastsin(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -378,7 +378,7 @@ KFR_INTRIN ftype<T1> fastcos(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::fastcos, E1> fastcos(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::fastcos(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -390,7 +390,7 @@ KFR_INTRIN ftype<T1> sincos(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sincos, E1> sincos(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sincos(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -402,7 +402,7 @@ KFR_INTRIN ftype<T1> cossin(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cossin, E1> cossin(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cossin(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -414,7 +414,7 @@ KFR_INTRIN ftype<T1> sinc(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sinc, E1> sinc(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sinc(), std::forward<E1>(x) }; } template <typename T> diff --git a/include/kfr/base/sqrt.hpp b/include/kfr/base/sqrt.hpp @@ -69,6 +69,6 @@ KFR_INTRIN flt_type<T1> sqrt(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sqrt, E1> sqrt(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sqrt(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/tan.hpp b/include/kfr/base/tan.hpp @@ -139,7 +139,7 @@ KFR_INTRIN T1 tan(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::tan, E1> tan(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::tan(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -151,6 +151,6 @@ KFR_INTRIN T1 tandeg(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::tandeg, E1> tandeg(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::tandeg(), std::forward<E1>(x) }; } } diff --git a/include/kfr/base/vec.hpp b/include/kfr/base/vec.hpp @@ -127,7 +127,8 @@ get_vec_index(int = 0) constexpr size_t index_undefined = static_cast<size_t>(-1); template <typename T, size_t N, size_t... Indices, KFR_ENABLE_IF(!is_compound<T>::value)> -KFR_INLINE vec<T, sizeof...(Indices)> shufflevector(csizes_t<Indices...>, const vec<T, N>& x, const vec<T, N>& y) +KFR_INLINE vec<T, sizeof...(Indices)> shufflevector(csizes_t<Indices...>, const vec<T, N>& x, + const vec<T, N>& y) { vec<T, sizeof...(Indices)> result = __builtin_shufflevector( *x, *y, static_cast<intptr_t>(Indices == index_undefined ? -1 : static_cast<intptr_t>(Indices))...); @@ -150,7 +151,8 @@ constexpr auto inflate(csize_t<groupsize>, csizes_t<indices...>) } template <typename T, size_t N, size_t... Indices, KFR_ENABLE_IF(is_compound<T>::value)> -KFR_INLINE vec<T, sizeof...(Indices)> shufflevector(csizes_t<Indices...> indices, const vec<T, N>& x, const vec<T, N>& y) +KFR_INLINE vec<T, sizeof...(Indices)> shufflevector(csizes_t<Indices...> indices, const vec<T, N>& x, + const vec<T, N>& y) { return subcast<T>( shufflevector(inflate(csize<widthof<T>()>, indices), subcast<subtype<T>>(x), subcast<subtype<T>>(y))); diff --git a/include/kfr/dft/fft.hpp b/include/kfr/dft/fft.hpp @@ -74,7 +74,7 @@ namespace internal template <size_t width, bool inverse, typename T> KFR_SINTRIN cvec<T, width> radix4_apply_twiddle(csize_t<width>, cfalse_t /*split_format*/, cbool_t<inverse>, - cvec<T, width> w, cvec<T, width> tw) + cvec<T, width> w, cvec<T, width> tw) { cvec<T, width> b1 = w * dupeven(tw); w = swap<2>(w); @@ -87,8 +87,8 @@ KFR_SINTRIN cvec<T, width> radix4_apply_twiddle(csize_t<width>, cfalse_t /*split template <size_t width, bool use_br2, bool inverse, bool aligned, typename T> KFR_SINTRIN void radix4_body(size_t N, csize_t<width>, cfalse_t, cfalse_t, cfalse_t, cbool_t<use_br2>, - cbool_t<inverse>, cbool_t<aligned>, complex<T>* out, const complex<T>* in, - const complex<T>* twiddle) + cbool_t<inverse>, cbool_t<aligned>, complex<T>* out, const complex<T>* in, + const complex<T>* twiddle) { const size_t N4 = N / 4; cvec<T, width> w1, w2, w3; @@ -134,7 +134,7 @@ KFR_SINTRIN void radix4_body(size_t N, csize_t<width>, cfalse_t, cfalse_t, cfals template <size_t width, bool inverse, typename T> KFR_SINTRIN cvec<T, width> radix4_apply_twiddle(csize_t<width>, ctrue_t /*split_format*/, cbool_t<inverse>, - cvec<T, width> w, cvec<T, width> tw) + cvec<T, width> w, cvec<T, width> tw) { vec<T, width> re1, im1, twre, twim; split(w, re1, im1); @@ -151,8 +151,8 @@ KFR_SINTRIN cvec<T, width> radix4_apply_twiddle(csize_t<width>, ctrue_t /*split_ template <size_t width, bool splitout, bool splitin, bool use_br2, bool inverse, bool aligned, typename T> KFR_SINTRIN void radix4_body(size_t N, csize_t<width>, ctrue_t, cbool_t<splitout>, cbool_t<splitin>, - cbool_t<use_br2>, cbool_t<inverse>, cbool_t<aligned>, complex<T>* out, - const complex<T>* in, const complex<T>* twiddle) + cbool_t<use_br2>, cbool_t<inverse>, cbool_t<aligned>, complex<T>* out, + const complex<T>* in, const complex<T>* twiddle) { const size_t N4 = N / 4; cvec<T, width> w1, w2, w3; @@ -223,7 +223,7 @@ KFR_NOINLINE cvec<T, 1> calculate_twiddle(size_t n, size_t size) template <typename T, size_t width> KFR_SINTRIN void initialize_twiddles_impl(complex<T>*& twiddle, size_t nn, size_t nnstep, size_t size, - bool split_format) + bool split_format) { vec<T, 2 * width> result = T(); KFR_LOOP_UNROLL @@ -282,8 +282,8 @@ KFR_SINTRIN void prefetch_four(size_t stride, const complex<T>* in) template <typename Ntype, size_t width, bool splitout, bool splitin, bool prefetch, bool use_br2, bool inverse, bool aligned, typename T> KFR_SINTRIN cfalse_t radix4_pass(Ntype N, size_t blocks, csize_t<width>, cbool_t<splitout>, cbool_t<splitin>, - cbool_t<use_br2>, cbool_t<prefetch>, cbool_t<inverse>, cbool_t<aligned>, - complex<T>* out, const complex<T>* in, const complex<T>*& twiddle) + cbool_t<use_br2>, cbool_t<prefetch>, cbool_t<inverse>, cbool_t<aligned>, + complex<T>* out, const complex<T>* in, const complex<T>*& twiddle) { constexpr static size_t prefetch_offset = width * 8; const auto N4 = N / csize<4>; @@ -502,10 +502,10 @@ protected: { radix4_pass(512, 1, csize<width>, ctrue, cbool<splitin>, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, in, twiddle); - radix4_pass(128, 4, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); - radix4_pass(32, 16, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); + radix4_pass(128, 4, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); + radix4_pass(32, 16, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); radix4_pass(csize<8>, 64, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); } @@ -514,8 +514,8 @@ protected: { radix4_pass(512, 1, csize<width>, ctrue, cbool<splitin>, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, in, twiddle); - radix4_pass(128, 4, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); + radix4_pass(128, 4, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); radix4_pass(csize<32>, 16, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); } @@ -524,12 +524,12 @@ protected: { radix4_pass(1024, 1, csize<width>, ctrue, cbool<splitin>, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, in, twiddle); - radix4_pass(256, 4, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); - radix4_pass(64, 16, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); - radix4_pass(16, 64, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); + radix4_pass(256, 4, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); + radix4_pass(64, 16, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); + radix4_pass(16, 64, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); radix4_pass(csize<4>, 256, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); } @@ -538,10 +538,10 @@ protected: { radix4_pass(1024, 1, csize<width>, ctrue, cbool<splitin>, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, in, twiddle); - radix4_pass(256, 4, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); - radix4_pass(64, 16, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); + radix4_pass(256, 4, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); + radix4_pass(64, 16, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); radix4_pass(csize<16>, 64, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); } @@ -689,18 +689,18 @@ protected: KFR_INTRIN void final_pass(csize_t<8>, complex<T>* out, const complex<T>* in, const complex<T>* twiddle) { - radix4_pass(128, 1, csize<width>, ctrue, cfalse, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, in, twiddle); - radix4_pass(32, 4, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); + radix4_pass(128, 1, csize<width>, ctrue, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, in, twiddle); + radix4_pass(32, 4, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); radix4_pass(csize<8>, 16, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); } KFR_INTRIN void final_pass(csize_t<32>, complex<T>* out, const complex<T>* in, const complex<T>* twiddle) { - radix4_pass(128, 1, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, in, twiddle); + radix4_pass(128, 1, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, in, twiddle); radix4_pass(csize<32>, 4, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); } @@ -775,12 +775,12 @@ protected: KFR_INTRIN void final_pass(csize_t<4>, complex<T>* out, const complex<T>* in, const complex<T>* twiddle) { - radix4_pass(256, 1, csize<width>, ctrue, cfalse, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, in, twiddle); + radix4_pass(256, 1, csize<width>, ctrue, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, in, twiddle); radix4_pass(64, 4, csize<width>, ctrue, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); - radix4_pass(16, 16, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, - cbool<inverse>, cbool<aligned>, out, out, twiddle); + radix4_pass(16, 16, csize<width>, cfalse, ctrue, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, + cbool<aligned>, out, out, twiddle); radix4_pass(csize<4>, 64, csize<width>, cfalse, cfalse, cbool<use_br2>, cbool<prefetch>, cbool<inverse>, cbool<aligned>, out, out, twiddle); } diff --git a/include/kfr/dsp/oscillators.hpp b/include/kfr/dsp/oscillators.hpp @@ -142,7 +142,7 @@ KFR_INTRIN T1 rawsine(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::rawsine, E1> rawsine(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::rawsine(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 sine(const T1& x) @@ -152,7 +152,7 @@ KFR_INTRIN T1 sine(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sine, E1> sine(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sine(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 sinenorm(const T1& x) @@ -162,7 +162,7 @@ KFR_INTRIN T1 sinenorm(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sinenorm, E1> sinenorm(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sinenorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 rawsquare(const T1& x) @@ -172,7 +172,7 @@ KFR_INTRIN T1 rawsquare(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::rawsquare, E1> rawsquare(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::rawsquare(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 square(const T1& x) @@ -182,7 +182,7 @@ KFR_INTRIN T1 square(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::square, E1> square(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::square(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 squarenorm(const T1& x) @@ -192,7 +192,7 @@ KFR_INTRIN T1 squarenorm(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::squarenorm, E1> squarenorm(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::squarenorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 rawtriangle(const T1& x) @@ -202,7 +202,7 @@ KFR_INTRIN T1 rawtriangle(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::rawtriangle, E1> rawtriangle(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::rawtriangle(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 triangle(const T1& x) @@ -212,7 +212,7 @@ KFR_INTRIN T1 triangle(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::triangle, E1> triangle(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::triangle(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 trianglenorm(const T1& x) @@ -222,7 +222,7 @@ KFR_INTRIN T1 trianglenorm(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::trianglenorm, E1> trianglenorm(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::trianglenorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 rawsawtooth(const T1& x) @@ -232,7 +232,7 @@ KFR_INTRIN T1 rawsawtooth(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::rawsawtooth, E1> rawsawtooth(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::rawsawtooth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 sawtooth(const T1& x) @@ -242,7 +242,7 @@ KFR_INTRIN T1 sawtooth(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sawtooth, E1> sawtooth(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sawtooth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 sawtoothnorm(const T1& x) @@ -252,7 +252,7 @@ KFR_INTRIN T1 sawtoothnorm(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::sawtoothnorm, E1> sawtoothnorm(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::sawtoothnorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 isawtooth(const T1& x) @@ -262,7 +262,7 @@ KFR_INTRIN T1 isawtooth(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::isawtooth, E1> isawtooth(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::isawtooth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> KFR_INTRIN T1 isawtoothnorm(const T1& x) @@ -272,6 +272,6 @@ KFR_INTRIN T1 isawtoothnorm(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::isawtoothnorm, E1> isawtoothnorm(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::isawtoothnorm(), std::forward<E1>(x) }; } } diff --git a/include/kfr/dsp/units.hpp b/include/kfr/dsp/units.hpp @@ -130,7 +130,7 @@ KFR_INTRIN T1 note_to_hertz(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::note_to_hertz, E1> note_to_hertz(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::note_to_hertz(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -142,7 +142,7 @@ KFR_INTRIN T1 hertz_to_note(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::hertz_to_note, E1> hertz_to_note(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::hertz_to_note(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -154,7 +154,7 @@ KFR_INTRIN T1 amp_to_dB(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::amp_to_dB, E1> amp_to_dB(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::amp_to_dB(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -166,7 +166,7 @@ KFR_INTRIN T1 dB_to_amp(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::dB_to_amp, E1> dB_to_amp(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::dB_to_amp(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -178,7 +178,7 @@ KFR_INTRIN T1 power_to_dB(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::power_to_dB, E1> power_to_dB(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::power_to_dB(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -190,6 +190,6 @@ KFR_INTRIN T1 dB_to_power(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::dB_to_power, E1> dB_to_power(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::dB_to_power(), std::forward<E1>(x) }; } } diff --git a/include/kfr/dsp/weighting.hpp b/include/kfr/dsp/weighting.hpp @@ -99,7 +99,7 @@ KFR_INTRIN T1 aweighting(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::aweighting, E1> aweighting(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::aweighting(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -111,7 +111,7 @@ KFR_INTRIN T1 bweighting(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::bweighting, E1> bweighting(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::bweighting(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> @@ -123,6 +123,6 @@ KFR_INTRIN T1 cweighting(const T1& x) template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> KFR_INTRIN expr_func<fn::cweighting, E1> cweighting(E1&& x) { - return { {}, std::forward<E1>(x) }; + return { fn::cweighting(), std::forward<E1>(x) }; } } diff --git a/include/kfr/expressions/generators.hpp b/include/kfr/expressions/generators.hpp @@ -35,7 +35,7 @@ namespace internal { template <typename T, size_t width_, typename Class> -struct generator: input_expression +struct generator : input_expression { constexpr static size_t width = width_; using type = T;