/ lib / numpy / distutils / checks / cpu_vsx.c
cpu_vsx.c
 1  #ifndef __VSX__
 2      #error "VSX is not supported"
 3  #endif
 4  #include <altivec.h>
 5  
 6  #if (defined(__GNUC__) && !defined(vec_xl)) || (defined(__clang__) && !defined(__IBMC__))
 7      #define vsx_ld  vec_vsx_ld
 8      #define vsx_st  vec_vsx_st
 9  #else
10      #define vsx_ld  vec_xl
11      #define vsx_st  vec_xst
12  #endif
13  
14  int main(void)
15  {
16      unsigned int zout[4];
17      unsigned int z4[] = {0, 0, 0, 0};
18      __vector unsigned int v_z4 = vsx_ld(0, z4);
19      vsx_st(v_z4, 0, zout);
20      return zout[0];
21  }