From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id EFD5A398B8BE; Thu, 1 Oct 2020 16:54:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFD5A398B8BE Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/fw/glibc-hwcaps] s390x: Add Add glibc-hwcaps support X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/fw/glibc-hwcaps X-Git-Oldrev: 01faff4932d02c7e3224b50a1cdb5956354b1fc2 X-Git-Newrev: ce8a9e1ad5fd496e5038425fa3f72d859ce9c425 Message-Id: <20201001165446.EFD5A398B8BE@sourceware.org> Date: Thu, 1 Oct 2020 16:54:46 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:54:47 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ce8a9e1ad5fd496e5038425fa3f72d859ce9c425 commit ce8a9e1ad5fd496e5038425fa3f72d859ce9c425 Author: Florian Weimer 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 + . */ + +#include +#include + +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; +}