@@ -154,14 +154,17 @@ namespace xsimd
154154 return avg(self, other, common {});
155155 }
156156 }
157+ #endif
157158
158159 // batch_bool_cast
159160 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
161162 {
162163 return { bitwise_cast<T_out>(batch<T_in, A>(self.data )).data };
163164 }
164165
166+ #endif
167+
165168 // bitwise_and
166169 template <class A >
167170 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
417420 {
418421 return _mm_xor_si128 (self, other);
419422 }
423+ #endif
420424
421425 // 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
454428 {
455- return _mm_castpd_si128( self);
429+ return * reinterpret_cast < typename batch<T_out, A>::register_type const *>(& self. data );
456430 }
457431
432+ #if 0
433+
458434 // broadcast
459435 template <class A>
460436 batch<float, A> XSIMD_INLINE broadcast(float val, requires_arch<sse2>) noexcept
0 commit comments