On 12/3/19 5:50 PM, Joseph Myers wrote: > On Tue, 3 Dec 2019, Stefan Liebler wrote: > >> On 12/2/19 10:00 PM, Joseph Myers wrote: >>> On Mon, 2 Dec 2019, Stefan Liebler wrote: >>> >>>> This patch is using the corresponding GCC builtin for copysignf, copysign, >>>> copysignl and copysignf128 if the USE_FUNCTION_BUILTIN macros are defined >>>> to one >>>> in math-use-builtins.h. >>> >>> I believe this is always safe for these implementations (the only case >>> where GCC might not expand copysign functions inline is copysignl for IBM >>> long double, in the soft-float case). >>> >> Thus you mean we can do the following preset in >> sysdeps/generic/math-use-builtins.h? >> #define USE_COPYSIGN_BUILTIN 1 >> #define USE_COPYSIGNF_BUILTIN 1 >> #define USE_COPYSIGNL_BUILTIN 0 >> #define USE_COPYSIGNF128_BUILTIN 0 >> >> Or even also set USE_COPYSIGNL_BUILTIN to one as IBM long double has its own >> implementation in ./sysdeps/ieee754/ldbl-128ibm/s_copysignl.c. > > I think they can all be 1, given that IBM long double has its own > implementation. Except that you shouldn't need the indirection through > these macros at all. Just use __builtin_copysign etc. directly in the > implementations (other than IBM long double), unconditionally, the same > way that sysdeps/ieee754/dbl-64/s_fabs.c uses __builtin_fabs directly > without such macros being needed. > Okay. I've set them to 1 and also used build-many-glibcs.py and had a look into the s_copysign*.os files. There is no function call to copysign* itself. If one architecture encounters issues with those builtins, an architecture specific math-use-builtins.sh file can set the macros to zero. Bye, Stefan