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