You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/xsimd/arch/generic/xsimd_generic_arithmetic.hpp
+19-5Lines changed: 19 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,13 @@ namespace xsimd
50
50
return self - T(1);
51
51
}
52
52
53
+
// decr_if
54
+
template <classA, classT, classMask>
55
+
inline batch<T, A> decr_if(batch<T, A> const& self, Mask const& mask, requires_arch<generic>) noexcept
56
+
{
57
+
returnselect(mask, decr(self), self);
58
+
}
59
+
53
60
// div
54
61
template <classA, classT, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
55
62
inline batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) noexcept
@@ -111,19 +118,26 @@ namespace xsimd
111
118
return -x * y - z;
112
119
}
113
120
121
+
template <classA, classT>
122
+
inline batch<std::complex<T>, A> fnms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) noexcept
123
+
{
124
+
auto res_r = -fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
125
+
auto res_i = -fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
126
+
return { res_r, res_i };
127
+
}
128
+
114
129
// incr
115
130
template <classA, classT>
116
131
inline batch<T, A> incr(batch<T, A> const& self, requires_arch<generic>) noexcept
117
132
{
118
133
return self + T(1);
119
134
}
120
135
121
-
template <classA, classT>
122
-
inline batch<std::complex<T>, A> fnms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) noexcept
136
+
// incr_if
137
+
template <classA, classT, classMask>
138
+
inline batch<T, A> incr_if(batch<T, A> const& self, Mask const& mask, requires_arch<generic>) noexcept
123
139
{
124
-
auto res_r = -fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
125
-
auto res_i = -fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
0 commit comments