Lift
Library of parallel computing primitives for GPUs and multi-core CPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
x86_64_cpuid.h
Go to the documentation of this file.
1 /*
2  * Lift
3  *
4  * Copyright (c) 2014-2015, NVIDIA CORPORATION
5  * Copyright (c) 2015, Nuno Subtil <subtil@gmail.com>
6  * Copyright (c) 2015, Roche Molecular Systems Inc.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  * * Neither the name of the copyright holders nor the names of its
17  * contributors may be used to endorse or promote products derived from
18  * this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #pragma once
33 
34 namespace lift {
35 
36 namespace x86_64 {
37 
38 // constants for CPUID leaf 1
39 static constexpr uint32 CPUID_BIT_EDX_SSE = 1 << 25;
40 static constexpr uint32 CPUID_BIT_EDX_SSE2 = 1 << 26;
41 static constexpr uint32 CPUID_BIT_ECX_SSE3 = 1 << 0;
42 static constexpr uint32 CPUID_BIT_ECX_SSSE3 = 1 << 9;
43 static constexpr uint32 CPUID_BIT_ECX_SSE41 = 1 << 19;
44 static constexpr uint32 CPUID_BIT_ECX_SSE42 = 1 << 20;
45 static constexpr uint32 CPUID_BIT_ECX_FMA = 1 << 12;
46 static constexpr uint32 CPUID_BIT_ECX_F16C = 1 << 29;
47 static constexpr uint32 CPUID_BIT_ECX_AVX = 1 << 28;
48 
49 // CPUID leaf 7
50 static constexpr uint32 CPUID_BIT_EBX_AVX2 = 1 << 5;
51 
52 // CPUID leaf 0x80000001
53 static constexpr uint32 CPUID_BIT_ECX_SSE4A = 1 << 6;
54 static constexpr uint32 CPUID_BIT_ECX_FMA4 = 1 << 16;
55 static constexpr uint32 CPUID_BIT_ECX_XOP = 1 << 11;
56 
57 }
58 
59 }
static constexpr uint32 CPUID_BIT_ECX_XOP
Definition: x86_64_cpuid.h:55
uint32_t uint32
Definition: types.h:43
static constexpr uint32 CPUID_BIT_ECX_SSE42
Definition: x86_64_cpuid.h:44
static constexpr uint32 CPUID_BIT_EBX_AVX2
Definition: x86_64_cpuid.h:50
static constexpr uint32 CPUID_BIT_ECX_SSE4A
Definition: x86_64_cpuid.h:53
static constexpr uint32 CPUID_BIT_ECX_AVX
Definition: x86_64_cpuid.h:47
static constexpr uint32 CPUID_BIT_ECX_FMA4
Definition: x86_64_cpuid.h:54
static constexpr uint32 CPUID_BIT_ECX_SSE3
Definition: x86_64_cpuid.h:41
static constexpr uint32 CPUID_BIT_EDX_SSE
Definition: x86_64_cpuid.h:39
static constexpr uint32 CPUID_BIT_ECX_FMA
Definition: x86_64_cpuid.h:45
static constexpr uint32 CPUID_BIT_ECX_F16C
Definition: x86_64_cpuid.h:46
static constexpr uint32 CPUID_BIT_ECX_SSSE3
Definition: x86_64_cpuid.h:42
static constexpr uint32 CPUID_BIT_ECX_SSE41
Definition: x86_64_cpuid.h:43
static constexpr uint32 CPUID_BIT_EDX_SSE2
Definition: x86_64_cpuid.h:40