cpu_vx.c 461 B

12345678910111213141516
  1. #if (__VEC__ < 10301) || (__ARCH__ < 11)
  2. #error VX not supported
  3. #endif
  4. #include <vecintrin.h>
  5. int main(int argc, char **argv)
  6. {
  7. __vector double x = vec_abs(vec_xl(argc, (double*)argv));
  8. __vector double y = vec_load_len((double*)argv, (unsigned int)argc);
  9. x = vec_round(vec_ceil(x) + vec_floor(y));
  10. __vector bool long long m = vec_cmpge(x, y);
  11. __vector long long i = vec_signed(vec_sel(x, y, m));
  12. return (int)vec_extract(i, 0);
  13. }