Blame sysdeps/powerpc/powerpc64/le/dl-hwcaps-subdirs.c

Packit Service 949dd0
/* Architecture-specific glibc-hwcaps subdirectories.  powerpc64le version.
Packit Service 949dd0
   Copyright (C) 2020 Free Software Foundation, Inc.
Packit Service 949dd0
   This file is part of the GNU C Library.
Packit Service 949dd0
Packit Service 949dd0
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 949dd0
   modify it under the terms of the GNU Lesser General Public
Packit Service 949dd0
   License as published by the Free Software Foundation; either
Packit Service 949dd0
   version 2.1 of the License, or (at your option) any later version.
Packit Service 949dd0
Packit Service 949dd0
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 949dd0
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 949dd0
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 949dd0
   Lesser General Public License for more details.
Packit Service 949dd0
Packit Service 949dd0
   You should have received a copy of the GNU Lesser General Public
Packit Service 949dd0
   License along with the GNU C Library; if not, see
Packit Service 949dd0
   <https://www.gnu.org/licenses/>.  */
Packit Service 949dd0
Packit Service 949dd0
#include <dl-hwcaps.h>
Packit Service 949dd0
#include <ldsodefs.h>
Packit Service 949dd0
Packit Service 949dd0
const char _dl_hwcaps_subdirs[] = "power10:power9";
Packit Service 949dd0
enum { subdirs_count = 2 }; /* Number of components in _dl_hwcaps_subdirs.  */
Packit Service 949dd0
Packit Service 949dd0
uint32_t
Packit Service 949dd0
_dl_hwcaps_subdirs_active (void)
Packit Service 949dd0
{
Packit Service 949dd0
  int active = 0;
Packit Service 949dd0
Packit Service 949dd0
  /* Test in reverse preference order.  Altivec and VSX are implied by
Packit Service 949dd0
     the powerpc64le ABI definition.  */
Packit Service 949dd0
Packit Service 949dd0
  /* POWER9.  GCC enables float128 hardware support for -mcpu=power9.  */
Packit Service 949dd0
  if ((GLRO (dl_hwcap2) & PPC_FEATURE2_ARCH_3_00) == 0
Packit Service 949dd0
      || (GLRO (dl_hwcap2) & PPC_FEATURE2_HAS_IEEE128) == 0)
Packit Service 949dd0
    return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
Packit Service 949dd0
  ++active;
Packit Service 949dd0
Packit Service 949dd0
  /* POWER10.  GCC defines __MMA__ for -mcpu=power10.  */
Packit Service 949dd0
  if ((GLRO (dl_hwcap2) & PPC_FEATURE2_ARCH_3_1) == 0
Packit Service 949dd0
      || (GLRO (dl_hwcap2) & PPC_FEATURE2_MMA) == 0)
Packit Service 949dd0
    return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
Packit Service 949dd0
  ++active;
Packit Service 949dd0
Packit Service 949dd0
  return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
Packit Service 949dd0
}