1 #ifndef __X86__CPU_H__
2 #define __X86__CPU_H__
3 
4 typedef enum {
5 	RS_CPU_FLAG_MMX   = 1<<0,
6 	RS_CPU_FLAG_SSE   = 1<<1,
7 	RS_CPU_FLAG_CMOV  = 1<<2,
8 	RS_CPU_FLAG_3DNOW = 1<<3,
9 	RS_CPU_FLAG_3DNOW_EXT = 1<<4,
10 	RS_CPU_FLAG_AMD_ISSE  = 1<<5,
11 	RS_CPU_FLAG_SSE2 =  1<<6,
12 	RS_CPU_FLAG_SSE3 =  1<<7,
13 	RS_CPU_FLAG_SSSE3 =  1<<8,
14 	RS_CPU_FLAG_SSE4_1 =  1<<9,
15 	RS_CPU_FLAG_SSE4_2 =  1<<10,
16 	RS_CPU_FLAG_AVX =  1<<11
17 } RSCpuFlags;
18 
19 #if defined(__x86_64__)
20 #  define REG_a "rax"
21 #  define REG_b "rbx"
22 #  define REG_c "rcx"
23 #  define REG_d "rdx"
24 #  define REG_D "rdi"
25 #  define REG_S "rsi"
26 #  define PTR_SIZE "8"
27 
28 #  define REG_SP "rsp"
29 #  define REG_BP "rbp"
30 #  define REGBP   rbp
31 #  define REGa    rax
32 #  define REGb    rbx
33 #  define REGc    rcx
34 #  define REGSP   rsp
35 
36 #else
37 
38 #  define REG_a "eax"
39 #  define REG_b "ebx"
40 #  define REG_c "ecx"
41 #  define REG_d "edx"
42 #  define REG_D "edi"
43 #  define REG_S "esi"
44 #  define PTR_SIZE "4"
45 
46 #  define REG_SP "esp"
47 #  define REG_BP "ebp"
48 #  define REGBP   ebp
49 #  define REGa    eax
50 #  define REGb    ebx
51 #  define REGc    ecx
52 #  define REGSP   esp
53 #endif
54 
55 #endif
56