2020-12-25 15:30:46 +00:00
|
|
|
/* Test case for <sys/platform/x86.h> interface
|
2022-01-01 18:54:23 +00:00
|
|
|
Copyright (C) 2015-2022 Free Software Foundation, Inc.
|
2015-08-13 10:37:47 +00:00
|
|
|
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
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
|
|
|
<https://www.gnu.org/licenses/>. */
|
2015-08-13 10:37:47 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
2018-12-03 13:54:43 +00:00
|
|
|
#include <stdio.h>
|
x86: Install <sys/platform/x86.h> [BZ #26124]
Install <sys/platform/x86.h> so that programmers can do
#if __has_include(<sys/platform/x86.h>)
#include <sys/platform/x86.h>
#endif
...
if (CPU_FEATURE_USABLE (SSE2))
...
if (CPU_FEATURE_USABLE (AVX2))
...
<sys/platform/x86.h> exports only:
enum
{
COMMON_CPUID_INDEX_1 = 0,
COMMON_CPUID_INDEX_7,
COMMON_CPUID_INDEX_80000001,
COMMON_CPUID_INDEX_D_ECX_1,
COMMON_CPUID_INDEX_80000007,
COMMON_CPUID_INDEX_80000008,
COMMON_CPUID_INDEX_7_ECX_1,
/* Keep the following line at the end. */
COMMON_CPUID_INDEX_MAX
};
struct cpuid_features
{
struct cpuid_registers cpuid;
struct cpuid_registers usable;
};
struct cpu_features
{
struct cpu_features_basic basic;
struct cpuid_features features[COMMON_CPUID_INDEX_MAX];
};
/* Get a pointer to the CPU features structure. */
extern const struct cpu_features *__x86_get_cpu_features
(unsigned int max) __attribute__ ((const));
Since all feature checks are done through macros, programs compiled with
a newer <sys/platform/x86.h> are compatible with the older glibc binaries
as long as the layout of struct cpu_features is identical. The features
array can be expanded with backward binary compatibility for both .o and
.so files. When COMMON_CPUID_INDEX_MAX is increased to support new
processor features, __x86_get_cpu_features in the older glibc binaries
returns NULL and HAS_CPU_FEATURE/CPU_FEATURE_USABLE return false on the
new processor feature. No new symbol version is neeeded.
Both CPU_FEATURE_USABLE and HAS_CPU_FEATURE are provided. HAS_CPU_FEATURE
can be used to identify processor features.
Note: Although GCC has __builtin_cpu_supports, it only supports a subset
of <sys/platform/x86.h> and it is equivalent to CPU_FEATURE_USABLE. It
doesn't support HAS_CPU_FEATURE.
2020-06-30 01:30:54 +00:00
|
|
|
#include <sys/platform/x86.h>
|
2018-12-03 13:54:43 +00:00
|
|
|
#include <support/check.h>
|
|
|
|
|
2021-06-05 13:42:20 +00:00
|
|
|
#define CHECK_CPU_FEATURE_PRESENT(name) \
|
|
|
|
{ \
|
|
|
|
if (CPU_FEATURE_PRESENT (name)) \
|
|
|
|
printf (" " #name "\n"); \
|
2018-12-03 13:54:43 +00:00
|
|
|
}
|
|
|
|
|
2021-06-05 13:42:20 +00:00
|
|
|
#define CHECK_CPU_FEATURE_ACTIVE(name) \
|
|
|
|
{ \
|
|
|
|
if (CPU_FEATURE_ACTIVE(name)) \
|
|
|
|
printf (" " #name "\n"); \
|
2018-12-03 13:54:43 +00:00
|
|
|
}
|
|
|
|
|
2015-08-13 10:37:47 +00:00
|
|
|
static int
|
|
|
|
do_test (void)
|
|
|
|
{
|
2018-12-03 13:54:43 +00:00
|
|
|
#ifdef __SSE2__
|
2021-06-05 13:42:20 +00:00
|
|
|
TEST_VERIFY_EXIT (CPU_FEATURE_PRESENT (SSE2));
|
2018-12-03 13:54:43 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
printf ("CPU features:\n");
|
2021-06-05 13:42:20 +00:00
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSE3);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PCLMULQDQ);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (DTES64);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MONITOR);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (DS_CPL);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (VMX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SMX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (EIST);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TM2);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSSE3);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CNXT_ID);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SDBG);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FMA);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CMPXCHG16B);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XTPRUPDCTRL);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PDCM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PCID);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (DCA);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSE4_1);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSE4_2);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (X2APIC);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MOVBE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (POPCNT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TSC_DEADLINE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AES);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XSAVE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (OSXSAVE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (F16C);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RDRAND);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FPU);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (VME);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (DE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PSE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TSC);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MSR);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PAE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MCE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CX8);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (APIC);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SEP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MTRR);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PGE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MCA);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CMOV);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PAT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PSE_36);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PSN);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CLFSH);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (DS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (ACPI);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MMX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FXSR);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSE2);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (HTT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PBE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FSGSBASE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TSC_ADJUST);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SGX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (BMI1);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (HLE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX2);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SMEP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (BMI2);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (ERMS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (INVPCID);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RTM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RDT_M);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (DEPR_FPU_CS_DS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MPX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RDT_A);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512F);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512DQ);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RDSEED);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (ADX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SMAP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_IFMA);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CLFLUSHOPT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CLWB);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TRACE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512PF);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512ER);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512CD);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SHA);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512BW);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512VL);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PREFETCHWT1);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_VBMI);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (UMIP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PKU);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (OSPKE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (WAITPKG);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_VBMI2);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SHSTK);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (GFNI);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (VAES);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (VPCLMULQDQ);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_VNNI);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_BITALG);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_VPOPCNTDQ);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RDPID);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (KL);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CLDEMOTE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MOVDIRI);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MOVDIR64B);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (ENQCMD);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SGX_LC);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PKS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_4VNNIW);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_4FMAPS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FSRM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (UINTR);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_VP2INTERSECT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (MD_CLEAR);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RTM_ALWAYS_ABORT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SERIALIZE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (HYBRID);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TSXLDTRK);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PCONFIG);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (IBT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AMX_BF16);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_FP16);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AMX_TILE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AMX_INT8);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (IBRS_IBPB);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (STIBP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (L1D_FLUSH);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (ARCH_CAPABILITIES);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (CORE_CAPABILITIES);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSBD);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (LAHF64_SAHF64);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SVM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (LZCNT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SSE4A);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PREFETCHW);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XOP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (LWP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FMA4);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (TBM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (SYSCALL_SYSRET);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (NX);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PAGE1GB);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (RDTSCP);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (LM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XSAVEOPT);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XSAVEC);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XGETBV_ECX_1);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XSAVES);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (XFD);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (INVARIANT_TSC);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (WBNOINVD);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX_VNNI);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AVX512_BF16);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FZLRM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FSRS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (FSRCS);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (HRESET);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (LAM);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (AESKLE);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (WIDE_KL);
|
|
|
|
CHECK_CPU_FEATURE_PRESENT (PTWRITE);
|
2018-12-03 13:54:43 +00:00
|
|
|
|
2021-06-05 13:42:20 +00:00
|
|
|
printf ("Possible CPU features:\n");
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSE3);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PCLMULQDQ);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (DTES64);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MONITOR);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (DS_CPL);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (VMX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SMX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (EIST);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TM2);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSSE3);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CNXT_ID);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SDBG);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FMA);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CMPXCHG16B);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XTPRUPDCTRL);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PDCM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PCID);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (DCA);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSE4_1);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSE4_2);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (X2APIC);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MOVBE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (POPCNT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TSC_DEADLINE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AES);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XSAVE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (OSXSAVE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (F16C);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RDRAND);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FPU);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (VME);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (DE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PSE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TSC);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MSR);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PAE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MCE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CX8);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (APIC);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SEP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MTRR);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PGE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MCA);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CMOV);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PAT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PSE_36);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PSN);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CLFSH);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (DS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (ACPI);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MMX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FXSR);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSE2);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (HTT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PBE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FSGSBASE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TSC_ADJUST);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SGX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (BMI1);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (HLE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX2);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SMEP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (BMI2);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (ERMS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (INVPCID);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RTM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RDT_M);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (DEPR_FPU_CS_DS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MPX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RDT_A);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512F);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512DQ);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RDSEED);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (ADX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SMAP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_IFMA);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CLFLUSHOPT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CLWB);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TRACE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512PF);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512ER);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512CD);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SHA);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512BW);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512VL);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PREFETCHWT1);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_VBMI);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (UMIP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PKU);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (OSPKE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (WAITPKG);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_VBMI2);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SHSTK);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (GFNI);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (VAES);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (VPCLMULQDQ);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_VNNI);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_BITALG);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_VPOPCNTDQ);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RDPID);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (KL);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CLDEMOTE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MOVDIRI);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MOVDIR64B);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (ENQCMD);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SGX_LC);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PKS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_4VNNIW);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_4FMAPS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FSRM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_VP2INTERSECT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (MD_CLEAR);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RTM_ALWAYS_ABORT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SERIALIZE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (HYBRID);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TSXLDTRK);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PCONFIG);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (IBT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AMX_BF16);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_FP16);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AMX_TILE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AMX_INT8);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (IBRS_IBPB);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (STIBP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (L1D_FLUSH);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (ARCH_CAPABILITIES);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (CORE_CAPABILITIES);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSBD);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (LAHF64_SAHF64);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SVM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (LZCNT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SSE4A);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PREFETCHW);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XOP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (LWP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FMA4);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (TBM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (SYSCALL_SYSRET);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (NX);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PAGE1GB);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (RDTSCP);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (LM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XSAVEOPT);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XSAVEC);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XGETBV_ECX_1);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XSAVES);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (XFD);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (INVARIANT_TSC);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (WBNOINVD);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX_VNNI);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AVX512_BF16);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FZLRM);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FSRS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (FSRCS);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (AESKLE);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (WIDE_KL);
|
|
|
|
CHECK_CPU_FEATURE_ACTIVE (PTWRITE);
|
2018-12-03 13:54:43 +00:00
|
|
|
|
2015-08-13 10:37:47 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-03 13:54:43 +00:00
|
|
|
#include <support/test-driver.c>
|