Skip to content

Commit 2d74bf4

Browse files
WIP
1 parent 540e0d2 commit 2d74bf4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

include/xsimd/arch/xsimd_altivec.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,14 @@ namespace xsimd
278278
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
279279
XSIMD_INLINE batch_bool<T, A> eq(batch<T, A> const& self, batch<T, A> const& other, requires_arch<altivec>) noexcept
280280
{
281-
return vec_cmpeq(self.data, other.data);
281+
auto res = vec_cmpeq(self.data, other.data)
282+
return *reinterpret_cast<typename batch_bool<T, A>::register_type*>(&res);
282283
}
283284
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
284285
XSIMD_INLINE batch_bool<T, A> eq(batch_bool<T, A> const& self, batch_bool<T, A> const& other, requires_arch<altivec>) noexcept
285286
{
286-
return vec_cmpeq(self.data, other.data);
287+
auto res = vec_cmpeq(self.data, other.data)
288+
return *reinterpret_cast<typename batch_bool<T, A>::register_type*>(&res);
287289
}
288290

289291
// first
@@ -793,23 +795,21 @@ namespace xsimd
793795
{
794796
return vec_sqrt(val);
795797
}
796-
#if 0
797798

798799
// slide_left
799800
template <size_t N, class A, class T>
800801
XSIMD_INLINE batch<T, A> slide_left(batch<T, A> const& x, requires_arch<altivec>) noexcept
801802
{
802-
return _mm_slli_si128(x, N);
803+
return vec_sll(x, vec_splat_u8(N));
803804
}
804805

805806
// slide_right
806807
template <size_t N, class A, class T>
807808
XSIMD_INLINE batch<T, A> slide_right(batch<T, A> const& x, requires_arch<altivec>) noexcept
808809
{
809-
return _mm_srli_si128(x, N);
810+
return vec_srl(x, vec_splat_u8(N));
810811
}
811812

812-
#endif
813813
// sadd
814814
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
815815
XSIMD_INLINE batch<T, A> sadd(batch<T, A> const& self, batch<T, A> const& other, requires_arch<altivec>) noexcept
@@ -862,10 +862,10 @@ namespace xsimd
862862
// Make a mask for which parts of the vectors to swap out
863863
auto mask = vec_perm(ox00, oxFF, permuteVector);
864864
// Right rotate our input data
865-
v = vec_perm(self, self, permuteVector);
865+
auto v = vec_perm(self.data, self.data, permuteVector);
866866
// Insert our data into the low and high vectors
867-
low = vec_sel(self, low, mask);
868-
high = vec_sel(high, self, mask);
867+
low = vec_sel(v, low, mask);
868+
high = vec_sel(high, v, mask);
869869
// Store the two aligned result vectors
870870
vec_st(low, 0, mem);
871871
vec_st(high, 16, mem);

0 commit comments

Comments
 (0)