29 |
%ifdef MARK_FUNCS |
%ifdef MARK_FUNCS |
30 |
global _%1:function %1.endfunc-%1 |
global _%1:function %1.endfunc-%1 |
31 |
%define %1 _%1:function %1.endfunc-%1 |
%define %1 _%1:function %1.endfunc-%1 |
32 |
|
%define ENDFUNC .endfunc |
33 |
%else |
%else |
34 |
global _%1 |
global _%1 |
35 |
%define %1 _%1 |
%define %1 _%1 |
36 |
|
%define ENDFUNC |
37 |
%endif |
%endif |
38 |
%else |
%else |
39 |
%ifdef MARK_FUNCS |
%ifdef MARK_FUNCS |
40 |
global %1:function %1.endfunc-%1 |
global %1:function %1.endfunc-%1 |
41 |
|
%define ENDFUNC .endfunc |
42 |
%else |
%else |
43 |
global %1 |
global %1 |
44 |
|
%define ENDFUNC |
45 |
%endif |
%endif |
46 |
%endif |
%endif |
47 |
%endmacro |
%endmacro |
134 |
COPY_H_SSE_RND0 |
COPY_H_SSE_RND0 |
135 |
ret |
ret |
136 |
|
|
137 |
.rounding1 |
.rounding1: |
138 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
139 |
movq mm7, [mmx_one] |
movq mm7, [mmx_one] |
140 |
COPY_H_SSE_RND1 |
COPY_H_SSE_RND1 |
145 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
146 |
COPY_H_SSE_RND1 |
COPY_H_SSE_RND1 |
147 |
ret |
ret |
148 |
.endfunc |
ENDFUNC |
149 |
|
|
150 |
;=========================================================================== |
;=========================================================================== |
151 |
; |
; |
206 |
COPY_V_SSE_RND0 |
COPY_V_SSE_RND0 |
207 |
ret |
ret |
208 |
|
|
209 |
.rounding1 |
.rounding1: |
210 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
211 |
movq mm7, [mmx_one] |
movq mm7, [mmx_one] |
212 |
movq mm2, [eax] ; loop invariant |
movq mm2, [eax] ; loop invariant |
220 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
221 |
COPY_V_SSE_RND1 |
COPY_V_SSE_RND1 |
222 |
ret |
ret |
223 |
.endfunc |
ENDFUNC |
224 |
|
|
225 |
;=========================================================================== |
;=========================================================================== |
226 |
; |
; |
350 |
COPY_HV_SSE_RND0 |
COPY_HV_SSE_RND0 |
351 |
ret |
ret |
352 |
|
|
353 |
.rounding1 |
.rounding1: |
354 |
COPY_HV_SSE_RND1 |
COPY_HV_SSE_RND1 |
355 |
add ecx, edx |
add ecx, edx |
356 |
COPY_HV_SSE_RND1 |
COPY_HV_SSE_RND1 |
359 |
add ecx, edx |
add ecx, edx |
360 |
COPY_HV_SSE_RND1 |
COPY_HV_SSE_RND1 |
361 |
ret |
ret |
362 |
.endfunc |
ENDFUNC |
363 |
|
|
364 |
;=========================================================================== |
;=========================================================================== |
365 |
; |
; |
386 |
COPY_H_SSE_RND0 |
COPY_H_SSE_RND0 |
387 |
ret |
ret |
388 |
|
|
389 |
.rounding1 |
.rounding1: |
390 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
391 |
movq mm7, [mmx_one] |
movq mm7, [mmx_one] |
392 |
COPY_H_SSE_RND1 |
COPY_H_SSE_RND1 |
393 |
lea ecx, [ecx+2*edx] |
lea ecx, [ecx+2*edx] |
394 |
COPY_H_SSE_RND1 |
COPY_H_SSE_RND1 |
395 |
ret |
ret |
396 |
.endfunc |
ENDFUNC |
397 |
|
|
398 |
;=========================================================================== |
;=========================================================================== |
399 |
; |
; |
421 |
COPY_V_SSE_RND0 |
COPY_V_SSE_RND0 |
422 |
ret |
ret |
423 |
|
|
424 |
.rounding1 |
.rounding1: |
425 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
426 |
movq mm7, [mmx_one] |
movq mm7, [mmx_one] |
427 |
movq mm2, [eax] ; loop invariant |
movq mm2, [eax] ; loop invariant |
431 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
432 |
COPY_V_SSE_RND1 |
COPY_V_SSE_RND1 |
433 |
ret |
ret |
434 |
.endfunc |
ENDFUNC |
435 |
|
|
436 |
;=========================================================================== |
;=========================================================================== |
437 |
; |
; |
478 |
COPY_HV_SSE_RND0 |
COPY_HV_SSE_RND0 |
479 |
ret |
ret |
480 |
|
|
481 |
.rounding1 |
.rounding1: |
482 |
COPY_HV_SSE_RND1 |
COPY_HV_SSE_RND1 |
483 |
add ecx, edx |
add ecx, edx |
484 |
COPY_HV_SSE_RND1 |
COPY_HV_SSE_RND1 |
485 |
ret |
ret |
486 |
.endfunc |
ENDFUNC |
487 |
|
|
488 |
;=========================================================================== |
;=========================================================================== |
489 |
; |
; |
551 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
552 |
ADD_FF 0, edx |
ADD_FF 0, edx |
553 |
EPILOG |
EPILOG |
554 |
.endfunc |
ENDFUNC |
555 |
|
|
556 |
;=========================================================================== |
;=========================================================================== |
557 |
; |
; |
613 |
ADD_FH_RND0 0, edx |
ADD_FH_RND0 0, edx |
614 |
EPILOG |
EPILOG |
615 |
|
|
616 |
.Loop1 |
.Loop1: |
617 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
; we use: (i+j)/2 = ( i+j+1 )/2 - (i^j)&1 |
618 |
; movq mm7, [mmx_one] |
; movq mm7, [mmx_one] |
619 |
ADD_FH_RND1 0, edx |
ADD_FH_RND1 0, edx |
627 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
628 |
ADD_FH_RND1 0, edx |
ADD_FH_RND1 0, edx |
629 |
EPILOG |
EPILOG |
630 |
.endfunc |
ENDFUNC |
631 |
|
|
632 |
|
|
633 |
;=========================================================================== |
;=========================================================================== |
688 |
ADD_8_HF_RND0 |
ADD_8_HF_RND0 |
689 |
EPILOG |
EPILOG |
690 |
|
|
691 |
.Loop1 |
.Loop1: |
692 |
movq mm0, [eax] ; loop invariant |
movq mm0, [eax] ; loop invariant |
693 |
movq mm7, [mmx_one] |
movq mm7, [mmx_one] |
694 |
|
|
703 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
704 |
ADD_8_HF_RND1 |
ADD_8_HF_RND1 |
705 |
EPILOG |
EPILOG |
706 |
.endfunc |
ENDFUNC |
707 |
|
|
708 |
; The trick is to correct the result of 'pavgb' with some combination of the |
; The trick is to correct the result of 'pavgb' with some combination of the |
709 |
; lsb's of the 4 input values i,j,k,l, and their intermediate 'pavgb' (s and t). |
; lsb's of the 4 input values i,j,k,l, and their intermediate 'pavgb' (s and t). |
833 |
ADD_HH_RND0 |
ADD_HH_RND0 |
834 |
EPILOG |
EPILOG |
835 |
|
|
836 |
.Loop1 |
.Loop1: |
837 |
ADD_HH_RND1 |
ADD_HH_RND1 |
838 |
add ecx, edx |
add ecx, edx |
839 |
ADD_HH_RND1 |
ADD_HH_RND1 |
843 |
ADD_HH_RND1 |
ADD_HH_RND1 |
844 |
|
|
845 |
EPILOG |
EPILOG |
846 |
.endfunc |
ENDFUNC |
847 |
|
|
848 |
|
|
849 |
%ifidn __OUTPUT_FORMAT__,elf |
%ifidn __OUTPUT_FORMAT__,elf |