File: cpu_arch_macros.hpp

package info (click to toggle)
primecount 7.16%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,724 kB
  • sloc: cpp: 18,769; ansic: 102; makefile: 89; sh: 86
file content (31 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
///
/// @file  cpu_arch_macros.hpp
///
/// Copyright (C) 2025 Kim Walisch, <kim.walisch@gmail.com>
///
/// This file is distributed under the BSD License. See the COPYING
/// file in the top level directory.
///

#ifndef CPU_ARCH_MACROS_HPP
#define CPU_ARCH_MACROS_HPP

// Needed for __has_include
#include <macros.hpp>

#if defined(__ARM_FEATURE_SVE) && \
    __has_include(<arm_sve.h>)
  #define ENABLE_ARM_SVE
#elif defined(__AVX512F__) && \
      defined(__AVX512VPOPCNTDQ__) && \
      __has_include(<immintrin.h>)
  #define ENABLE_AVX512_VPOPCNT
#elif defined(ENABLE_MULTIARCH_ARM_SVE)
  #define ENABLE_PORTABLE_POPCNT64
#elif defined(ENABLE_MULTIARCH_AVX512_VPOPCNT)
  #define ENABLE_PORTABLE_POPCNT64
#else
  #define ENABLE_PORTABLE_POPCNT64
#endif

#endif