This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: Add a POWER8-optimized version of powf()
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: "munroesj at linux dot vnet dot ibm dot com" <munroesj at linux dot vnet dot ibm dot com>, "adhemerval dot zanella at linaro dot org" <adhemerval dot zanella at linaro dot org>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, nd <nd at arm dot com>
- Date: Sat, 27 May 2017 12:55:30 +0000
- Subject: Re: [PATCH] powerpc: Add a POWER8-optimized version of powf()
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Steven Munroe wrote:
> On Fri, 2017-05-26 at 16:55 -0300, Adhemerval Zanella wrote:
> >
> > This changes seems to be arch independent and I would like to avoid adding
> > even more arch specific. Is there any reason why this can't be used as
> > the default implementation? Do you have number on different architecture
> > for it?
> >
> If other platform maintainer what to try this implementation and report
> that would be OK.
>
> But I don't this it is correct or fair to ask Paul to prove a negative.
> These quests tend to be very labor intensive and usually don't work out
> (as really common) in the end.
I disagree. We've seen time and time again that well-written generic code beats target
specific code. So I would suggest to focus on improving the algorithms in generic code
rather than do target specific hacks that don't turn out to be useful in the long run.
This will not only result in more efficient code, but it is also far cheaper in development
time as it only needs to be done once and can be shared across all targets.
For this function I can't see why you'd ever want an ifunc unless there are cases where
it doesn't beat the default powf implementation (presumably due to using 2 double
precision divisions?). As it happens Szabolcs wrote a prototype powf that is not only
more accurate but also 4x faster, all using generic code. With these gains, target
specific math functions will be obsolete...
Wilco