comparison libvo/aclib.c @ 28921:62f0032e736a

Get rid of pointless preprocessor condition indirection and use ARCH_X86 directly instead of CAN_COMPILE_X86_ASM.
author diego
date Sun, 15 Mar 2009 10:01:02 +0000
parents b644796edd94
children 06540eb5ef6a
comparison
equal deleted inserted replaced
28920:49b76e202f98 28921:62f0032e736a
31 #define BLOCK_SIZE 4096 31 #define BLOCK_SIZE 4096
32 #define CONFUSION_FACTOR 0 32 #define CONFUSION_FACTOR 0
33 //Feel free to fine-tune the above 2, it might be possible to get some speedup with them :) 33 //Feel free to fine-tune the above 2, it might be possible to get some speedup with them :)
34 34
35 //#define STATISTICS 35 //#define STATISTICS
36 #if ARCH_X86
37 #define CAN_COMPILE_X86_ASM
38 #endif
39 36
40 //Note: we have MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one 37 //Note: we have MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one
41 //Plain C versions 38 //Plain C versions
42 //#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) 39 //#if !HAVE_MMX || defined (RUNTIME_CPUDETECT)
43 //#define COMPILE_C 40 //#define COMPILE_C
44 //#endif 41 //#endif
45 42
46 #ifdef CAN_COMPILE_X86_ASM 43 #if ARCH_X86
47 44
48 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) 45 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
49 #define COMPILE_MMX 46 #define COMPILE_MMX
50 #endif 47 #endif
51 48
153 #define HAVE_SSE2 1 150 #define HAVE_SSE2 1
154 #define RENAME(a) a ## _SSE 151 #define RENAME(a) a ## _SSE
155 #include "aclib_template.c" 152 #include "aclib_template.c"
156 #endif 153 #endif
157 154
158 #endif // CAN_COMPILE_X86_ASM 155 #endif /* ARCH_X86 */
159 156
160 157
161 #undef fast_memcpy 158 #undef fast_memcpy
162 void * fast_memcpy(void * to, const void * from, size_t len) 159 void * fast_memcpy(void * to, const void * from, size_t len)
163 { 160 {
164 #ifdef RUNTIME_CPUDETECT 161 #ifdef RUNTIME_CPUDETECT
165 #ifdef CAN_COMPILE_X86_ASM 162 #if ARCH_X86
166 // ordered per speed fasterst first 163 // ordered per speed fasterst first
167 if(gCpuCaps.hasSSE2) 164 if(gCpuCaps.hasSSE2)
168 fast_memcpy_SSE(to, from, len); 165 fast_memcpy_SSE(to, from, len);
169 else if(gCpuCaps.hasMMX2) 166 else if(gCpuCaps.hasMMX2)
170 fast_memcpy_MMX2(to, from, len); 167 fast_memcpy_MMX2(to, from, len);
171 else if(gCpuCaps.has3DNow) 168 else if(gCpuCaps.has3DNow)
172 fast_memcpy_3DNow(to, from, len); 169 fast_memcpy_3DNow(to, from, len);
173 else if(gCpuCaps.hasMMX) 170 else if(gCpuCaps.hasMMX)
174 fast_memcpy_MMX(to, from, len); 171 fast_memcpy_MMX(to, from, len);
175 else 172 else
176 #endif //CAN_COMPILE_X86_ASM 173 #endif
177 memcpy(to, from, len); // prior to mmx we use the standart memcpy 174 memcpy(to, from, len); // prior to mmx we use the standart memcpy
178 #else 175 #else
179 #if HAVE_SSE2 176 #if HAVE_SSE2
180 fast_memcpy_SSE(to, from, len); 177 fast_memcpy_SSE(to, from, len);
181 #elif HAVE_MMX2 178 #elif HAVE_MMX2
194 191
195 #undef mem2agpcpy 192 #undef mem2agpcpy
196 void * mem2agpcpy(void * to, const void * from, size_t len) 193 void * mem2agpcpy(void * to, const void * from, size_t len)
197 { 194 {
198 #ifdef RUNTIME_CPUDETECT 195 #ifdef RUNTIME_CPUDETECT
199 #ifdef CAN_COMPILE_X86_ASM 196 #if ARCH_X86
200 // ordered per speed fasterst first 197 // ordered per speed fasterst first
201 if(gCpuCaps.hasSSE2) 198 if(gCpuCaps.hasSSE2)
202 mem2agpcpy_SSE(to, from, len); 199 mem2agpcpy_SSE(to, from, len);
203 else if(gCpuCaps.hasMMX2) 200 else if(gCpuCaps.hasMMX2)
204 mem2agpcpy_MMX2(to, from, len); 201 mem2agpcpy_MMX2(to, from, len);
205 else if(gCpuCaps.has3DNow) 202 else if(gCpuCaps.has3DNow)
206 mem2agpcpy_3DNow(to, from, len); 203 mem2agpcpy_3DNow(to, from, len);
207 else if(gCpuCaps.hasMMX) 204 else if(gCpuCaps.hasMMX)
208 mem2agpcpy_MMX(to, from, len); 205 mem2agpcpy_MMX(to, from, len);
209 else 206 else
210 #endif //CAN_COMPILE_X86_ASM 207 #endif
211 memcpy(to, from, len); // prior to mmx we use the standart memcpy 208 memcpy(to, from, len); // prior to mmx we use the standart memcpy
212 #else 209 #else
213 #if HAVE_SSE2 210 #if HAVE_SSE2
214 mem2agpcpy_SSE(to, from, len); 211 mem2agpcpy_SSE(to, from, len);
215 #elif HAVE_MMX2 212 #elif HAVE_MMX2