adding __have_native_{rsqrtd,rcpd} to select between native support for double precision reciprocals and using slower but safe version in stdlib

This commit is contained in:
Evghenii
2014-02-04 16:29:23 +01:00
parent fe98fe8cdc
commit d3a6693eef
6 changed files with 50 additions and 36 deletions

View File

@@ -1412,14 +1412,21 @@ static inline QUAL double __rcp_safe_##QUAL##_double(QUAL double x) \
RCPD(varying)
__declspec(safe)
static inline double rcp(double v) {
return __rcp_varying_double(v, (IntMaskType)__mask);
}
__declspec(safe)
static inline double rcp(double v) {
if (__have_native_rcpd)
return __rcp_varying_double(v);
else
return __rcp_safe_varying_double(v);
}
RCPD(uniform)
__declspec(safe)
__declspec(safe)
static inline uniform double rcp(uniform double v) {
return __rcp_uniform_double(v, (IntMaskType)__mask);
if (__have_native_rcpd)
return __rcp_uniform_double(v);
else
return __rcp_safe_uniform_double(v);
}
///////////////////////////////////////////////////////////////////////////
@@ -3572,13 +3579,19 @@ static inline QUAL double __rsqrt_safe_##QUAL##_double (QUAL double x) \
RSQRTD(varying)
__declspec(safe)
static inline double rsqrt(double v) {
return __rsqrt_varying_double(v, (IntMaskType)__mask);
if (__have_native_rsqrtd)
return __rsqrt_varying_double(v);
else
return __rsqrt_safe_varying_double(v);
}
RSQRTD(uniform)
__declspec(safe)
static inline uniform double rsqrt(uniform double v) {
return __rsqrt_uniform_double(v, (IntMaskType)__mask);
if (__have_native_rsqrtd)
return __rsqrt_uniform_double(v);
else
return __rsqrt_safe_uniform_double(v);
}
__declspec(safe)
static inline double ldexp(double x, int n) {