21 |
; * along with this program ; if not, write to the Free Software |
; * along with this program ; if not, write to the Free Software |
22 |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
; * |
; * |
24 |
; * $Id: mem_transfer_mmx.asm,v 1.10 2004-03-22 22:36:24 edgomez Exp $ |
; * $Id: mem_transfer_mmx.asm,v 1.16 2004-12-19 13:16:50 syskin Exp $ |
25 |
; * |
; * |
26 |
; ***************************************************************************/ |
; ***************************************************************************/ |
27 |
|
|
29 |
|
|
30 |
%macro cglobal 1 |
%macro cglobal 1 |
31 |
%ifdef PREFIX |
%ifdef PREFIX |
32 |
|
%ifdef MARK_FUNCS |
33 |
|
global _%1:function %1.endfunc-%1 |
34 |
|
%define %1 _%1:function %1.endfunc-%1 |
35 |
|
%else |
36 |
global _%1 |
global _%1 |
37 |
%define %1 _%1 |
%define %1 _%1 |
38 |
|
%endif |
39 |
|
%else |
40 |
|
%ifdef MARK_FUNCS |
41 |
|
global %1:function %1.endfunc-%1 |
42 |
%else |
%else |
43 |
global %1 |
global %1 |
44 |
%endif |
%endif |
45 |
|
%endif |
46 |
%endmacro |
%endmacro |
47 |
|
|
48 |
;============================================================================= |
;============================================================================= |
50 |
;============================================================================= |
;============================================================================= |
51 |
|
|
52 |
%ifdef FORMAT_COFF |
%ifdef FORMAT_COFF |
53 |
SECTION .rodata data |
SECTION .rodata |
54 |
%else |
%else |
55 |
SECTION .rodata data align=16 |
SECTION .rodata align=16 |
56 |
%endif |
%endif |
57 |
|
|
58 |
ALIGN 16 |
ALIGN 16 |
71 |
cglobal transfer_8to16subro_mmx |
cglobal transfer_8to16subro_mmx |
72 |
cglobal transfer_8to16sub2_mmx |
cglobal transfer_8to16sub2_mmx |
73 |
cglobal transfer_8to16sub2_xmm |
cglobal transfer_8to16sub2_xmm |
74 |
|
cglobal transfer_8to16sub2ro_xmm |
75 |
cglobal transfer_16to8add_mmx |
cglobal transfer_16to8add_mmx |
76 |
cglobal transfer8x8_copy_mmx |
cglobal transfer8x8_copy_mmx |
77 |
|
|
112 |
COPY_8_TO_16 2 |
COPY_8_TO_16 2 |
113 |
COPY_8_TO_16 3 |
COPY_8_TO_16 3 |
114 |
ret |
ret |
115 |
|
.endfunc |
116 |
|
|
117 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
118 |
; |
; |
148 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
149 |
COPY_16_TO_8 3 |
COPY_16_TO_8 3 |
150 |
ret |
ret |
151 |
|
.endfunc |
152 |
|
|
153 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
154 |
; |
; |
212 |
|
|
213 |
pop ebx |
pop ebx |
214 |
ret |
ret |
215 |
|
.endfunc |
216 |
|
|
217 |
|
|
218 |
ALIGN 16 |
ALIGN 16 |
231 |
|
|
232 |
pop ebx |
pop ebx |
233 |
ret |
ret |
234 |
|
.endfunc |
235 |
|
|
236 |
|
|
237 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
330 |
pop esi |
pop esi |
331 |
pop ebx |
pop ebx |
332 |
ret |
ret |
333 |
|
.endfunc |
334 |
|
|
335 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
336 |
; |
; |
398 |
pop esi |
pop esi |
399 |
pop ebx |
pop ebx |
400 |
ret |
ret |
401 |
|
.endfunc |
402 |
|
|
403 |
|
|
404 |
|
;----------------------------------------------------------------------------- |
405 |
|
; |
406 |
|
; void transfer_8to16sub2ro_xmm(int16_t * const dct, |
407 |
|
; const uint8_t * const cur, |
408 |
|
; const uint8_t * ref1, |
409 |
|
; const uint8_t * ref2, |
410 |
|
; const uint32_t stride) |
411 |
|
; |
412 |
|
;----------------------------------------------------------------------------- |
413 |
|
|
414 |
|
%macro COPY_8_TO_16_SUB2RO_SSE 1 |
415 |
|
movq mm0, [eax] ; cur |
416 |
|
movq mm2, [eax+edx] |
417 |
|
movq mm1, mm0 |
418 |
|
movq mm3, mm2 |
419 |
|
|
420 |
|
punpcklbw mm0, mm7 |
421 |
|
punpcklbw mm2, mm7 |
422 |
|
movq mm4, [ebx] ; ref1 |
423 |
|
pavgb mm4, [esi] ; ref2 |
424 |
|
punpckhbw mm1, mm7 |
425 |
|
punpckhbw mm3, mm7 |
426 |
|
movq mm5, [ebx+edx] ; ref |
427 |
|
pavgb mm5, [esi+edx] ; ref2 |
428 |
|
|
429 |
|
movq mm6, mm4 |
430 |
|
punpcklbw mm4, mm7 |
431 |
|
punpckhbw mm6, mm7 |
432 |
|
psubsw mm0, mm4 |
433 |
|
psubsw mm1, mm6 |
434 |
|
lea esi, [esi+2*edx] |
435 |
|
movq mm6, mm5 |
436 |
|
punpcklbw mm5, mm7 |
437 |
|
punpckhbw mm6, mm7 |
438 |
|
psubsw mm2, mm5 |
439 |
|
lea eax, [eax+2*edx] |
440 |
|
psubsw mm3, mm6 |
441 |
|
lea ebx, [ebx+2*edx] |
442 |
|
|
443 |
|
movq [ecx+%1*32+ 0], mm0 ; dst |
444 |
|
movq [ecx+%1*32+ 8], mm1 |
445 |
|
movq [ecx+%1*32+16], mm2 |
446 |
|
movq [ecx+%1*32+24], mm3 |
447 |
|
%endmacro |
448 |
|
|
449 |
|
ALIGN 16 |
450 |
|
transfer_8to16sub2ro_xmm: |
451 |
|
pxor mm7, mm7 |
452 |
|
mov ecx, [esp + 4] ; Dst |
453 |
|
mov eax, [esp + 8] ; Cur |
454 |
|
push ebx |
455 |
|
mov ebx, [esp+4+12] ; Ref1 |
456 |
|
push esi |
457 |
|
mov esi, [esp+8+16] ; Ref2 |
458 |
|
mov edx, [esp+8+20] ; Stride |
459 |
|
|
460 |
|
COPY_8_TO_16_SUB2RO_SSE 0 |
461 |
|
COPY_8_TO_16_SUB2RO_SSE 1 |
462 |
|
COPY_8_TO_16_SUB2RO_SSE 2 |
463 |
|
COPY_8_TO_16_SUB2RO_SSE 3 |
464 |
|
|
465 |
|
pop esi |
466 |
|
pop ebx |
467 |
|
ret |
468 |
|
.endfunc |
469 |
|
|
470 |
|
|
471 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
472 |
; |
; |
511 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
512 |
COPY_16_TO_8_ADD 3 |
COPY_16_TO_8_ADD 3 |
513 |
ret |
ret |
514 |
|
.endfunc |
515 |
|
|
516 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
517 |
; |
; |
544 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
545 |
COPY_8_TO_8 |
COPY_8_TO_8 |
546 |
ret |
ret |
547 |
|
.endfunc |
548 |
|
|