Blame view

3rdparty/opencv-4.5.4/cmake/checks/cpu_vsx_asm.cpp 557 Bytes
f4334277   Hu Chunming   提交3rdparty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  #if defined(__VSX__)
      #if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
          #include <altivec.h>
      #else
          #error "OpenCV only supports little-endian mode"
      #endif
  #else
      #error "VSX is not supported"
  #endif
  
  /*
   * xlc and wide versions of clang don't support %x<n> in the inline asm template which fixes register number
   * when using any of the register constraints wa, wd, wf
  */
  int main()
  {
      __vector float vf;
      __vector signed int vi;
      __asm__ __volatile__ ("xvcvsxwsp %x0,%x1" : "=wa" (vf) : "wa" (vi));
      return 0;
  }