File: ax_cpuid_intel.m4

package info (click to toggle)
gmap 2019-01-24-1
  • links: PTS, VCS
  • area: non-free
  • in suites: buster
  • size: 30,600 kB
  • sloc: ansic: 474,114; perl: 6,114; sh: 4,261; makefile: 926
file content (60 lines) | stat: -rw-r--r-- 1,991 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
AC_DEFUN([AX_CPUID_INTEL],
[AC_REQUIRE([AC_PROG_CC])
AC_LANG_PUSH([C])
# Test for SSE2 support
  AC_MSG_CHECKING(for sse2 support)
  AC_RUN_IFELSE(
	[AC_LANG_PROGRAM([[#include <immintrin.h>]],
                         [[return _may_i_use_cpu_feature(_FEATURE_SSE2) ? 0 : 9;]])],
        [AC_MSG_RESULT(yes)
         ax_cv_cpu_has_sse2_ext=yes],
	[AC_MSG_RESULT(no)])

# Test for SSSE3 support
  AC_MSG_CHECKING(for ssse3 support)
  AC_RUN_IFELSE(
	[AC_LANG_PROGRAM([[#include <immintrin.h>]],
                         [[return _may_i_use_cpu_feature(_FEATURE_SSSE3) ? 0 : 9;]])],
        [AC_MSG_RESULT(yes)
         ax_cv_cpu_has_ssse3_ext=yes],
	[AC_MSG_RESULT(no)])

# Test for SSE4.1 support
  AC_MSG_CHECKING(for sse4.1 support)
  AC_RUN_IFELSE(
	[AC_LANG_PROGRAM([[#include <immintrin.h>]],
                         [[return _may_i_use_cpu_feature(_FEATURE_SSE4_1) ? 0 : 9;]])],
        [AC_MSG_RESULT(yes)
         ax_cv_cpu_has_sse41_ext=yes],
	[AC_MSG_RESULT(no)])

# Test for SSE4.2 support
  AC_MSG_CHECKING(for sse4.2 support)
  AC_RUN_IFELSE(
	[AC_LANG_PROGRAM([[#include <immintrin.h>]],
                         [[return _may_i_use_cpu_feature(_FEATURE_SSE4_2) ? 0 : 9;]])],
        [AC_MSG_RESULT(yes)
         ax_cv_cpu_has_sse42_ext=yes],
	[AC_MSG_RESULT(no)])

# Test for AVX2 support
  AC_MSG_CHECKING(for avx2 support)
  AC_RUN_IFELSE(
	[AC_LANG_PROGRAM([[#include <immintrin.h>]],
                         [[return _may_i_use_cpu_feature(_FEATURE_AVX2 | _FEATURE_FMA | _FEATURE_BMI | _FEATURE_LZCNT | _FEATURE_MOVBE) ? 0 : 9;]])],
        [AC_MSG_RESULT(yes)
         ax_cv_cpu_has_avx2_ext=yes],
	[AC_MSG_RESULT(no)])

# Test for AVX512 support
  AC_MSG_CHECKING(for avx512 support)
  AC_RUN_IFELSE(
	[AC_LANG_PROGRAM([[#include <immintrin.h>]],
                         [[return _may_i_use_cpu_feature(_FEATURE_AVX512F | _FEATURE_AVX512CD) ? 0 : 9;]])],
        [AC_MSG_RESULT(yes)
         ax_cv_cpu_has_avx512_ext=yes],
	[AC_MSG_RESULT(no)])

AC_LANG_POP([C])
])