100l, reorder check for AC3 format to avoid a possible memleak
[mplayer/glamo.git] / cpudetect.h
bloba98f97f0e46665fc691b7be59444bb6cdb07c8ed
1 #ifndef MPLAYER_CPUDETECT_H
2 #define MPLAYER_CPUDETECT_H
4 #define CPUTYPE_I386 3
5 #define CPUTYPE_I486 4
6 #define CPUTYPE_I586 5
7 #define CPUTYPE_I686 6
9 #ifdef ARCH_X86_64
10 # define REGa rax
11 # define REGb rbx
12 # define REGBP rbp
13 # define REGSP rsp
14 # define REG_a "rax"
15 # define REG_b "rbx"
16 # define REG_c "rcx"
17 # define REG_d "rdx"
18 # define REG_S "rsi"
19 # define REG_D "rdi"
20 # define REG_SP "rsp"
21 # define REG_BP "rbp"
22 #else
23 # define REGa eax
24 # define REGb ebx
25 # define REGBP ebp
26 # define REGSP esp
27 # define REG_a "eax"
28 # define REG_b "ebx"
29 # define REG_c "ecx"
30 # define REG_d "edx"
31 # define REG_S "esi"
32 # define REG_D "edi"
33 # define REG_SP "esp"
34 # define REG_BP "ebp"
35 #endif
37 typedef struct cpucaps_s {
38 int cpuType;
39 int cpuModel;
40 int cpuStepping;
41 int hasMMX;
42 int hasMMX2;
43 int has3DNow;
44 int has3DNowExt;
45 int hasSSE;
46 int hasSSE2;
47 int hasSSSE3;
48 int hasSSE4a;
49 int isX86;
50 unsigned cl_size; /* size of cache line */
51 int hasAltiVec;
52 int hasTSC;
53 } CpuCaps;
55 extern CpuCaps gCpuCaps;
57 void GetCpuCaps(CpuCaps *caps);
59 /* returned value is malloc()'ed so free() it after use */
60 char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]);
62 #endif /* MPLAYER_CPUDETECT_H */