public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: Tulio Magno Quites Machado Filho <tuliom@ascii.art.br>,
	libc-alpha@sourceware.org, "Paul A. Clarke" <pc@us.ibm.com>,
	wschmidt@linux.ibm.com
Subject: Re: [PATCH v2 3/3] powerpc64le: Add glibc-hwcaps support
Date: Wed, 4 Nov 2020 15:58:20 -0600	[thread overview]
Message-ID: <20201104215820.GV2672@gate.crashing.org> (raw)
In-Reply-To: <87pn4s28x6.fsf@oldenburg2.str.redhat.com>

On Wed, Nov 04, 2020 at 08:56:05PM +0100, Florian Weimer wrote:
> * Segher Boessenkool:
> 
> >> > -mcpu=power10 enables MMA.  If you do not want all Power10 features, you
> >> > should not use -mcpu=power10.  It is that simple.
> >> 
> >> Then we need a different name, or require MMA for the "power10"
> >> glibc-hwcaps subdirectory.
> >
> > Or do nothing.  Glibc doesn't use any MMA code, does it?  This is never
> > generated automatically, you need to really ask for it in your source
> > code.
> 
> glibc's internal use does not matter in this context.  Programmers must
> be able to drop their own libraries built with -mcpu=power10 into the
> power10 subdirectory.  If GCC turns on MMA by default for this switch
> and glibc selects the power10 subdirectory without checking for MMA
> support, then this isn't guaranteed to work.

Are you saying that it is *normal* for people to put very different code
into libc like this?  Wow.

> We have been through this with x86-64 already.  I don't want to produce
> the same bug.

No code in libc should ever use MMA, imnsho.

> >> > Since powerpc64le-linux requires Power8 or later, you always have VMX
> >> > and VSX enabled there.  In exactly that same way.
> >> >
> >> > GCC never generates anything MMA that the user did not explicitly ask
> >> > for in the source code (with builtins, say), so this is not an issue.
> >> > Compare this with hardware DFP.
> >> 
> >> GCC defines __MMA__ for -mcpu=power10, and source code will evenually be
> >> sensitive to that macro.
> >
> > That macro simply says that source code can use MMA builtins and the
> > like.  Is it important for glibc whether user code uses MMA?
> 
> Yes, we can only load code that is built to use MMA unconditionally
> (potentially) if the system supports MMA.
> 
> And in the future, GCC might recognize common code patterns with
> -ftree-loop-vectorize and replace them with MMA intrinsics.

No, not really.  Maybe 20 years from now though, sure.

MMA uses its own register set.  Moves to other regs are expensive.  You
cannot pass those MMA registers around at all, either.

So sure, only load modules with MMA code if the hwcap says you have MMA,
but I don't see why you would refuse power10 code without it.  But, ask
Tulio, of course -- I just don't see the point of having a separate
hwcap for it at all, if you do not use it!

> >> I think it is important that -mcpu=power10 and the "power10"
> >> subdirectory mean the same thing.
> >
> > -mcpu=power10 means "generate code optimised for power10" (and: "it will
> > probably not run on cpus not compatible to power10").
> >
> > Is that what that subdir holds as well?
> 
> Yes, that's the idea.  The programmer can also drop a -mcpu=power9
> library into the power9 subdirectory.  The difference to the existing
> AT_PLATFORM subdirectory is that on POWER10, both subdirectories (power9
> and power10) are searched.  With AT_PLATFORM on POWER10, only power10
> would be searched.  (And we're also fixing a silent on-disk format
> change in the way AT_PLATFORM libraries are represented in ld.so.cache.)

HtH, cheers,


Segher

  reply	other threads:[~2020-11-04 21:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 15:21 [PATCH v2 0/3] glibc-hwcaps support for LD_LIBRARY_PATH Florian Weimer
2020-10-12 15:21 ` [PATCH 1/3] elf: Add " Florian Weimer
2020-10-13 16:28   ` Paul A. Clarke
2020-10-14 13:58     ` Florian Weimer
2020-10-14 15:14       ` Paul A. Clarke
2020-10-14 15:19         ` Florian Weimer
2020-10-20 17:23   ` Paul A. Clarke
2020-10-12 15:21 ` [PATCH v2 2/3] x86_64: Add glibc-hwcaps support Florian Weimer
2020-10-12 18:11   ` H.J. Lu
2020-10-13  9:29     ` Florian Weimer
2020-10-13 11:02       ` H.J. Lu
2020-10-13 11:24         ` Florian Weimer
2020-10-13 11:43           ` H.J. Lu
2020-10-12 15:22 ` [PATCH v2 3/3] powerpc64le: " Florian Weimer
2020-10-13 16:36   ` Paul A. Clarke
2020-10-20 17:23   ` Paul A. Clarke
2020-10-29 16:26   ` Florian Weimer
2020-10-30 23:10   ` Tulio Magno Quites Machado Filho
2020-11-02 10:15     ` Florian Weimer
2020-11-03 15:14       ` Tulio Magno Quites Machado Filho
2020-11-03 16:29         ` Florian Weimer
2020-11-03 23:02           ` Segher Boessenkool
2020-11-04  8:28             ` Florian Weimer
2020-11-04 19:36               ` Segher Boessenkool
2020-11-04 19:56                 ` Florian Weimer
2020-11-04 21:58                   ` Segher Boessenkool [this message]
2020-11-05 11:40                     ` Florian Weimer
2020-11-05 21:42                       ` Segher Boessenkool
2020-11-09 18:32                         ` Florian Weimer
2020-11-16 14:51               ` Tulio Magno Quites Machado Filho
2020-11-16 19:35                 ` Segher Boessenkool
2020-11-23 10:20                   ` Florian Weimer

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=20201104215820.GV2672@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=pc@us.ibm.com \
    --cc=tuliom@ascii.art.br \
    --cc=wschmidt@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).