cpu_vsx3.cpp 432 B

1234567891011121314151617
  1. #if defined(__VSX__)
  2. #if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
  3. #include <altivec.h>
  4. #else
  5. #error "OpenCV only supports little-endian mode"
  6. #endif
  7. #else
  8. #error "VSX3 is not supported"
  9. #endif
  10. int main()
  11. {
  12. __vector unsigned char a = vec_splats((unsigned char)1);
  13. __vector unsigned char b = vec_splats((unsigned char)2);
  14. __vector unsigned char r = vec_absd(a, b);
  15. return 0;
  16. }