Unverified Commit 4a53742f authored by pkubaj's avatar pkubaj Committed by GitHub
Browse files

Fix build with clang on ppc64le (#2278)

* Fix build with clang on ppc64le

Clang doesn't implement vec_rsqrt. Code taken from https://github.com/opencv/opencv/blob/master/modules/core/include/opencv2/core/vsx_utils.hpp#L360

* Define vec_rsqrt only if we use VSX
parent 9e5c5567
...@@ -524,6 +524,11 @@ namespace dlib ...@@ -524,6 +524,11 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
#if defined(DLIB_HAVE_VSX) && !defined(vec_rsqrt)
extern inline __vector float __attribute__((always_inline)) vec_rsqrt(const __vector float& a)
{ return vec_div((__vector float){1, 1, 1, 1}, vec_sqrt(a)); }
#endif
inline simd4f reciprocal_sqrt (const simd4f& item) inline simd4f reciprocal_sqrt (const simd4f& item)
{ {
#ifdef DLIB_HAVE_SSE2 #ifdef DLIB_HAVE_SSE2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment