[PATCH v2 3/3] powerpc64le: Add glibc-hwcaps support

Segher Boessenkool segher@kernel.crashing.org
Tue Nov 3 23:02:55 GMT 2020


Hi!

(Cc: Bill)

On Tue, Nov 03, 2020 at 05:29:08PM +0100, Florian Weimer via Libc-alpha wrote:
> * Tulio Magno Quites Machado Filho:
> > Florian Weimer <fweimer@redhat.com> writes:
> >> I think we need documentation what it means for a processor to implement
> >> ISA 3.0, and not altivec.  Or for that matter, what an implementation of
> >> powerpc64le-*-linux-gnu without altivec looks like.  Presumably, it will
> >> be different yet again from the original hardware used during
> >> architecture bring-up.
> >
> > I think we already have this documented in a couple of places in different
> > documents from the OpenPOWER Foundation.
> 
> Yes, but all those documents say that Altivec + VSX are required for
> powerpc64le-*-linux-gnu.  Your summary below seems to re-confirm that.
> 
> My point was that if we want powerpc64le-*-linux-gnu to stand for
> something different (without Altivec/VSX), we need (new) documentation
> that says what it means.

Not going to happen.  A new powerpc64le-linux-novec triple (or whatever
naming, this is just an example) can be made of course, but the existing
name will keep standing for the existing ABI!

> >> ISA features that cannot automatically and pervasively used by compilers
> >> can be excluded as well.  MMA could be in that category, and I think
> >> cryptography-related instructions generally are.
> >
> > MMA is indeed optional for Linux.
> > AFAICS, cryptography-related instructions are part of SIMD and should be
> > required for Linux.
> 
> Then I think we should change GCC not to enable MMA with -mcpu=power10.

No.

-mcpu=power10 enables MMA.  If you do not want all Power10 features, you
should not use -mcpu=power10.  It is that simple.

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.

> The other change is that I should check for PPC_FEATURE2_HAS_IEEE128 for
> power9, and add a comment that ALTIVEC and VSX are implied by the place
> in the source tree (I deliberately made all this specific to
> powerpc64le-*-linux-gnu on the glibc side, like we didn't define new ABI
> levels for i386).

All the VMX, VSX, QP float, MMA, whatever stuff is all the same on *all*
GCC Power targets, not just those that are powerpc64le-linux.  If you
use -mcpu=whatever, the resulting program can only be run on CPUs with
all features that <whatever> has.  This is what -mcpu= means.


Segher


More information about the Libc-alpha mailing list