Skip to content

Commit 39334f0

Browse files
WIP
1 parent 018ebd1 commit 39334f0

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

include/xsimd/arch/xsimd_altivec.hpp

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ namespace xsimd
221221
return vec_splats(val);
222222
}
223223

224+
// ceil
225+
template <class A, class T, class = typename std::enable_if<std::is_floating_point<T>::value, void>::type>
226+
XSIMD_INLINE batch<T, A> ceil(batch<T, A> const& self, requires_arch<altivec>) noexcept
227+
{
228+
return vec_ceil(self.data);
229+
}
230+
224231
// store_complex
225232
namespace detail
226233
{
@@ -315,6 +322,27 @@ namespace xsimd
315322
return vec_extract(self.data, 0);
316323
}
317324

325+
// floor
326+
template <class A, class T, class = typename std::enable_if<std::is_floating_point<T>::value, void>::type>
327+
XSIMD_INLINE batch<T, A> floor(batch<T, A> const& self, requires_arch<altivec>) noexcept
328+
{
329+
return vec_floor(self.data);
330+
}
331+
332+
// fma
333+
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
334+
XSIMD_INLINE batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<altivec>) noexcept
335+
{
336+
return vec_madd(x.data, y.data, z.data);
337+
}
338+
339+
// fms
340+
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
341+
XSIMD_INLINE batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<altivec>) noexcept
342+
{
343+
return vec_nmsub(x.data, y.data, z.data);
344+
}
345+
318346
// ge
319347
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
320348
XSIMD_INLINE batch_bool<T, A> ge(batch<T, A> const& self, batch<T, A> const& other, requires_arch<altivec>) noexcept
@@ -523,14 +551,16 @@ namespace xsimd
523551
return hadd(self, common {});
524552
}
525553

526-
// rsqrt
527-
template <class A>
528-
XSIMD_INLINE batch<float, A> rsqrt(batch<float, A> const& val, requires_arch<altivec>) noexcept
554+
// round
555+
template <class A, class T, class = typename std::enable_if<std::is_floating_point<T>::value, void>::type>
556+
XSIMD_INLINE batch<T, A> round(batch<T, A> const& self, requires_arch<altivec>) noexcept
529557
{
530-
return vec_rsqrt(val.data);
558+
return vec_round(self.data);
531559
}
532-
template <class A>
533-
XSIMD_INLINE batch<double, A> rsqrt(batch<double, A> const& val, requires_arch<altivec>) noexcept
560+
561+
// rsqrt
562+
template <class A, class T, typename std::enable_if<std::is_floating_point<T>::value, void>::type>
563+
XSIMD_INLINE batch<T, A> rsqrt(batch<T, A> const& val, requires_arch<altivec>) noexcept
534564
{
535565
return vec_rsqrt(val.data);
536566
}

0 commit comments

Comments
 (0)