Skip to content

Commit ca1fd74

Browse files
WIP
1 parent 8c7d552 commit ca1fd74

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

include/xsimd/arch/xsimd_altivec.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ namespace xsimd
252252
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
253253
XSIMD_INLINE batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<altivec>) noexcept
254254
{
255-
return vec_div(self.data, other.data);
255+
return vec_mul(self.data, vec_re(other.data));
256256
}
257257

258258
// fast_cast

include/xsimd/types/xsimd_altivec_register.hpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,25 @@ namespace xsimd
3838
#if XSIMD_WITH_ALTIVEC
3939
namespace types
4040
{
41-
XSIMD_DECLARE_SIMD_REGISTER(signed char, altivec, __vector signed char);
42-
XSIMD_DECLARE_SIMD_REGISTER(unsigned char, altivec, __vector unsigned char);
43-
XSIMD_DECLARE_SIMD_REGISTER(char, altivec, __vector char);
44-
XSIMD_DECLARE_SIMD_REGISTER(unsigned short, altivec, __vector unsigned short);
45-
XSIMD_DECLARE_SIMD_REGISTER(short, altivec, __vector short);
46-
XSIMD_DECLARE_SIMD_REGISTER(unsigned int, altivec, __vector unsigned int);
47-
XSIMD_DECLARE_SIMD_REGISTER(int, altivec, __vector int);
48-
XSIMD_DECLARE_SIMD_REGISTER(float, altivec, __vector float);
41+
42+
#define XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(T, Tb) \
43+
template <> \
44+
struct get_bool_simd_register<T, altivec> \
45+
{ \
46+
using type = __vector __bool Tb; \
47+
}; \
48+
XSIMD_DECLARE_SIMD_REGISTER(T, altivec, __vector T)
49+
50+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(signed char, char);
51+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(unsigned char, char);
52+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(char, char);
53+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(unsigned short, short);
54+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(short, short);
55+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(unsigned int, int);
56+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(int, int);
57+
XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER(float, float);
58+
59+
#undef XSIMD_DECLARE_SIMD_BOOL_ALTIVEC_REGISTER
4960
}
5061
#endif
5162
}

0 commit comments

Comments
 (0)