cpu_vsx.c 478 B

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