28 __mmask8 invalid1 = _mm512_cmp_pd_mask(x,
zero, _CMP_LT_OQ);
29 __mmask8 invalid2 = _mm512_cmp_pd_mask(x, dbl_max, _CMP_NLE_UQ);
30 if( ! _mm512_kortestz(invalid1, invalid2) )
32 __mmask8 invalid = invalid1 | invalid2;
33 throw domain_error( DEMsg(
"v1sqrtd", x, invalid) );
35 return v1sqrtd_core(x);
40 v8di ix = _mm512_castpd_si512(x);
41 v8di iy = _mm512_castpd_si512(y);
42 ix = _mm512_and_si512(ix, sqrt_mask1);
43 iy = _mm512_and_si512(iy, sqrt_mask1);
44 x = _mm512_castsi512_pd(ix);
45 __mmask8 invalid1 = _mm512_cmp_pd_mask(x, dbl_max, _CMP_NLE_UQ);
46 y = _mm512_castsi512_pd(iy);
47 __mmask8 invalid2 = _mm512_cmp_pd_mask(y, dbl_max, _CMP_NLE_UQ);
48 if( ! _mm512_kortestz(invalid1, invalid2) )
49 throw domain_error( DEMsg(
"v1hypotd", x, invalid1, y, invalid2) );
50 return v1hypotd_core(x, y);
55 __mmask16 invalid1 = _mm512_cmp_ps_mask(x, zerof, _CMP_LT_OQ);
56 __mmask16 invalid2 = _mm512_cmp_ps_mask(x, flt_max, _CMP_NLE_UQ);
57 if( ! _mm512_kortestz(invalid1, invalid2) )
59 __mmask16 invalid = invalid1 | invalid2;
60 throw domain_error( DEMsg(
"v1sqrtf", x, invalid) );
62 return v1sqrtf_core(x);
65 inline v16sf
v1hypotf(v16sf x, v16sf y)
67 v16si ix = _mm512_castps_si512(x);
68 v16si iy = _mm512_castps_si512(y);
69 ix = _mm512_and_si512(ix, sqrt_mask1f);
70 iy = _mm512_and_si512(iy, sqrt_mask1f);
71 x = _mm512_castsi512_ps(ix);
72 __mmask16 invalid1 = _mm512_cmp_ps_mask(x, flt_max, _CMP_NLE_UQ);
73 y = _mm512_castsi512_ps(iy);
74 __mmask16 invalid2 = _mm512_cmp_ps_mask(y, flt_max, _CMP_NLE_UQ);
75 if( ! _mm512_kortestz(invalid1, invalid2) )
76 throw domain_error( DEMsg(
"v1hypotf", x, invalid1, y, invalid2) );
77 return v1hypotf_core(x, y);
84 v4df invalid1 = _mm256_cmp_pd(x,
zero, _CMP_LT_OQ);
85 v4df invalid2 = _mm256_cmp_pd(x, dbl_max, _CMP_NLE_UQ);
86 v4df invalid = _mm256_or_pd(invalid1, invalid2);
87 if( ! _mm256_testz_pd(invalid, invalid) )
88 throw domain_error( DEMsg(
"v1sqrtd", x, invalid) );
89 return v1sqrtd_core(x);
94 v4df mask1 = _mm256_castsi256_pd(sqrt_mask1);
95 x = _mm256_and_pd(x, mask1);
96 v4df invalid1 = _mm256_cmp_pd(x, dbl_max, _CMP_NLE_UQ);
97 y = _mm256_and_pd(y, mask1);
98 v4df invalid2 = _mm256_cmp_pd(y, dbl_max, _CMP_NLE_UQ);
99 v4df invalid = _mm256_or_pd(invalid1, invalid2);
100 if( ! _mm256_testz_pd(invalid, invalid) )
101 throw domain_error( DEMsg(
"v1hypotd", x, invalid1, y, invalid2) );
102 return v1hypotd_core(x, y);
107 v8sf invalid1 = _mm256_cmp_ps(x, zerof, _CMP_LT_OQ);
108 v8sf invalid2 = _mm256_cmp_ps(x, flt_max, _CMP_NLE_UQ);
109 v8sf invalid = _mm256_or_ps(invalid1, invalid2);
110 if( ! _mm256_testz_ps(invalid, invalid) )
111 throw domain_error( DEMsg(
"v1sqrtf", x, invalid) );
112 return v1sqrtf_core(x);
115 inline v8sf
v1hypotf(v8sf x, v8sf y)
117 v8sf mask1 = _mm256_castsi256_ps(sqrt_mask1f);
118 x = _mm256_and_ps(x, mask1);
119 v8sf invalid1 = _mm256_cmp_ps(x, flt_max, _CMP_NLE_UQ);
120 y = _mm256_and_ps(y, mask1);
121 v8sf invalid2 = _mm256_cmp_ps(y, flt_max, _CMP_NLE_UQ);
122 v8sf invalid = _mm256_or_ps(invalid1, invalid2);
123 if( ! _mm256_testz_ps(invalid, invalid) )
124 throw domain_error( DEMsg(
"v1hypotf", x, invalid1, y, invalid2) );
125 return v1hypotf_core(x, y);
128 #endif // __AVX512F__
162 void vsqrt(
const double x[],
double y[],
long nlo,
long nhi)
169 void vhypot(
const double x1[],
const double x2[],
double y[],
long nlo,
long nhi)
195 void vhypot(
double *z,
double x0,
double y0,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
200 void vsqrt(
double *y,
double x0,
double x1,
double x2,
double x3,
double x4,
double x5,
double x6,
double x7)
#define V1FUN_PD_8(FUN, V)
#define V1FUN2_PS_8(FUN, V)
void vecfun2(const T x1[], const T x2[], T y[], long nlo, long nhi, T(*scalfun1)(T, T), V(*)(V, V))
#define V1FUN2_PS_4(FUN, V)
void vhypot(const double x1[], const double x2[], double y[], long nlo, long nhi)
void vecfun(const T x[], T y[], long nlo, long nhi, T(*scalfun1)(T), V(*)(V))
#define V1FUN2_PD_4(FUN, V)
double wr_hypotd(double x, double y)
sys_float wr_sqrtf(sys_float x)
#define V1FUN_PS_4(FUN, V)
#define V1FUN_PD_4(FUN, V)
void vsqrt(const double x[], double y[], long nlo, long nhi)
#define DEBUG_ENTRY(funcname)
#define V1FUN_PS_8(FUN, V)
#define V1FUN_PS_16(FUN, V)
sys_float wr_hypotf(sys_float x, sys_float y)
double wr_sqrtd(double x)