Skip to content

Commit ed35a6a

Browse files
Ship full version of xsimd_scalar
1 parent 4decfbd commit ed35a6a

File tree

2 files changed

+465
-19
lines changed

2 files changed

+465
-19
lines changed

include/xsimd/arch/generic/xsimd_generic_math.hpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "./xsimd_generic_details.hpp"
55
#include "./xsimd_generic_trigo.hpp"
6+
#include "../xsimd_scalar.hpp"
67

78

89
namespace xsimd {
@@ -958,25 +959,7 @@ namespace xsimd {
958959

959960
// ipow
960961
template<class A, class T, class ITy> batch<T, A> ipow(batch<T, A> const& self, ITy other, requires_arch<generic>) {
961-
static_assert(std::is_integral<ITy>::value, "second argument must be an integer");
962-
batch<T, A> a = self;
963-
ITy b = other;
964-
bool const recip = b < 0;
965-
batch<T, A> r(static_cast<T>(1));
966-
while (1)
967-
{
968-
if (b & 1)
969-
{
970-
r *= a;
971-
}
972-
b /= 2;
973-
if (b == 0)
974-
{
975-
break;
976-
}
977-
a *= a;
978-
}
979-
return recip ? 1 / r : r;
962+
return ::xsimd::detail::ipow(self, other);
980963
}
981964

982965

0 commit comments

Comments
 (0)