Mercurial > mplayer.hg
annotate cpudetect.h @ 17892:2a37ab5a913e
1.226: Print the mute state on the OSD.
1.225: Fix up libaf unknown-format printing
1.224: last print on libaf to af_msg
1.223: [done by diego]
1.222: dwStart support for mencoder
author | kraymer |
---|---|
date | Sat, 18 Mar 2006 19:22:13 +0000 |
parents | 821f464b4d90 |
children | b5c6755ffa29 |
rev | line source |
---|---|
3146
3164eaa93396
non x86 fix (otherwise we would need #ifdef ARCH_X86 around every if(gCpuCaps.has...))
michael
parents:
2303
diff
changeset
|
1 #ifndef CPUDETECT_H |
3164eaa93396
non x86 fix (otherwise we would need #ifdef ARCH_X86 around every if(gCpuCaps.has...))
michael
parents:
2303
diff
changeset
|
2 #define CPUDETECT_H |
2268
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
3 |
2281 | 4 #define CPUTYPE_I386 3 |
5 #define CPUTYPE_I486 4 | |
6 #define CPUTYPE_I586 5 | |
7 #define CPUTYPE_I686 6 | |
2268
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
8 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
9 #ifdef ARCH_X86_64 |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
10 # define REGa rax |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
11 # define REGb rbx |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
12 # define REGSP rsp |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
13 # define REG_a "rax" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
14 # define REG_b "rbx" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
15 # define REG_c "rcx" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
16 # define REG_d "rdx" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
17 # define REG_S "rsi" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
18 # define REG_D "rdi" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
19 # define REG_SP "rsp" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
20 # define REG_BP "rbp" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
21 #else |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
22 # define REGa eax |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
23 # define REGb ebx |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
24 # define REGSP esp |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
25 # define REG_a "eax" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
26 # define REG_b "ebx" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
27 # define REG_c "ecx" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
28 # define REG_d "edx" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
29 # define REG_S "esi" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
30 # define REG_D "edi" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
31 # define REG_SP "esp" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
32 # define REG_BP "ebp" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
33 #endif |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10885
diff
changeset
|
34 |
2268
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
35 typedef struct cpucaps_s { |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
36 int cpuType; |
3403 | 37 int cpuStepping; |
2268
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
38 int hasMMX; |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
39 int hasMMX2; |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
40 int has3DNow; |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
41 int has3DNowExt; |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
42 int hasSSE; |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
43 int hasSSE2; |
3146
3164eaa93396
non x86 fix (otherwise we would need #ifdef ARCH_X86 around every if(gCpuCaps.has...))
michael
parents:
2303
diff
changeset
|
44 int isX86; |
8860 | 45 unsigned cl_size; /* size of cache line */ |
9003 | 46 int hasAltiVec; |
10885
685c416f12b5
cpuspeed detection for X86 TSC capable CPUs (also added TSC detection, should best be verified by some people with TSC/nonTSC capable CPUs)
atmos4
parents:
9003
diff
changeset
|
47 int hasTSC; |
2268
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
48 } CpuCaps; |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
49 |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
50 extern CpuCaps gCpuCaps; |
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
51 |
2301 | 52 void GetCpuCaps(CpuCaps *caps); |
2303 | 53 |
54 /* returned value is malloc()'ed so free() it after use */ | |
2301 | 55 char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]); |
2268
72ff2179d396
cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff
changeset
|
56 |
3146
3164eaa93396
non x86 fix (otherwise we would need #ifdef ARCH_X86 around every if(gCpuCaps.has...))
michael
parents:
2303
diff
changeset
|
57 #endif /* !CPUDETECT_H */ |
2301 | 58 |