public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/fw/glibc-hwcaps] s390x: Add Add glibc-hwcaps support Date: Thu, 1 Oct 2020 16:54:46 +0000 (GMT) [thread overview] Message-ID: <20201001165446.EFD5A398B8BE@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ce8a9e1ad5fd496e5038425fa3f72d859ce9c425 commit ce8a9e1ad5fd496e5038425fa3f72d859ce9c425 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Jun 19 16:02:04 2020 +0200 s390x: Add Add glibc-hwcaps support Subdirectories z13, z14, z15 can be selected, mostly based on the level of support for vector instructions. Diff: --- sysdeps/s390/s390-64/dl-hwcaps-subdirs.c | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c new file mode 100644 index 0000000000..255af22f02 --- /dev/null +++ b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c @@ -0,0 +1,54 @@ +/* Architecture-specific glibc-hwcaps subdirectories. s390x version. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <dl-hwcaps.h> +#include <ldsodefs.h> + +const char _dl_hwcaps_subdirs[] = "z15:z14:z13"; + +int32_t +_dl_hwcaps_subdirs_active (void) +{ + int32_t result = 0; + int32_t bit = 1 << 2; + + /* Test in reverse preference order. */ + + /* z13. */ + if (!(GLRO (dl_hwcap) & HWCAP_S390_VX)) + return result; + result |= bit; + bit >>= 1; + + /* z14. */ + if (!((GLRO (dl_hwcap) & HWCAP_S390_VXD) + && (GLRO (dl_hwcap) & HWCAP_S390_VXE) + && (GLRO (dl_hwcap) & HWCAP_S390_GS))) + return result; + result |= bit; + bit >>= 1; + + /* z15. */ + if (!((GLRO (dl_hwcap) & HWCAP_S390_VXRS_EXT2) + && (GLRO (dl_hwcap) & HWCAP_S390_VXRS_PDE))) + return result; + result |= bit; + bit >>= 1; + + return result; +}
next reply other threads:[~2020-10-01 16:54 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-01 16:54 Florian Weimer [this message] 2020-10-14 15:11 Florian Weimer 2020-11-26 18:12 Florian Weimer 2020-11-26 18:44 Florian Weimer 2020-12-01 11:35 Florian Weimer 2020-12-01 20:55 Florian Weimer 2020-12-04 8:14 Florian Weimer 2020-12-07 8:15 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=20201001165446.EFD5A398B8BE@sourceware.org \ --to=fw@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /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: linkBe 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).