opencv/cmake/checks/cpu_vsx3.cpp
Sayed Adel 474a0dac49 core: several improves and fixes on ppc64le infrastructure
- add infrastructure support for Power9/VSX3
  - fix missing VSX flags on GCC4.9 and CLANG4(#13210, #13222)
  - fix disable VSX optimzation on GCC by using flag ENABLE_VSX
  - flag ENABLE_VSX is deprecated now, use CPU_BASELINE, CPU_DISPATCH instead
  - add VSX3 to arithmetic dispatchable flags
2018-11-20 15:28:46 +00:00

18 lines
432 B
C++

#if defined(__VSX__)
#if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
#include <altivec.h>
#else
#error "OpenCV only supports little-endian mode"
#endif
#else
#error "VSX3 is not supported"
#endif
int main()
{
__vector unsigned char a = vec_splats((unsigned char)1);
__vector unsigned char b = vec_splats((unsigned char)2);
__vector unsigned char r = vec_absd(a, b);
return 0;
}