kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit d49956cbd412b662143411da98547ee48844368f
parent db9f526b221f120472815cdf5a3446e9fb0445ba
Author: [email protected] <[email protected]>
Date:   Tue,  9 Aug 2016 05:24:49 +0300

atan2: use mask instead of vec

Diffstat:
Minclude/kfr/base/atan.hpp | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/kfr/base/atan.hpp b/include/kfr/base/atan.hpp @@ -67,7 +67,7 @@ KFR_SINTRIN vec<f64, N> atan2k(vec<f64, N> y, vec<f64, N> x) vec<i64, N> q; q = select(x < 0, -2ll, 0ll); x = select(x < 0, -x, x); - vec<i64, N> m; + mask<i64, N> m; m = y > x; t = x; x = select(m, y, x); @@ -122,8 +122,8 @@ KFR_SINTRIN vec<f64, N> atan2(const vec<f64, N>& y, const vec<f64, N>& x) constexpr f64 pi_over_2 = 1.5707963267948966192313216916398; constexpr f64 pi_over_4 = 0.78539816339744830961566084581988; r = mulsign(r, x); - r = select(isinf(x) || x == 0.0, pi_over_2 - select(x, mulsign(pi_over_2, x), 0.0), r); - r = select(isinf(y), pi_over_2 - select(x, mulsign(pi_over_4, x), 0.0), r); + r = select(isinf(x) || x == 0.0, pi_over_2 - select(x.asmask(), mulsign(pi_over_2, x), 0.0), r); + r = select(isinf(y), pi_over_2 - select(x.asmask(), mulsign(pi_over_4, x), 0.0), r); r = select(y == 0.0, fbitcast(ibitcast(x < 0) & ibitcast(pi)), r); r = fbitcast(ibitcast(isnan(x) || isnan(y)) | ibitcast(mulsign(r, y))); return r;