This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: Fix build of wcscpy with --disable-multi-arch
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: nd <nd at arm dot com>, "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>, Tulio Magno Quites Machado Filho <tuliom at ascii dot art dot br>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Tue, 5 Mar 2019 14:48:42 +0000
- Subject: Re: [PATCH] powerpc: Fix build of wcscpy with --disable-multi-arch
- References: <DB5PR08MB1030E190F7103CE66B74169A83710@DB5PR08MB1030.eurprd08.prod.outlook.com>
Hi,
> sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
> But I am not sure it is really pays off in term of simplify glibc code
> and build. Maybe an option is just to use __builtin_* when we know
> compiler generates an efficient instruction and just use the generic
> implementation instead.
Indeed. Simple builtin functions like these are inlined by compilers,
and that's always faster than calling a GLIBC version which might
use an ifunc.
That means you will practically never see calls to copysign, so it
does not make sense to optimize it using ifuncs. A large proportion of
ifuncs do nothing for performance, they only increase complexity and
make improving generic code more difficult and error prone.
If we focus more effort on optimizing generic code, we actually need
even fewer target specific optimizations (as the generic string and math
optimizations have proven).
Cheers,
Wilco