1 /**************************************************************************
3 * Copyright 2008 Dennis Smit
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * on the rights to use, copy, modify, merge, publish, distribute, sub
10 * license, and/or sell copies of the Software, and to permit persons to whom
11 * the Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20 * AUTHORS, COPYRIGHT HOLDERS, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
23 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25 ***************************************************************************/
29 * CPU feature detection.
32 * @author Based on the work of Eric Anholt <anholt@FreeBSD.org>
35 #ifndef _UTIL_CPU_DETECT_H
36 #define _UTIL_CPU_DETECT_H
39 #include "pipe/p_compiler.h"
40 #include "pipe/p_config.h"
48 struct util_cpu_caps
{
54 unsigned cores_per_L3
;
64 unsigned has_sse4_1
:1;
65 unsigned has_sse4_2
:1;
66 unsigned has_popcnt
:1;
72 unsigned has_3dnow_ext
:1;
74 unsigned has_altivec
:1;
79 unsigned has_avx512f
:1;
80 unsigned has_avx512dq
:1;
81 unsigned has_avx512ifma
:1;
82 unsigned has_avx512pf
:1;
83 unsigned has_avx512er
:1;
84 unsigned has_avx512cd
:1;
85 unsigned has_avx512bw
:1;
86 unsigned has_avx512vl
:1;
87 unsigned has_avx512vbmi
:1;
90 extern struct util_cpu_caps
93 void util_cpu_detect(void);
101 #endif /* _UTIL_CPU_DETECT_H */