Blame sysdeps/s390/s390-64/dl-hwcaps-subdirs.c

Packit Service b4f24e
/* Architecture-specific glibc-hwcaps subdirectories.  s390x version.
Packit Service b4f24e
   Copyright (C) 2020 Free Software Foundation, Inc.
Packit Service b4f24e
   This file is part of the GNU C Library.
Packit Service b4f24e
Packit Service b4f24e
   The GNU C Library is free software; you can redistribute it and/or
Packit Service b4f24e
   modify it under the terms of the GNU Lesser General Public
Packit Service b4f24e
   License as published by the Free Software Foundation; either
Packit Service b4f24e
   version 2.1 of the License, or (at your option) any later version.
Packit Service b4f24e
Packit Service b4f24e
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service b4f24e
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service b4f24e
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service b4f24e
   Lesser General Public License for more details.
Packit Service b4f24e
Packit Service b4f24e
   You should have received a copy of the GNU Lesser General Public
Packit Service b4f24e
   License along with the GNU C Library; if not, see
Packit Service b4f24e
   <https://www.gnu.org/licenses/>.  */
Packit Service b4f24e
Packit Service b4f24e
#include <dl-hwcaps.h>
Packit Service b4f24e
#include <ldsodefs.h>
Packit Service b4f24e
Packit Service b4f24e
const char _dl_hwcaps_subdirs[] = "z15:z14:z13";
Packit Service b4f24e
enum { subdirs_count = 3 }; /* Number of components in _dl_hwcaps_subdirs.  */
Packit Service b4f24e
Packit Service b4f24e
uint32_t
Packit Service b4f24e
_dl_hwcaps_subdirs_active (void)
Packit Service b4f24e
{
Packit Service b4f24e
  int active = 0;
Packit Service b4f24e
Packit Service b4f24e
  /* Test in reverse preference order.  */
Packit Service b4f24e
Packit Service b4f24e
  /* z13.  */
Packit Service b4f24e
  if (!(GLRO (dl_hwcap) & HWCAP_S390_VX))
Packit Service b4f24e
    return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
Packit Service b4f24e
  ++active;
Packit Service b4f24e
Packit Service b4f24e
  /* z14.  */
Packit Service b4f24e
  if (!((GLRO (dl_hwcap) & HWCAP_S390_VXD)
Packit Service b4f24e
        && (GLRO (dl_hwcap) & HWCAP_S390_VXE)
Packit Service b4f24e
        && (GLRO (dl_hwcap) & HWCAP_S390_GS)))
Packit Service b4f24e
    return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
Packit Service b4f24e
  ++active;
Packit Service b4f24e
Packit Service b4f24e
  /* z15.
Packit Service b4f24e
     Note: We do not list HWCAP_S390_SORT and HWCAP_S390_DFLT here as,
Packit Service b4f24e
     according to the Principles of Operation, those may be replaced or removed
Packit Service b4f24e
     in future.  */
Packit Service b4f24e
  if (!((GLRO (dl_hwcap) & HWCAP_S390_VXRS_EXT2)
Packit Service b4f24e
        && (GLRO (dl_hwcap) & HWCAP_S390_VXRS_PDE)))
Packit Service b4f24e
    return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
Packit Service b4f24e
  ++active;
Packit Service b4f24e
Packit Service b4f24e
  return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
Packit Service b4f24e
}