mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
dab6344279
Add extra check for compiler definitions to ensure that compiler provides sqrt and fma hw fpu instructions else use software implementation. As divide/sqrt and FMA hw support from CPU side is optional, the compiler can be configured by options to generate hw FPU instructions, but without use of FDDIV, FDSQRT, FSDIV, FSSQRT, FDMADD and FSMADD instructions. In this case __builtin_sqrt and __builtin_sqrtf provided by compiler can't be used inside the glibc code, as these builtins are used in implementations of sqrt() and sqrtf() functions but at the same time these builtins unfold to sqrt() and sqrtf(). So it is possible to receive code like that: 0001c4b4 <__ieee754_sqrtf>: 1c4b4: 0001 0000 b 0 ;1c4b4 <__ieee754_sqrtf> The same is also true for __builtin_fma and __builtin_fmaf. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
15 lines
263 B
C
15 lines
263 B
C
#if defined __ARC_FPU_DP_DIV__
|
|
# define USE_SQRT_BUILTIN 1
|
|
#else
|
|
# define USE_SQRT_BUILTIN 0
|
|
#endif
|
|
|
|
#if defined __ARC_FPU_SP_DIV__
|
|
# define USE_SQRTF_BUILTIN 1
|
|
#else
|
|
# define USE_SQRTF_BUILTIN 0
|
|
#endif
|
|
|
|
#define USE_SQRTL_BUILTIN 0
|
|
#define USE_SQRTF128_BUILTIN 0
|