This is the mail archive of the
mailing list for the glibc project.
Re: [RFC] How to add vector math functions to Glibc
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 26 Sep 2014 09:08:25 -0700
- Subject: Re: [RFC] How to add vector math functions to Glibc
- Authentication-results: sourceware.org; auth=none
- References: <CAMXFM3tjquzniXP1weqxSVFJyhXqsf2PHuyrrrmqp7K0ZzORqA at mail dot gmail dot com> <CAMXFM3sGMNX1DEPAMt7qUR4UREF_xUAQjCG1OjBiZH2aoOFiPA at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1409181551370 dot 31607 at digraph dot polyomino dot org dot uk> <CAMXFM3tO7MTYCq8-YFZacdbLvR4iAab_n04AuB+rp2Phs4BvQg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1409242011260 dot 7597 at digraph dot polyomino dot org dot uk> <CAMXFM3tqiqUNuSU2KXvAFM-QescX3+6xUO9=z5X0Ac6C9qJ7zg at mail dot gmail dot com> <CAMe9rOq7bZHb8R=opUzSmAMGWjLpX21mR=Sx96cuBph=TTtDXA at mail dot gmail dot com> <54246CB5 dot 7020908 at redhat dot com> <CAMe9rOoLmJ2jHWmERoB0M83WNKovJOgh0--Kquw9O86A1tPU0g at mail dot gmail dot com> <5424733D dot 6010305 at redhat dot com> <CAMe9rOpacze055qyBFzz3M-b-GNtXCqZzMmkScBL9a94zVj28g at mail dot gmail dot com> <54247FAB dot 6050002 at redhat dot com> <CAMe9rOq78Sey2HMHBdJNY=+E5NuHxDDhhZ=+0QJX5MTw6KLcBg at mail dot gmail dot com> <54258AD4 dot 7000604 at redhat dot com>
On Fri, Sep 26, 2014 at 8:48 AM, Carlos O'Donell <email@example.com> wrote:
> On 09/26/2014 11:03 AM, H.J. Lu wrote:
>> Put it in GLIBC means that GCC 5.0 may not support vector
>> math, depending on the build or target GLIBC. It is not a good
>> GCC user experience.
> The same goes for all the other C11 and C++11 features we
> coordinate with glibc? I don't see how this has anything to do
> with a "user experience." The distribution maintainers need to
> make sure glibc is up to date, and gcc's required features are
> present. This is always how it works.
When there is no choice, then you don't have a choice.
>> That is true that programmers who want to use vector math
>> directly need to install GCC 5.0. That is one reason I am
>> asking who is the main user of vector math.
> That's a serious upgrade for many users.
I view it quite opposite. No one I know of installs a new GLIBC
unless it comes from the system. But they may install a new
GCC. It is much easier to install a new GCC than a new GLIBC.
> While backporting libmvec.so is pretty simple, and allows
> the feature to be present for immediate use directly by a
> developer, and later to be used when they are ready to
> upgrade to gcc 5.0.
Same backport goes for GCC.
> I think this chioce may actually be larger than just Intel.
> For example IBM, and particularly their Power vector math
> functions were explained to me as being callable directly
> by developers. Thus Power might want libmvec.so in glibc?
Does Power have the same API as x86? If not, how will they
be used by programmers?
Again, we need to decide
1. Who is the main user.
2. How it is used by the main user.
3. What is the impact on the programmers.
If we put it in GLIBC, we should have a API with a generic
implementation and each target can have optimized implementation.
> I still believe that developers will want to call these
> by hand if possible for code that is hand-optimized.
One can do that, regardless whether vector math is in
GCC or GLIBC.
> That IMO calls out for this to be libmvec.so in glibc.
> Not to mention that gcc has no math testing infrastructure
> and glibc does. We can immediately put all of this test
> infrastructure to play for libmvec.so.
Vector math can have a testsuite, like other run-time libraries.