public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul E Murphy <murphyp@linux.ibm.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org,
	Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Subject: Re: [PATCHv4 2/2] powerpc64le: ifunc (almost) all *f128 routines in multiarch mode
Date: Wed, 24 Jun 2020 17:42:40 -0500	[thread overview]
Message-ID: <2878d2a1-0fe7-171d-b11b-6bdd0da1a9ed@linux.ibm.com> (raw)
In-Reply-To: <5ad0045c-f637-6323-96e2-f2ceec9589ed@linaro.org>



On 6/24/20 3:41 PM, Adhemerval Zanella wrote:
> On 22/06/2020 20:04, Paul E Murphy wrote:
>> On 6/22/20 11:57 AM, Adhemerval Zanella via Libc-alpha wrote:

>>> What I would expect in realword cases is if the workload really
>>> uses float128 extensivelly to be built with -mcpu=power9 and/or
>>> -mfloat128/-mfloat128-hardware. It should cover most the required
>>> hotspots and glibc can focus on providing only cases where adding
>>> an specialized ifunc variant does make sense (as for the x86_64
>>> sysdeps/x86_64/fpu/multiarch/mp*) for instance.
>>>
>>> Also, if an optimized float128 glibc build is paramount, a much
>>> simpler solution would be to just provide a -mcpu=power9 built one.
>>
>> That kicks the can to the distros.  I think few ship such libraries. The whole value of multiarch is to expose these benefits without having to make the end user jump through such hurdles.  I don't think the x86 comparison holds.  Adding a couple of helpful instructions is tame compared to going from soft to hard fp.
> 
> My main issue with this approach is twofold: it basically tries to
> provide a soft and hard fp variant of of libm in the same library
> (adding build complexity, code bloat, and extra maintainability burden)
> and it relies heavily on the ifunc (which has it own issues that bites
> us now and then).

The design intentionally keeps all of the complexity in one place
hidden, without changes to common code.  Doing each individually is
fool's errand for even a small set of functions.  ifunc is the de facto
standard for multiarch.  Renaming a few redirects is a trivial amount
of work solved via grep.  Likewises, adding 200kb to one library is 
better than shipping a second 1+MB library.

> 
> The x86 comparison is sounded because we could make something similar
> and start to provide libm variants for AVX, AVX256, etc in the same
> manner.  Instead the approach used was to profile and provide specific
> ifunc variants to hotpots.

Again, those are incremental changes to an existing scalar isa.


> That's why I suggested to provide hardware float128 optimized variant
> when realword usercases provide us feedback that this might a gain.
> Besides the limited float128 current usage, I also expect in most
> scenarios that symbols that compiler implement as builtin (such sqrt)
> won't be called at all. Even for more complex math functions, most likely
> only a subset will be extensively used, that these are the ones that
> I think we should focus on instead of just push for the bigger hammer
> and optimize everything (which would be just simpler by providing
> a specific libm anyways).
> 

I disagree.  There is an obvious massive performance gap for all
transcendental functions.  It's our responsibility to proactively
solve this transparently for our users who are far more restricted
in which glibc they get to use.  Doubly so as ppc64le starts
transitioning to the new long double abi.

How about slightly changing the makefile to an opt-in model whereby
only transcendental abi (and other single instruction like sqrt) are
run through the auto-float128-ifunc machinery?

  reply	other threads:[~2020-06-24 22:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 20:59 [PATCHv4 1/2] powerpc64le: refactor e_sqrtf128.c Paul E. Murphy
2020-06-15 20:59 ` [PATCHv4 2/2] powerpc64le: ifunc (almost) all *f128 routines in multiarch mode Paul E. Murphy
2020-06-19 22:36   ` Tulio Magno Quites Machado Filho
2020-06-22 16:57   ` Adhemerval Zanella
2020-06-22 23:04     ` Paul E Murphy
2020-06-23 16:19       ` Paul E Murphy
2020-06-24 20:41       ` Adhemerval Zanella
2020-06-24 22:42         ` Paul E Murphy [this message]
2020-06-25  0:00           ` Joseph Myers
2020-06-25 16:29             ` Paul E Murphy
2020-06-25 18:35               ` Joseph Myers
2020-06-16  1:33 ` [PATCHv4 1/2] powerpc64le: refactor e_sqrtf128.c Paul A. Clarke
2020-06-16 19:06   ` Paul E Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2878d2a1-0fe7-171d-b11b-6bdd0da1a9ed@linux.ibm.com \
    --to=murphyp@linux.ibm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=tuliom@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).