annotate mp3lib/d_cpu.s @ 2316:bcb229557e9b

fixed alignment (static variables where sometimes not 8-byte aligned) added half uv interpolation support added prefetch BGR15 support in MMX (untested) (so BGR15,16,24,32 are supported) special unscaled height version (not much faster but it doesnt interpolate uv vertically)
author michael
date Sat, 20 Oct 2001 21:12:09 +0000
parents 92b0270f8f8a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 / ---------------------------------------------------------------------------
734
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
3 / Cpu function detect by Pontscho/fresh!mindworkz (c) 2000 - 2000
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
4 / 3dnow-dsp detection by Nick Kurshev (C) 2001
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 / ---------------------------------------------------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 .text
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 .globl CpuDetect
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 .globl ipentium
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 .globl a3dnow
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
12 .globl isse
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 / ---------------------------------------------------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 / in C: unsigned long CpuDetect( void );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 / return: cpu ident number.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 / ---------------------------------------------------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 CpuDetect:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 pushl %ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 pushl %ecx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 pushl %edx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22
738
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
23 pushfl
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
24 popl %eax
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
25 movl %eax,%ebx
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
26 xorl $0x00200000,%eax
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
27 pushl %eax
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
28 popfl
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
29 pushfl
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
30 popl %eax
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
31 cmpl %eax,%ebx
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
32 jz no_cpuid_cpudetect
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
33
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
34 movl $1,%eax
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 cpuid
738
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
36
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
37 jmp exit_cpudetect
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
38 no_cpuid_cpudetect:
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
39 xorl %eax,%eax
7705b51ab518 cpuid bug fixed. remelem.
pontscho
parents: 734
diff changeset
40 exit_cpudetect:
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 popl %edx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 popl %ecx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 popl %ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 ret
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 / ---------------------------------------------------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 / in C: unsigled long ipentium( void );
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
49 / return: 0 if this processor i386 or i486
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
50 / 1 otherwise
1253
87a31bbadd9a Minor fixes
nick
parents: 1245
diff changeset
51 / 3 if this cpu supports mmx
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 / ---------------------------------------------------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 ipentium:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 pushl %ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 pushl %ecx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 pushl %edx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 pushfl
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 popl %eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 movl %eax,%ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 xorl $0x00200000,%eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 pushl %eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 popfl
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 pushfl
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 popl %eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 cmpl %eax,%ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 jz no_cpuid
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 movl $1,%eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 cpuid
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
69 movl %eax, %ecx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
70 xorl %eax, %eax
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
71 shrl $8,%ecx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
72 cmpl $5,%ecx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
73 jb exit
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
74 incl %eax
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
75 test $0x00800000, %edx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
76 jz exit
1253
87a31bbadd9a Minor fixes
nick
parents: 1245
diff changeset
77 orl $2, %eax
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 jmp exit
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 no_cpuid:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 xorl %eax,%eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 exit:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 popl %edx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 popl %ecx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 popl %ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 ret
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 / ---------------------------------------------------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 / in C: unsigned long a3dnow( void );
734
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
89 / return: 0 if this processor does not support 3dnow!
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
90 / 1 otherwise
1253
87a31bbadd9a Minor fixes
nick
parents: 1245
diff changeset
91 / 3 if this cpu supports 3dnow-dsp extension
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 / ---------------------------------------------------------------------------
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 a3dnow:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 pushl %ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 pushl %edx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 pushl %ecx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 call ipentium
734
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
100 testl %eax,%eax
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
101 jz exit2
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 movl $0x80000000,%eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 cpuid
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 cmpl $0x80000000,%eax
1894
92b0270f8f8a Applied cpu detection fix by Kjetil Torgrim Homme <kjetilho at linpro dot no>.
atmos4
parents: 1253
diff changeset
106 jbe no3dnow
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 movl $0x80000001,%eax
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 cpuid
734
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
109 xorl %eax,%eax
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 testl $0x80000000,%edx
1894
92b0270f8f8a Applied cpu detection fix by Kjetil Torgrim Homme <kjetilho at linpro dot no>.
atmos4
parents: 1253
diff changeset
111 jz no3dnow
734
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
112 /// eax=1 - K6 3DNow!
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
113 inc %eax
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
114 testl $0x40000000,%edx
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
115 jz exit2
bab1d9b1056a K7 3dnow-dsp detection
nickols_k
parents: 1
diff changeset
116 /// eax=2 - K7 3DNowEx!
1253
87a31bbadd9a Minor fixes
nick
parents: 1245
diff changeset
117 orl $2, %eax
1894
92b0270f8f8a Applied cpu detection fix by Kjetil Torgrim Homme <kjetilho at linpro dot no>.
atmos4
parents: 1253
diff changeset
118 jmp exit2
92b0270f8f8a Applied cpu detection fix by Kjetil Torgrim Homme <kjetilho at linpro dot no>.
atmos4
parents: 1253
diff changeset
119 no3dnow:
92b0270f8f8a Applied cpu detection fix by Kjetil Torgrim Homme <kjetilho at linpro dot no>.
atmos4
parents: 1253
diff changeset
120 xorl %eax,%eax
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 exit2:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 popl %ecx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 popl %edx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 popl %ebx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 ret
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
127
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
128 / ---------------------------------------------------------------------------
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
129 / in C: unsigned long isse( void );
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
130 / return: 0 if this processor does not support sse
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
131 / 1 otherwise
1253
87a31bbadd9a Minor fixes
nick
parents: 1245
diff changeset
132 / 3 if this cpu supports sse2 extension
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
133 / ---------------------------------------------------------------------------
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
134 isse:
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
135 pushl %ebx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
136 pushl %edx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
137 pushl %ecx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
138
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
139 call ipentium
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
140 testl %eax,%eax
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
141 jz exit3
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
142
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
143 movl $1,%eax
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
144 cpuid
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
145 xorl %eax, %eax
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
146 testl $0x02000000,%edx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
147 jz exit3
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
148 incl %eax
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
149 testl $0x04000000,%edx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
150 jz exit3
1253
87a31bbadd9a Minor fixes
nick
parents: 1245
diff changeset
151 orl $2, %eax
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
152 exit3:
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
153 popl %ecx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
154 popl %edx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
155 popl %ebx
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 739
diff changeset
156 ret