Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions include/xsimd/arch/common/xsimd_common_arithmetic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ namespace xsimd
using namespace types;

// bitwise_lshift
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value>::type*/>
XSIMD_INLINE batch<T, A> bitwise_lshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
return detail::apply([](T x, T y) noexcept
{ return x << y; },
self, other);
}
template <size_t shift, class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
template <size_t shift, class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value>::type*/>
XSIMD_INLINE batch<T, A> bitwise_lshift(batch<T, A> const& self, requires_arch<common>) noexcept
{
constexpr auto bits = std::numeric_limits<T>::digits + std::numeric_limits<T>::is_signed;
Expand All @@ -43,14 +43,14 @@ namespace xsimd
}

// bitwise_rshift
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value>::type*/>
XSIMD_INLINE batch<T, A> bitwise_rshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
return detail::apply([](T x, T y) noexcept
{ return x >> y; },
self, other);
}
template <size_t shift, class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
template <size_t shift, class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value>::type*/>
XSIMD_INLINE batch<T, A> bitwise_rshift(batch<T, A> const& self, requires_arch<common>) noexcept
{
constexpr auto bits = std::numeric_limits<T>::digits + std::numeric_limits<T>::is_signed;
Expand All @@ -73,7 +73,7 @@ namespace xsimd
}

// div
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
return detail::apply([](T x, T y) noexcept -> T
Expand Down Expand Up @@ -168,7 +168,7 @@ namespace xsimd
}

// mul
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value>::type*/>
XSIMD_INLINE batch<T, A> mul(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
return detail::apply([](T x, T y) noexcept -> T
Expand Down Expand Up @@ -212,7 +212,7 @@ namespace xsimd
{
return add(self, other); // no saturated arithmetic on floating point numbers
}
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value>::type*/>
XSIMD_INLINE batch<T, A> sadd(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
if (std::is_signed<T>::value)
Expand Down Expand Up @@ -240,7 +240,7 @@ namespace xsimd
{
return sub(self, other); // no saturated arithmetic on floating point numbers
}
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value>::type*/>
XSIMD_INLINE batch<T, A> ssub(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
if (std::is_signed<T>::value)
Expand Down
4 changes: 2 additions & 2 deletions include/xsimd/arch/common/xsimd_common_details.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace xsimd

// Provide a common uint32_t -> float cast only if we have a
// non-common int32_t -> float fast_cast
template <class A, class _ = decltype(fast_cast(std::declval<batch<int32_t, A> const&>(), std::declval<batch<float, A> const&>(), A {}))>
template <class A, class = decltype(fast_cast(std::declval<batch<int32_t, A> const&>(), std::declval<batch<float, A> const&>(), A {}))>
XSIMD_INLINE batch<float, A> fast_cast(batch<uint32_t, A> const& v, batch<float, A> const&, requires_arch<common>) noexcept
{
// see https://stackoverflow.com/questions/34066228/how-to-perform-uint32-float-conversion-with-sse
Expand All @@ -207,7 +207,7 @@ namespace xsimd

// Provide a common float -> uint32_t cast only if we have a
// non-common float -> int32_t fast_cast
template <class A, class _ = decltype(fast_cast(std::declval<batch<float, A> const&>(), std::declval<batch<int32_t, A> const&>(), A {}))>
template <class A, class = decltype(fast_cast(std::declval<batch<float, A> const&>(), std::declval<batch<int32_t, A> const&>(), A {}))>
XSIMD_INLINE batch<uint32_t, A> fast_cast(batch<float, A> const& v, batch<uint32_t, A> const&, requires_arch<common>) noexcept
{
auto is_large = v >= batch<float, A>(1u << 31);
Expand Down
8 changes: 4 additions & 4 deletions include/xsimd/arch/common/xsimd_common_logical.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace xsimd
}

// isinf
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch_bool<T, A> isinf(batch<T, A> const&, requires_arch<common>) noexcept
{
return batch_bool<T, A>(false);
Expand All @@ -143,7 +143,7 @@ namespace xsimd
}

// isfinite
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch_bool<T, A> isfinite(batch<T, A> const&, requires_arch<common>) noexcept
{
return batch_bool<T, A>(true);
Expand All @@ -160,14 +160,14 @@ namespace xsimd
}

// isnan
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch_bool<T, A> isnan(batch<T, A> const&, requires_arch<common>) noexcept
{
return batch_bool<T, A>(false);
}

// le
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch_bool<T, A> le(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
return (self < other) || (self == other);
Expand Down
20 changes: 10 additions & 10 deletions include/xsimd/arch/common/xsimd_common_math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ namespace xsimd
}

// copysign
template <class A, class T, class _ = typename std::enable_if<std::is_floating_point<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_floating_point<T>::value>::type>
XSIMD_INLINE batch<T, A> copysign(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
return abs(self) | bitofsign(other);
Expand Down Expand Up @@ -1877,7 +1877,7 @@ namespace xsimd
}

// mod
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> mod(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
return detail::apply([](T x, T y) noexcept -> T
Expand All @@ -1886,7 +1886,7 @@ namespace xsimd
}

// nearbyint
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> nearbyint(batch<T, A> const& self, requires_arch<common>) noexcept
{
return self;
Expand Down Expand Up @@ -1926,7 +1926,7 @@ namespace xsimd
}

// nearbyint_as_int
template <class T, class A, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class T, class A, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> nearbyint_as_int(batch<T, A> const& self, requires_arch<common>) noexcept
{
return self;
Expand Down Expand Up @@ -2088,7 +2088,7 @@ namespace xsimd
}

// reciprocal
template <class T, class A, class = typename std::enable_if<std::is_floating_point<T>::value, void>::type>
template <class T, class A, class = typename std::enable_if<std::is_floating_point<T>::value>::type>
XSIMD_INLINE batch<T, A> reciprocal(batch<T, A> const& self,
requires_arch<common>) noexcept
{
Expand All @@ -2103,7 +2103,7 @@ namespace xsimd
return { reduce_add(self.real()), reduce_add(self.imag()) };
}

template <class A, class T, class /*=typename std::enable_if<std::is_scalar<T>::value, void>::type*/>
template <class A, class T, class /*=typename std::enable_if<std::is_scalar<T>::value>::type*/>
XSIMD_INLINE T reduce_add(batch<T, A> const& self, requires_arch<common>) noexcept
{
alignas(A::alignment()) T buffer[batch<T, A>::size];
Expand Down Expand Up @@ -2175,7 +2175,7 @@ namespace xsimd
return res;
}

template <class A, class T, class /*=typename std::enable_if<std::is_scalar<T>::value, void>::type*/>
template <class A, class T, class /*=typename std::enable_if<std::is_scalar<T>::value>::type*/>
XSIMD_INLINE T reduce_mul(batch<T, A> const& self, requires_arch<common>) noexcept
{
alignas(A::alignment()) T buffer[batch<T, A>::size];
Expand All @@ -2199,7 +2199,7 @@ namespace xsimd
{
return fnma(nearbyint(self / other), other, self);
}
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> remainder(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
{
auto mod = self % other;
Expand All @@ -2214,7 +2214,7 @@ namespace xsimd
}

// sign
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> sign(batch<T, A> const& self, requires_arch<common>) noexcept
{
using batch_type = batch<T, A>;
Expand Down Expand Up @@ -2260,7 +2260,7 @@ namespace xsimd
}

// signnz
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> signnz(batch<T, A> const& self, requires_arch<common>) noexcept
{
using batch_type = batch<T, A>;
Expand Down
4 changes: 2 additions & 2 deletions include/xsimd/arch/common/xsimd_common_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ namespace xsimd
}

// transpose
template <class A, class = typename std::enable_if<batch<int16_t, A>::size == 8, void>::type>
template <class A, class = typename std::enable_if<batch<int16_t, A>::size == 8>::type>
XSIMD_INLINE void transpose(batch<int16_t, A>* matrix_begin, batch<int16_t, A>* matrix_end, requires_arch<common>) noexcept
{
assert((matrix_end - matrix_begin == batch<int16_t, A>::size) && "correctly sized matrix");
Expand Down Expand Up @@ -783,7 +783,7 @@ namespace xsimd
transpose(reinterpret_cast<batch<int16_t, A>*>(matrix_begin), reinterpret_cast<batch<int16_t, A>*>(matrix_end), A {});
}

template <class A, class = typename std::enable_if<batch<int8_t, A>::size == 16, void>::type>
template <class A, class = typename std::enable_if<batch<int8_t, A>::size == 16>::type>
XSIMD_INLINE void transpose(batch<int8_t, A>* matrix_begin, batch<int8_t, A>* matrix_end, requires_arch<common>) noexcept
{
assert((matrix_end - matrix_begin == batch<int8_t, A>::size) && "correctly sized matrix");
Expand Down
2 changes: 1 addition & 1 deletion include/xsimd/arch/common/xsimd_common_rounding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace xsimd
}

// trunc
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A> trunc(batch<T, A> const& self, requires_arch<common>) noexcept
{
return self;
Expand Down
2 changes: 1 addition & 1 deletion include/xsimd/arch/common/xsimd_common_trigo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace xsimd
*/
namespace detail
{
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
XSIMD_INLINE batch<T, A>
average(const batch<T, A>& x1, const batch<T, A>& x2) noexcept
{
Expand Down
Loading
Loading