@@ -66,6 +66,8 @@ namespace xsimd
6666 template <class A, class T>
6767 XSIMD_INLINE batch<T, A> avgr(batch<T, A> const&, batch<T, A> const&, requires_arch<common>) noexcept;
6868#endif
69+ template <class A , class T >
70+ XSIMD_INLINE batch<T, A> ssub (batch<T, A> const &, batch<T, A> const &, requires_arch<common>) noexcept ;
6971
7072 // abs
7173 template <class A >
@@ -103,13 +105,18 @@ namespace xsimd
103105 }
104106
105107 // avg
106- template <class A , class T , class = typename std::enable_if<std::is_scalar <T>::value, void >::type>
108+ template <class A , class T , class = typename std::enable_if<std::is_integral <T>::value, void >::type>
107109 XSIMD_INLINE batch<T, A> avg (batch<T, A> const & self, batch<T, A> const & other, requires_arch<altivec>) noexcept
108110 {
109111 constexpr auto nbit = 8 * sizeof (T) - 1 ;
110- constexpr auto adj = ((self ^ other) << nbit) >> nbit;
112+ auto adj = ((self ^ other) << nbit) >> nbit;
111113 return avgr (self.data , other.data , A {}) - adj;
112114 }
115+ template <class A >
116+ XSIMD_INLINE batch<float , A> avg (batch<float , A> const & self, batch<float , A> const & other, requires_arch<altivec>) noexcept
117+ {
118+ return vec_avg (self.data , other.data );
119+ }
113120
114121 // batch_bool_cast
115122 template <class A , class T_out , class T_in >
@@ -613,7 +620,7 @@ namespace xsimd
613620 template <class A , class T , class = typename std::enable_if<std::is_scalar<T>::value, void >::type>
614621 XSIMD_INLINE batch<T, A> neg (batch<T, A> const & self, requires_arch<altivec>) noexcept
615622 {
616- return vec_neg (self.data );
623+ return - (self.data );
617624 }
618625
619626 // neq
0 commit comments