unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: Tulio Magno Quites Machado Filho <tuliom@ascii.art.br>
Cc: libc-alpha@sourceware.org, "Paul A. Clarke" <pc@us.ibm.com>
Subject: Re: [PATCH v2 3/3] powerpc64le: Add glibc-hwcaps support
Date: Mon, 02 Nov 2020 11:15:36 +0100	[thread overview]
Message-ID: <874km8hxo7.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <87pn4zfgyh.fsf@linux.ibm.com> (Tulio Magno Quites Machado Filho's message of "Fri, 30 Oct 2020 20:10:30 -0300")

* Tulio Magno Quites Machado Filho:

> Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> writes:
>
>> The "power10" and "power9" subdirectories are selected.
>
> Tested on power10.
>
> Should this patch also include modification to
> glibc-hwcaps-first-subdirs-for-tests ?

Yes, it should.  In the posted version, it depended on power9 being
included in the first patch tht added the generic test.

> Is it intentional that other architectures end up with the following file?
>
>     elf/glibc-hwcaps/x86-64-v2/markermod1.so

Yes, it doesn't hurt, and it allows us to keep the test generic.

>> diff --git a/sysdeps/powerpc/powerpc64/le/dl-hwcaps-subdirs.c b/sysdeps/powerpc/powerpc64/le/dl-hwcaps-subdirs.c
>> new file mode 100644
>> index 0000000000..1fa3735a8c
>> --- /dev/null
>> +++ b/sysdeps/powerpc/powerpc64/le/dl-hwcaps-subdirs.c
>> @@ -0,0 +1,39 @@
>>...
>> +
>> +uint32_t
>> +_dl_hwcaps_subdirs_active (void)
>> +{
>> +  int active = 0;
>> +
>> +  if ((GLRO (dl_hwcap2) & PPC_FEATURE2_ARCH_3_00) == 0)
>> +    return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
>> +  ++active;
>> +
>> +  if ((GLRO (dl_hwcap2) & PPC_FEATURE2_ARCH_3_1) == 0)
>> +    return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
>
> This is the tricky part.  I like your proposal to match with the behavior
> of -mcpu.
> In that case we would have:
>
>   power9:
>     ((GLRO (dl_hwcap2) & PPC_FEATURE2_ARCH_3_00) == 0
>      || (GLRO (dl_hwcap2) & PPC_FEATURE2_HAS_IEEE128) == 0
>      || (GLRO (dl_hwcap) & PPC_FEATURE_HAS_ALTIVEC) == 0
>      || (GLRO (dl_hwcap) & PPC_FEATURE_HAS_VSX) == 0)
>
>   power10:
>     /* power10 also requires altivec, vsx and ieee128 availability, but these
>        features have already been tested.  */
>     ((GLRO (dl_hwcap2) & (PPC_FEATURE2_ARCH_3_1 | PPC_FEATURE2_MMA)) == 0)
>
> This would mean that a processor that implements POWER ISA 3.0, but does not
> implement altivec, would not be able to benefit from that particular library
> build, falling back to the general build (power8), e.g. microwatt would fall
> in this category right now.

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.

Once we have no-altivec support for powerpc64le in the GNU toolchain, we
probably should add a power8 subdirectory that stores libraries that use
altivec/vsx.  (This directory would be searched even on systems which
are built to use altivec because they use the POWER8 baseline.)

>>   * The names "power9" and "power10" may be too implementation-specific in
>>     the future.
>
> I do agree, but I don't have a better suggestion.
> It's hard to be future-proof here.
> I don't think that using the POWER ISA level would help much though,
> because new processors may decide to not implement a particular feature
> in the future that we believe is essential right now.

One way to address this is to restrict the selected ISA features for
each level to something that has the most benefit and is unlikely to go
away.

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.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


  reply	other threads:[~2020-11-02 10:15 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 via Libc-alpha
2020-10-12 15:21 ` [PATCH 1/3] elf: Add " Florian Weimer via Libc-alpha
2020-10-13 16:28   ` Paul A. Clarke via Libc-alpha
2020-10-14 13:58     ` Florian Weimer via Libc-alpha
2020-10-14 15:14       ` Paul A. Clarke via Libc-alpha
2020-10-14 15:19         ` Florian Weimer via Libc-alpha
2020-10-20 17:23   ` Paul A. Clarke via Libc-alpha
2020-10-12 15:21 ` [PATCH v2 2/3] x86_64: Add glibc-hwcaps support Florian Weimer via Libc-alpha
2020-10-12 18:11   ` H.J. Lu via Libc-alpha
2020-10-13  9:29     ` Florian Weimer via Libc-alpha
2020-10-13 11:02       ` H.J. Lu via Libc-alpha
2020-10-13 11:24         ` Florian Weimer via Libc-alpha
2020-10-13 11:43           ` H.J. Lu via Libc-alpha
2020-10-12 15:22 ` [PATCH v2 3/3] powerpc64le: " Florian Weimer via Libc-alpha
2020-10-13 16:36   ` Paul A. Clarke via Libc-alpha
2020-10-20 17:23   ` Paul A. Clarke via Libc-alpha
2020-10-29 16:26   ` Florian Weimer via Libc-alpha
2020-10-30 23:10   ` Tulio Magno Quites Machado Filho via Libc-alpha
2020-11-02 10:15     ` Florian Weimer via Libc-alpha [this message]
2020-11-03 15:14       ` Tulio Magno Quites Machado Filho via Libc-alpha
2020-11-03 16:29         ` Florian Weimer via Libc-alpha
2020-11-03 23:02           ` Segher Boessenkool
2020-11-04  8:28             ` Florian Weimer via Libc-alpha
2020-11-04 19:36               ` Segher Boessenkool
2020-11-04 19:56                 ` Florian Weimer via Libc-alpha
2020-11-04 21:58                   ` Segher Boessenkool
2020-11-05 11:40                     ` Florian Weimer via Libc-alpha
2020-11-05 21:42                       ` Segher Boessenkool
2020-11-09 18:32                         ` Florian Weimer via Libc-alpha
2020-11-16 14:51               ` Tulio Magno Quites Machado Filho via Libc-alpha
2020-11-16 19:35                 ` Segher Boessenkool
2020-11-23 10:20                   ` Florian Weimer via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=874km8hxo7.fsf@oldenburg2.str.redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=pc@us.ibm.com \
    --cc=tuliom@ascii.art.br \
    /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).