[cvs] / xvidcore / src / utils / x86_asm / mem_transfer_mmx.asm Repository:
ViewVC logotype

Annotation of /xvidcore/src/utils/x86_asm/mem_transfer_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (view) (download)

1 : edgomez 1.10 ;/****************************************************************************
2 : Isibaar 1.1 ; *
3 : edgomez 1.10 ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * - 8<->16 bit transfer functions -
5 : Isibaar 1.1 ; *
6 : edgomez 1.10 ; * Copyright (C) 2001 Peter Ross <pross@xvid.org>
7 :     ; * 2001 Michael Militzer <isibaar@xvid.org>
8 :     ; * 2002 Pascal Massimino <skal@planet-d.net>
9 : edgomez 1.9 ; *
10 : edgomez 1.10 ; * This program is free software ; you can redistribute it and/or modify
11 :     ; * it under the terms of the GNU General Public License as published by
12 :     ; * the Free Software Foundation ; either version 2 of the License, or
13 :     ; * (at your option) any later version.
14 : edgomez 1.9 ; *
15 : edgomez 1.10 ; * This program is distributed in the hope that it will be useful,
16 :     ; * but WITHOUT ANY WARRANTY ; without even the implied warranty of
17 :     ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 :     ; * GNU General Public License for more details.
19 : edgomez 1.9 ; *
20 : edgomez 1.10 ; * You should have received a copy of the GNU General Public License
21 :     ; * along with this program ; if not, write to the Free Software
22 :     ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 : Isibaar 1.1 ; *
24 : Isibaar 1.19 ; * $Id: mem_transfer_mmx.asm,v 1.18 2008/08/19 09:06:48 Isibaar Exp $
25 : Isibaar 1.1 ; *
26 : edgomez 1.10 ; ***************************************************************************/
27 : Isibaar 1.1
28 : edgomez 1.10 BITS 32
29 : Isibaar 1.1
30 : edgomez 1.10 %macro cglobal 1
31 : Isibaar 1.1 %ifdef PREFIX
32 : edgomez 1.14 %ifdef MARK_FUNCS
33 : edgomez 1.15 global _%1:function %1.endfunc-%1
34 :     %define %1 _%1:function %1.endfunc-%1
35 : Isibaar 1.19 %define ENDFUNC .endfunc
36 : edgomez 1.14 %else
37 :     global _%1
38 :     %define %1 _%1
39 : Isibaar 1.19 %define ENDFUNC
40 : edgomez 1.14 %endif
41 : Isibaar 1.1 %else
42 : edgomez 1.14 %ifdef MARK_FUNCS
43 : edgomez 1.15 global %1:function %1.endfunc-%1
44 : Isibaar 1.19 %define ENDFUNC .endfunc
45 : edgomez 1.14 %else
46 :     global %1
47 : Isibaar 1.19 %define ENDFUNC
48 : edgomez 1.14 %endif
49 : Isibaar 1.1 %endif
50 :     %endmacro
51 :    
52 : edgomez 1.10 ;=============================================================================
53 :     ; Read only data
54 :     ;=============================================================================
55 :    
56 :     %ifdef FORMAT_COFF
57 : edgomez 1.13 SECTION .rodata
58 : edgomez 1.10 %else
59 : edgomez 1.13 SECTION .rodata align=16
60 : edgomez 1.10 %endif
61 :    
62 :     ALIGN 16
63 :     mmx_one:
64 :     dw 1, 1, 1, 1
65 :    
66 :     ;=============================================================================
67 :     ; Code
68 :     ;=============================================================================
69 : Isibaar 1.1
70 : edgomez 1.10 SECTION .text
71 : Isibaar 1.1
72 : Isibaar 1.5 cglobal transfer_8to16copy_mmx
73 :     cglobal transfer_16to8copy_mmx
74 :     cglobal transfer_8to16sub_mmx
75 : edgomez 1.9 cglobal transfer_8to16subro_mmx
76 : Isibaar 1.5 cglobal transfer_8to16sub2_mmx
77 :     cglobal transfer_8to16sub2_xmm
78 : syskin 1.16 cglobal transfer_8to16sub2ro_xmm
79 : Isibaar 1.5 cglobal transfer_16to8add_mmx
80 :     cglobal transfer8x8_copy_mmx
81 : suxen_drol 1.17 cglobal transfer8x4_copy_mmx
82 : Isibaar 1.1
83 : edgomez 1.10 ;-----------------------------------------------------------------------------
84 : Isibaar 1.1 ;
85 :     ; void transfer_8to16copy_mmx(int16_t * const dst,
86 :     ; const uint8_t * const src,
87 :     ; uint32_t stride);
88 :     ;
89 : edgomez 1.10 ;-----------------------------------------------------------------------------
90 : Isibaar 1.1
91 : Isibaar 1.5 %macro COPY_8_TO_16 1
92 :     movq mm0, [eax]
93 :     movq mm1, [eax+edx]
94 :     movq mm2, mm0
95 :     movq mm3, mm1
96 :     punpcklbw mm0, mm7
97 :     movq [ecx+%1*32], mm0
98 :     punpcklbw mm1, mm7
99 :     movq [ecx+%1*32+16], mm1
100 :     punpckhbw mm2, mm7
101 :     punpckhbw mm3, mm7
102 : edgomez 1.10 lea eax, [eax+2*edx]
103 : Isibaar 1.5 movq [ecx+%1*32+8], mm2
104 :     movq [ecx+%1*32+24], mm3
105 :     %endmacro
106 :    
107 : edgomez 1.10 ALIGN 16
108 : Isibaar 1.5 transfer_8to16copy_mmx:
109 : Isibaar 1.1
110 : Isibaar 1.5 mov ecx, [esp+ 4] ; Dst
111 :     mov eax, [esp+ 8] ; Src
112 :     mov edx, [esp+12] ; Stride
113 : edgomez 1.10 pxor mm7, mm7
114 : Isibaar 1.5
115 :     COPY_8_TO_16 0
116 :     COPY_8_TO_16 1
117 :     COPY_8_TO_16 2
118 :     COPY_8_TO_16 3
119 :     ret
120 : Isibaar 1.19 ENDFUNC
121 : Isibaar 1.1
122 : edgomez 1.10 ;-----------------------------------------------------------------------------
123 : Isibaar 1.1 ;
124 :     ; void transfer_16to8copy_mmx(uint8_t * const dst,
125 :     ; const int16_t * const src,
126 :     ; uint32_t stride);
127 :     ;
128 : edgomez 1.10 ;-----------------------------------------------------------------------------
129 : Isibaar 1.1
130 : Isibaar 1.5 %macro COPY_16_TO_8 1
131 :     movq mm0, [eax+%1*32]
132 :     movq mm1, [eax+%1*32+8]
133 :     packuswb mm0, mm1
134 :     movq [ecx], mm0
135 :     movq mm2, [eax+%1*32+16]
136 :     movq mm3, [eax+%1*32+24]
137 :     packuswb mm2, mm3
138 :     movq [ecx+edx], mm2
139 :     %endmacro
140 :    
141 : edgomez 1.10 ALIGN 16
142 : Isibaar 1.5 transfer_16to8copy_mmx:
143 : Isibaar 1.1
144 : Isibaar 1.5 mov ecx, [esp+ 4] ; Dst
145 :     mov eax, [esp+ 8] ; Src
146 :     mov edx, [esp+12] ; Stride
147 :    
148 :     COPY_16_TO_8 0
149 :     lea ecx,[ecx+2*edx]
150 :     COPY_16_TO_8 1
151 :     lea ecx,[ecx+2*edx]
152 :     COPY_16_TO_8 2
153 :     lea ecx,[ecx+2*edx]
154 :     COPY_16_TO_8 3
155 :     ret
156 : Isibaar 1.19 ENDFUNC
157 : Isibaar 1.1
158 : edgomez 1.10 ;-----------------------------------------------------------------------------
159 : Isibaar 1.1 ;
160 :     ; void transfer_8to16sub_mmx(int16_t * const dct,
161 :     ; uint8_t * const cur,
162 :     ; const uint8_t * const ref,
163 :     ; const uint32_t stride);
164 :     ;
165 : edgomez 1.10 ;-----------------------------------------------------------------------------
166 : Isibaar 1.1
167 : edgomez 1.9 ; when second argument == 1, reference (ebx) block is to current (eax)
168 :     %macro COPY_8_TO_16_SUB 2
169 : Isibaar 1.5 movq mm0, [eax] ; cur
170 :     movq mm2, [eax+edx]
171 : edgomez 1.12 movq mm1, mm0
172 :     movq mm3, mm2
173 : Isibaar 1.5
174 : edgomez 1.12 punpcklbw mm0, mm7
175 :     punpcklbw mm2, mm7
176 : Isibaar 1.5 movq mm4, [ebx] ; ref
177 : edgomez 1.12 punpckhbw mm1, mm7
178 :     punpckhbw mm3, mm7
179 : Isibaar 1.5 movq mm5, [ebx+edx] ; ref
180 :    
181 : edgomez 1.12 movq mm6, mm4
182 : edgomez 1.9 %if %2 == 1
183 : Isibaar 1.5 movq [eax], mm4
184 :     movq [eax+edx], mm5
185 : edgomez 1.9 %endif
186 : edgomez 1.12 punpcklbw mm4, mm7
187 :     punpckhbw mm6, mm7
188 :     psubsw mm0, mm4
189 :     psubsw mm1, mm6
190 :     movq mm6, mm5
191 :     punpcklbw mm5, mm7
192 :     punpckhbw mm6, mm7
193 :     psubsw mm2, mm5
194 : edgomez 1.10 lea eax, [eax+2*edx]
195 : edgomez 1.12 psubsw mm3, mm6
196 : Isibaar 1.5 lea ebx,[ebx+2*edx]
197 :    
198 :     movq [ecx+%1*32+ 0], mm0 ; dst
199 : edgomez 1.9 movq [ecx+%1*32+ 8], mm1
200 :     movq [ecx+%1*32+16], mm2
201 :     movq [ecx+%1*32+24], mm3
202 : Isibaar 1.5 %endmacro
203 :    
204 : edgomez 1.10 ALIGN 16
205 : Isibaar 1.5 transfer_8to16sub_mmx:
206 :     mov ecx, [esp + 4] ; Dst
207 :     mov eax, [esp + 8] ; Cur
208 :     push ebx
209 :     mov ebx, [esp+4+12] ; Ref
210 :     mov edx, [esp+4+16] ; Stride
211 :     pxor mm7, mm7
212 : Isibaar 1.1
213 : edgomez 1.9 COPY_8_TO_16_SUB 0, 1
214 :     COPY_8_TO_16_SUB 1, 1
215 :     COPY_8_TO_16_SUB 2, 1
216 :     COPY_8_TO_16_SUB 3, 1
217 :    
218 :     pop ebx
219 :     ret
220 : Isibaar 1.19 ENDFUNC
221 : edgomez 1.9
222 :    
223 : edgomez 1.10 ALIGN 16
224 : edgomez 1.9 transfer_8to16subro_mmx:
225 :     mov ecx, [esp + 4] ; Dst
226 :     mov eax, [esp + 8] ; Cur
227 :     push ebx
228 :     mov ebx, [esp+4+12] ; Ref
229 :     mov edx, [esp+4+16] ; Stride
230 :     pxor mm7, mm7
231 :    
232 :     COPY_8_TO_16_SUB 0, 0
233 :     COPY_8_TO_16_SUB 1, 0
234 :     COPY_8_TO_16_SUB 2, 0
235 :     COPY_8_TO_16_SUB 3, 0
236 : Isibaar 1.1
237 : Isibaar 1.5 pop ebx
238 :     ret
239 : Isibaar 1.19 ENDFUNC
240 : edgomez 1.9
241 : Isibaar 1.1
242 : edgomez 1.10 ;-----------------------------------------------------------------------------
243 : Isibaar 1.5 ;
244 :     ; void transfer_8to16sub2_mmx(int16_t * const dct,
245 :     ; uint8_t * const cur,
246 :     ; const uint8_t * ref1,
247 :     ; const uint8_t * ref2,
248 :     ; const uint32_t stride)
249 :     ;
250 : edgomez 1.10 ;-----------------------------------------------------------------------------
251 : Isibaar 1.5
252 :     %macro COPY_8_TO_16_SUB2_MMX 1
253 :     movq mm0, [eax] ; cur
254 :     movq mm2, [eax+edx]
255 : edgomez 1.12
256 : edgomez 1.10 ; mm4 <- (ref1+ref2+1) / 2
257 : Isibaar 1.5 movq mm4, [ebx] ; ref1
258 :     movq mm1, [esi] ; ref2
259 : edgomez 1.12 movq mm6, mm4
260 :     movq mm3, mm1
261 :     punpcklbw mm4, mm7
262 :     punpcklbw mm1, mm7
263 :     punpckhbw mm6, mm7
264 :     punpckhbw mm3, mm7
265 :     paddusw mm4, mm1
266 :     paddusw mm6, mm3
267 :     paddusw mm4, [mmx_one]
268 :     paddusw mm6, [mmx_one]
269 :     psrlw mm4, 1
270 :     psrlw mm6, 1
271 :     packuswb mm4, mm6
272 :     movq [eax], mm4
273 :    
274 :     ; mm5 <- (ref1+ref2+1) / 2
275 : Isibaar 1.5 movq mm5, [ebx+edx] ; ref1
276 :     movq mm1, [esi+edx] ; ref2
277 : edgomez 1.12 movq mm6, mm5
278 :     movq mm3, mm1
279 :     punpcklbw mm5, mm7
280 :     punpcklbw mm1, mm7
281 :     punpckhbw mm6, mm7
282 :     punpckhbw mm3, mm7
283 :     paddusw mm5, mm1
284 :     paddusw mm6, mm3
285 :     paddusw mm5, [mmx_one]
286 :     paddusw mm6, [mmx_one]
287 : edgomez 1.10 lea esi, [esi+2*edx]
288 : edgomez 1.12 psrlw mm5, 1
289 :     psrlw mm6, 1
290 :     packuswb mm5, mm6
291 :     movq [eax+edx], mm5
292 :    
293 :     movq mm1, mm0
294 :     movq mm3, mm2
295 :     punpcklbw mm0, mm7
296 :     punpcklbw mm2, mm7
297 :     punpckhbw mm1, mm7
298 :     punpckhbw mm3, mm7
299 :    
300 :     movq mm6, mm4
301 :     punpcklbw mm4, mm7
302 :     punpckhbw mm6, mm7
303 :     psubsw mm0, mm4
304 :     psubsw mm1, mm6
305 :     movq mm6, mm5
306 :     punpcklbw mm5, mm7
307 :     punpckhbw mm6, mm7
308 :     psubsw mm2, mm5
309 : edgomez 1.10 lea eax, [eax+2*edx]
310 : edgomez 1.12 psubsw mm3, mm6
311 : edgomez 1.10 lea ebx, [ebx+2*edx]
312 : edgomez 1.12
313 : Isibaar 1.5 movq [ecx+%1*32+ 0], mm0 ; dst
314 : edgomez 1.10 movq [ecx+%1*32+ 8], mm1
315 :     movq [ecx+%1*32+16], mm2
316 :     movq [ecx+%1*32+24], mm3
317 : Isibaar 1.5 %endmacro
318 : Isibaar 1.1
319 : edgomez 1.10 ALIGN 16
320 : Isibaar 1.5 transfer_8to16sub2_mmx:
321 :     mov ecx, [esp + 4] ; Dst
322 :     mov eax, [esp + 8] ; Cur
323 :     push ebx
324 :     mov ebx, [esp+4+12] ; Ref1
325 :     push esi
326 :     mov esi, [esp+8+16] ; Ref2
327 :     mov edx, [esp+8+20] ; Stride
328 :     pxor mm7, mm7
329 :    
330 :     COPY_8_TO_16_SUB2_MMX 0
331 :     COPY_8_TO_16_SUB2_MMX 1
332 :     COPY_8_TO_16_SUB2_MMX 2
333 :     COPY_8_TO_16_SUB2_MMX 3
334 :    
335 :     pop esi
336 :     pop ebx
337 :     ret
338 : Isibaar 1.19 ENDFUNC
339 : Isibaar 1.1
340 : edgomez 1.10 ;-----------------------------------------------------------------------------
341 : edgomez 1.2 ;
342 :     ; void transfer_8to16sub2_xmm(int16_t * const dct,
343 : Isibaar 1.5 ; uint8_t * const cur,
344 :     ; const uint8_t * ref1,
345 :     ; const uint8_t * ref2,
346 :     ; const uint32_t stride)
347 : edgomez 1.2 ;
348 : edgomez 1.10 ;-----------------------------------------------------------------------------
349 : edgomez 1.2
350 : Isibaar 1.5 %macro COPY_8_TO_16_SUB2_SSE 1
351 :     movq mm0, [eax] ; cur
352 :     movq mm2, [eax+edx]
353 : edgomez 1.12 movq mm1, mm0
354 :     movq mm3, mm2
355 : Isibaar 1.5
356 : edgomez 1.12 punpcklbw mm0, mm7
357 :     punpcklbw mm2, mm7
358 : edgomez 1.10 movq mm4, [ebx] ; ref1
359 : Isibaar 1.5 pavgb mm4, [esi] ; ref2
360 : edgomez 1.12 movq [eax], mm4
361 :     punpckhbw mm1, mm7
362 :     punpckhbw mm3, mm7
363 : edgomez 1.10 movq mm5, [ebx+edx] ; ref
364 : Isibaar 1.5 pavgb mm5, [esi+edx] ; ref2
365 : edgomez 1.12 movq [eax+edx], mm5
366 : Isibaar 1.5
367 : edgomez 1.12 movq mm6, mm4
368 :     punpcklbw mm4, mm7
369 :     punpckhbw mm6, mm7
370 :     psubsw mm0, mm4
371 :     psubsw mm1, mm6
372 : edgomez 1.10 lea esi, [esi+2*edx]
373 : edgomez 1.12 movq mm6, mm5
374 :     punpcklbw mm5, mm7
375 :     punpckhbw mm6, mm7
376 :     psubsw mm2, mm5
377 : edgomez 1.10 lea eax, [eax+2*edx]
378 : edgomez 1.12 psubsw mm3, mm6
379 : edgomez 1.10 lea ebx, [ebx+2*edx]
380 : edgomez 1.12
381 : Isibaar 1.5 movq [ecx+%1*32+ 0], mm0 ; dst
382 : edgomez 1.10 movq [ecx+%1*32+ 8], mm1
383 :     movq [ecx+%1*32+16], mm2
384 :     movq [ecx+%1*32+24], mm3
385 : Isibaar 1.5 %endmacro
386 :    
387 : edgomez 1.10 ALIGN 16
388 : Isibaar 1.5 transfer_8to16sub2_xmm:
389 :     mov ecx, [esp + 4] ; Dst
390 :     mov eax, [esp + 8] ; Cur
391 :     push ebx
392 :     mov ebx, [esp+4+12] ; Ref1
393 :     push esi
394 :     mov esi, [esp+8+16] ; Ref2
395 :     mov edx, [esp+8+20] ; Stride
396 :     pxor mm7, mm7
397 :    
398 :     COPY_8_TO_16_SUB2_SSE 0
399 :     COPY_8_TO_16_SUB2_SSE 1
400 :     COPY_8_TO_16_SUB2_SSE 2
401 :     COPY_8_TO_16_SUB2_SSE 3
402 :    
403 :     pop esi
404 :     pop ebx
405 :     ret
406 : Isibaar 1.19 ENDFUNC
407 : Isibaar 1.1
408 : syskin 1.16
409 :     ;-----------------------------------------------------------------------------
410 :     ;
411 :     ; void transfer_8to16sub2ro_xmm(int16_t * const dct,
412 :     ; const uint8_t * const cur,
413 :     ; const uint8_t * ref1,
414 :     ; const uint8_t * ref2,
415 :     ; const uint32_t stride)
416 :     ;
417 :     ;-----------------------------------------------------------------------------
418 :    
419 :     %macro COPY_8_TO_16_SUB2RO_SSE 1
420 :     movq mm0, [eax] ; cur
421 :     movq mm2, [eax+edx]
422 :     movq mm1, mm0
423 :     movq mm3, mm2
424 :    
425 :     punpcklbw mm0, mm7
426 :     punpcklbw mm2, mm7
427 :     movq mm4, [ebx] ; ref1
428 :     pavgb mm4, [esi] ; ref2
429 :     punpckhbw mm1, mm7
430 :     punpckhbw mm3, mm7
431 :     movq mm5, [ebx+edx] ; ref
432 :     pavgb mm5, [esi+edx] ; ref2
433 :    
434 :     movq mm6, mm4
435 :     punpcklbw mm4, mm7
436 :     punpckhbw mm6, mm7
437 :     psubsw mm0, mm4
438 :     psubsw mm1, mm6
439 :     lea esi, [esi+2*edx]
440 :     movq mm6, mm5
441 :     punpcklbw mm5, mm7
442 :     punpckhbw mm6, mm7
443 :     psubsw mm2, mm5
444 :     lea eax, [eax+2*edx]
445 :     psubsw mm3, mm6
446 :     lea ebx, [ebx+2*edx]
447 :    
448 :     movq [ecx+%1*32+ 0], mm0 ; dst
449 :     movq [ecx+%1*32+ 8], mm1
450 :     movq [ecx+%1*32+16], mm2
451 :     movq [ecx+%1*32+24], mm3
452 :     %endmacro
453 :    
454 :     ALIGN 16
455 :     transfer_8to16sub2ro_xmm:
456 :     pxor mm7, mm7
457 :     mov ecx, [esp + 4] ; Dst
458 :     mov eax, [esp + 8] ; Cur
459 :     push ebx
460 :     mov ebx, [esp+4+12] ; Ref1
461 :     push esi
462 :     mov esi, [esp+8+16] ; Ref2
463 :     mov edx, [esp+8+20] ; Stride
464 :    
465 :     COPY_8_TO_16_SUB2RO_SSE 0
466 :     COPY_8_TO_16_SUB2RO_SSE 1
467 :     COPY_8_TO_16_SUB2RO_SSE 2
468 :     COPY_8_TO_16_SUB2RO_SSE 3
469 :    
470 :     pop esi
471 :     pop ebx
472 :     ret
473 : Isibaar 1.19 ENDFUNC
474 : syskin 1.16
475 :    
476 : edgomez 1.10 ;-----------------------------------------------------------------------------
477 : Isibaar 1.1 ;
478 :     ; void transfer_16to8add_mmx(uint8_t * const dst,
479 :     ; const int16_t * const src,
480 :     ; uint32_t stride);
481 :     ;
482 : edgomez 1.10 ;-----------------------------------------------------------------------------
483 : Isibaar 1.1
484 : Isibaar 1.5 %macro COPY_16_TO_8_ADD 1
485 : edgomez 1.12 movq mm0, [ecx]
486 :     movq mm2, [ecx+edx]
487 :     movq mm1, mm0
488 :     movq mm3, mm2
489 :     punpcklbw mm0, mm7
490 :     punpcklbw mm2, mm7
491 :     punpckhbw mm1, mm7
492 :     punpckhbw mm3, mm7
493 :     paddsw mm0, [eax+%1*32+ 0]
494 :     paddsw mm1, [eax+%1*32+ 8]
495 :     paddsw mm2, [eax+%1*32+16]
496 :     paddsw mm3, [eax+%1*32+24]
497 :     packuswb mm0, mm1
498 :     movq [ecx], mm0
499 :     packuswb mm2, mm3
500 :     movq [ecx+edx], mm2
501 : Isibaar 1.5 %endmacro
502 : Isibaar 1.1
503 :    
504 : edgomez 1.10 ALIGN 16
505 : Isibaar 1.5 transfer_16to8add_mmx:
506 :     mov ecx, [esp+ 4] ; Dst
507 :     mov eax, [esp+ 8] ; Src
508 :     mov edx, [esp+12] ; Stride
509 : edgomez 1.12 pxor mm7, mm7
510 : Isibaar 1.5
511 :     COPY_16_TO_8_ADD 0
512 :     lea ecx,[ecx+2*edx]
513 :     COPY_16_TO_8_ADD 1
514 :     lea ecx,[ecx+2*edx]
515 :     COPY_16_TO_8_ADD 2
516 :     lea ecx,[ecx+2*edx]
517 :     COPY_16_TO_8_ADD 3
518 :     ret
519 : Isibaar 1.19 ENDFUNC
520 : Isibaar 1.1
521 : edgomez 1.10 ;-----------------------------------------------------------------------------
522 : Isibaar 1.1 ;
523 :     ; void transfer8x8_copy_mmx(uint8_t * const dst,
524 :     ; const uint8_t * const src,
525 :     ; const uint32_t stride);
526 :     ;
527 :     ;
528 : edgomez 1.10 ;-----------------------------------------------------------------------------
529 : Isibaar 1.1
530 : edgomez 1.12 %macro COPY_8_TO_8 0
531 :     movq mm0, [eax]
532 :     movq mm1, [eax+edx]
533 :     movq [ecx], mm0
534 :     lea eax, [eax+2*edx]
535 :     movq [ecx+edx], mm1
536 :     %endmacro
537 :    
538 : edgomez 1.10 ALIGN 16
539 : Isibaar 1.5 transfer8x8_copy_mmx:
540 : edgomez 1.12 mov ecx, [esp+ 4] ; Dst
541 : edgomez 1.11 mov eax, [esp+ 8] ; Src
542 : Isibaar 1.5 mov edx, [esp+12] ; Stride
543 : edgomez 1.12
544 :     COPY_8_TO_8
545 :     lea ecx,[ecx+2*edx]
546 :     COPY_8_TO_8
547 :     lea ecx,[ecx+2*edx]
548 :     COPY_8_TO_8
549 :     lea ecx,[ecx+2*edx]
550 :     COPY_8_TO_8
551 :     ret
552 : Isibaar 1.19 ENDFUNC
553 : edgomez 1.15
554 : suxen_drol 1.17 ;-----------------------------------------------------------------------------
555 :     ;
556 :     ; void transfer8x4_copy_mmx(uint8_t * const dst,
557 :     ; const uint8_t * const src,
558 :     ; const uint32_t stride);
559 :     ;
560 :     ;
561 :     ;-----------------------------------------------------------------------------
562 :    
563 :     ALIGN 16
564 :     transfer8x4_copy_mmx:
565 :     mov ecx, [esp+ 4] ; Dst
566 :     mov eax, [esp+ 8] ; Src
567 :     mov edx, [esp+12] ; Stride
568 :    
569 :     COPY_8_TO_8
570 :     lea ecx,[ecx+2*edx]
571 :     COPY_8_TO_8
572 :     ret
573 : Isibaar 1.19 ENDFUNC
574 : suxen_drol 1.17
575 : Isibaar 1.18
576 :     %ifidn __OUTPUT_FORMAT__,elf
577 :     section ".note.GNU-stack" noalloc noexec nowrite progbits
578 :     %endif
579 :    

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4