cpu_vsx_asm.cpp 557 B

123456789101112131415161718192021
  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 "VSX is not supported"
  9. #endif
  10. /*
  11. * xlc and wide versions of clang don't support %x<n> in the inline asm template which fixes register number
  12. * when using any of the register constraints wa, wd, wf
  13. */
  14. int main()
  15. {
  16. __vector float vf;
  17. __vector signed int vi;
  18. __asm__ __volatile__ ("xvcvsxwsp %x0,%x1" : "=wa" (vf) : "wa" (vi));
  19. return 0;
  20. }