@@ -154,14 +154,17 @@ namespace xsimd
154
154
return avg(self, other, common {});
155
155
}
156
156
}
157
+ #endif
157
158
158
159
// batch_bool_cast
159
160
template <class A , class T_out , class T_in >
160
- XSIMD_INLINE batch_bool<T_out, A> batch_bool_cast(batch_bool<T_in, A> const& self, batch_bool<T_out, A> const&, requires_arch<sse2 >) noexcept
161
+ XSIMD_INLINE batch_bool<T_out, A> batch_bool_cast (batch_bool<T_in, A> const & self, batch_bool<T_out, A> const &, requires_arch<altivec >) noexcept
161
162
{
162
163
return { bitwise_cast<T_out>(batch<T_in, A>(self.data )).data };
163
164
}
164
165
166
+ #endif
167
+
165
168
// bitwise_and
166
169
template <class A >
167
170
XSIMD_INLINE batch<float , A> bitwise_and (batch<float , A> const & self, batch<float , A> const & other, requires_arch<sse2>) noexcept
@@ -417,44 +420,17 @@ namespace xsimd
417
420
{
418
421
return _mm_xor_si128 (self, other);
419
422
}
423
+ #endif
420
424
421
425
// bitwise_cast
422
- template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
423
- XSIMD_INLINE batch<float, A> bitwise_cast(batch<T, A> const& self, batch<float, A> const&, requires_arch<sse2>) noexcept
424
- {
425
- return _mm_castsi128_ps(self);
426
- }
427
- template <class A, class T, class Tp, class = typename std::enable_if<std::is_integral<typename std::common_type<T, Tp>::type>::value, void>::type>
428
- XSIMD_INLINE batch<Tp, A> bitwise_cast(batch<T, A> const& self, batch<Tp, A> const&, requires_arch<sse2>) noexcept
429
- {
430
- return batch<Tp, A>(self.data);
431
- }
432
- template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
433
- XSIMD_INLINE batch<T, A> bitwise_cast(batch<float, A> const& self, batch<T, A> const&, requires_arch<sse2>) noexcept
434
- {
435
- return _mm_castps_si128(self);
436
- }
437
- template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
438
- XSIMD_INLINE batch<double, A> bitwise_cast(batch<T, A> const& self, batch<double, A> const&, requires_arch<sse2>) noexcept
439
- {
440
- return _mm_castsi128_pd(self);
441
- }
442
- template <class A>
443
- XSIMD_INLINE batch<double, A> bitwise_cast(batch<float, A> const& self, batch<double, A> const&, requires_arch<sse2>) noexcept
444
- {
445
- return _mm_castps_pd(self);
446
- }
447
- template <class A>
448
- XSIMD_INLINE batch<float, A> bitwise_cast(batch<double, A> const& self, batch<float, A> const&, requires_arch<sse2>) noexcept
449
- {
450
- return _mm_castpd_ps(self);
451
- }
452
- template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
453
- XSIMD_INLINE batch<T, A> bitwise_cast(batch<double, A> const& self, batch<T, A> const&, requires_arch<sse2>) noexcept
426
+ template <class A , class T_in , class T_out >
427
+ XSIMD_INLINE batch<T_out, A> bitwise_cast (batch<T_in, A> const & self, batch<T_out, A> const &, requires_arch<sse2>) noexcept
454
428
{
455
- return _mm_castpd_si128( self);
429
+ return * reinterpret_cast < typename batch<T_out, A>::register_type const *>(& self. data );
456
430
}
457
431
432
+ #if 0
433
+
458
434
// broadcast
459
435
template <class A>
460
436
batch<float, A> XSIMD_INLINE broadcast(float val, requires_arch<sse2>) noexcept
0 commit comments