1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Use GCC builtins for copysign functions if desired.

This patch is always using the corresponding GCC builtin for copysignf, copysign,
and is using the builtin for copysignl, copysignf128 if the USE_FUNCTION_BUILTIN
macros are defined to one in math-use-builtins.h.

Altough the long double version is enabled by default we still need
the macro and the alternative implementation as the _Float128 version
of the builtin is not available with all supported GCC versions.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
Stefan Liebler
2019-12-11 15:09:24 +01:00
parent f82996f815
commit f818afdd3b
6 changed files with 31 additions and 15 deletions

View File

@ -19,6 +19,8 @@
#ifndef MATH_USE_BUILTINS_H
#define MATH_USE_BUILTINS_H 1
#include <features.h> /* For __GNUC_PREREQ. */
/* Define these macros to 1 to use __builtin_xyz instead of the
generic implementation. */
#define USE_NEARBYINT_BUILTIN 0
@ -51,4 +53,11 @@
#define USE_ROUNDL_BUILTIN 0
#define USE_ROUNDF128_BUILTIN 0
#define USE_COPYSIGNL_BUILTIN 1
#if __GNUC_PREREQ (7, 0)
# define USE_COPYSIGNF128_BUILTIN 1
#else
# define USE_COPYSIGNF128_BUILTIN 0
#endif
#endif /* math-use-builtins.h */