1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; Copyright(c) 2011-2015 Intel Corporation All rights reserved.
4 ; Redistribution and use in source and binary forms, with or without
5 ; modification, are permitted provided that the following conditions
7 ; * Redistributions of source code must retain the above copyright
8 ; notice, this list of conditions and the following disclaimer.
9 ; * Redistributions in binary form must reproduce the above copyright
10 ; notice, this list of conditions and the following disclaimer in
11 ; the documentation and/or other materials provided with the
13 ; * Neither the name of Intel Corporation nor the names of its
14 ; contributors may be used to endorse or promote products derived
15 ; from this software without specific prior written permission.
17 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 ; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 %ifndef _REG_SIZES_ASM_
31 %define _REG_SIZES_ASM_
34 %ifidn __OUTPUT_FORMAT__, win64
35 %error nasm not supported in windows
41 %define EFLAGS_HAS_CPUID (1<<21)
42 %define FLAG_CPUID1_ECX_CLMUL (1<<1)
43 %define FLAG_CPUID1_EDX_SSE2 (1<<26)
44 %define FLAG_CPUID1_ECX_SSE3 (1)
45 %define FLAG_CPUID1_ECX_SSE4_1 (1<<19)
46 %define FLAG_CPUID1_ECX_SSE4_2 (1<<20)
47 %define FLAG_CPUID1_ECX_POPCNT (1<<23)
48 %define FLAG_CPUID1_ECX_AESNI (1<<25)
49 %define FLAG_CPUID1_ECX_OSXSAVE (1<<27)
50 %define FLAG_CPUID1_ECX_AVX (1<<28)
51 %define FLAG_CPUID1_EBX_AVX2 (1<<5)
53 %define FLAG_CPUID7_EBX_AVX2 (1<<5)
54 %define FLAG_CPUID7_EBX_AVX512F (1<<16)
55 %define FLAG_CPUID7_EBX_AVX512DQ (1<<17)
56 %define FLAG_CPUID7_EBX_AVX512IFMA (1<<21)
57 %define FLAG_CPUID7_EBX_AVX512PF (1<<26)
58 %define FLAG_CPUID7_EBX_AVX512ER (1<<27)
59 %define FLAG_CPUID7_EBX_AVX512CD (1<<28)
60 %define FLAG_CPUID7_EBX_AVX512BW (1<<30)
61 %define FLAG_CPUID7_EBX_AVX512VL (1<<31)
62 %define FLAG_CPUID7_ECX_AVX512VBMI (1<<1)
64 %define FLAGS_CPUID7_ECX_AVX512_G1 (FLAG_CPUID7_EBX_AVX512F | FLAG_CPUID7_EBX_AVX512VL | FLAG_CPUID7_EBX_AVX512BW | FLAG_CPUID7_EBX_AVX512CD | FLAG_CPUID7_EBX_AVX512DQ)
66 %define FLAG_XGETBV_EAX_XMM (1<<1)
67 %define FLAG_XGETBV_EAX_YMM (1<<2)
68 %define FLAG_XGETBV_EAX_XMM_YMM 0x6
69 %define FLAG_XGETBV_EAX_ZMM_OPM 0xe0
71 %define FLAG_CPUID1_EAX_AVOTON 0x000406d0
72 %define FLAG_CPUID1_EAX_STEP_MASK 0xfffffff0
74 ; define d and w variants for registers
121 %define DWORD(reg) reg %+ d
122 %define WORD(reg) reg %+ w
123 %define BYTE(reg) reg %+ b
125 %define XWORD(reg) reg %+ x
127 %ifidn __OUTPUT_FORMAT__,elf32
128 section .note.GNU-stack noalloc noexec nowrite progbits
131 %ifidn __OUTPUT_FORMAT__,elf64
132 section .note.GNU-stack noalloc noexec nowrite progbits
135 %ifidn __OUTPUT_FORMAT__, macho64
136 %define elf64 macho64
141 global %1_slver_%2%3%4
149 %endif ; ifndef _REG_SIZES_ASM_