cpu_msa.cpp 393 B

1234567891011121314151617181920212223
  1. #include <stdio.h>
  2. #if defined(__mips_msa)
  3. # include <msa.h>
  4. # define CV_MSA 1
  5. #endif
  6. #if defined CV_MSA
  7. int test()
  8. {
  9. const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
  10. v4f32 val = (v4f32)__msa_ld_w((const float*)(src), 0);
  11. return __msa_copy_s_w(__builtin_msa_ftint_s_w (val), 0);
  12. }
  13. #else
  14. #error "MSA is not supported"
  15. #endif
  16. int main()
  17. {
  18. printf("%d\n", test());
  19. return 0;
  20. }