This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 13/13] Use GCC builtins for copysign functions if desired.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Stefan Liebler <stli at linux dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 3 Dec 2019 16:50:48 +0000
- Subject: Re: [PATCH 13/13] Use GCC builtins for copysign functions if desired.
- Ironport-sdr: jPZlLFXfzCZpaMmjUNnkpcI4a1nVhsMxr5AjlDz4BgmUQqhBMi/itCiNZ4cxW/7t7Y9SokyAkl N4MtynXoFoK+cDnOwvqqssdXXbvyCY9vgaddD/F9g6BSCegaNelOah5thcbt3BHdx7+gS64H7v NRZvj+mQ667C1mmBKma+1q1luVQNgABqlC6YZDa3gVbJ5xZqFIfePCGm/5XB+VjEDpcI2B4BIa PpUAHOfhMrHr1Pm7KrlE79i91cDqhB99HXbDJLnhmKW0K4WXyrNSskx9auVZGfRwjRAopnUU6p 76I=
- Ironport-sdr: QNILyfe+0wfRDyltZKF/qrQ+en8uxUob7XoPMB7+BstcJ0BsUlLnri5zx1SZhIoXSDa/pAqJrt KVX5jLU6FDI0hie3tpzsW0fGNgCVZAzWoU8l1smbKKtEjCPHQirKohqrjBU1W2KRbBjjJBHBrt NCuBDBAP8CxYyAxQmbQj9uIh8e++HuzxvTHtPFDbixCrqi326cN41vuXsg5mfJ1zmGeWn2nAGp +8Vz6XxdjkUBZQP/OXkUcLOeLx0ZOWx0XuFeLD9Q7qoOwtU5WxKmR2YIOXYIN+ty9yCgZOWzox LYE=
- References: <1575297977-2589-1-git-send-email-stli@linux.ibm.com> <1575297977-2589-14-git-send-email-stli@linux.ibm.com> <alpine.DEB.2.21.1912022059030.23075@digraph.polyomino.org.uk> <e3c29fb8-5a63-0a0a-a55c-3d7751b348b1@linux.ibm.com>
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.
--
Joseph S. Myers
joseph@codesourcery.com