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

Diff of /trunk/xvidcore/src/utils/x86_asm/mem_transfer_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3, Fri Mar 8 02:46:11 2002 UTC revision 1424, Mon Apr 12 15:49:56 2004 UTC
# Line 1  Line 1 
1  ;/**************************************************************************  ;/****************************************************************************
2  ; *  ; *
3  ; *     XVID MPEG-4 VIDEO CODEC  ; *     XVID MPEG-4 VIDEO CODEC
4  ; *     mmx 8bit<->16bit transfers  ; *  - 8<->16 bit transfer functions -
5  ; *  ; *
6  ; *     This program is an implementation of a part of one or more MPEG-4  ; *  Copyright (C) 2001 Peter Ross <pross@xvid.org>
7  ; *     Video tools as specified in ISO/IEC 14496-2 standard.  Those intending  ; *                2001 Michael Militzer <isibaar@xvid.org>
8  ; *     to use this software module in hardware or software products are  ; *                2002 Pascal Massimino <skal@planet-d.net>
9  ; *     advised that its use may infringe existing patents or copyrights, and  ; *                2004 Jean-Marc Bastide <jmtest@voila.fr>
 ; *     any such use would be at such party's own risk.  The original  
 ; *     developer of this software module and his/her company, and subsequent  
 ; *     editors and their companies, will have no liability for use of this  
 ; *     software or modifications or derivatives thereof.  
10  ; *  ; *
11  ; *     This program is free software; you can redistribute it and/or modify  ; *     This program is free software; you can redistribute it and/or modify
12  ; *     it under the terms of the GNU General Public License as published by  ; *     it under the terms of the GNU General Public License as published by
# Line 24  Line 20 
20  ; *  ; *
21  ; *     You should have received a copy of the GNU General Public License  ; *     You should have received a copy of the GNU General Public License
22  ; *     along with this program; if not, write to the Free Software  ; *     along with this program; if not, write to the Free Software
23  ; *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
24  ; *  ; *
25  ; *************************************************************************/  ; * $Id: mem_transfer_mmx.asm,v 1.11 2004-04-12 15:49:56 edgomez Exp $
   
 ;/**************************************************************************  
 ; *  
 ; *     History:  
 ; *  
 ; * 07.01.2002  merge functions from compensate_mmx; rename functions  
 ; *     07.11.2001      initial version; (c)2001 peter ross <pross@cs.rmit.edu.au>  
26  ; *  ; *
27  ; *************************************************************************/  ; ***************************************************************************/
28    
29    BITS 32
 bits 32  
30    
31  %macro cglobal 1  %macro cglobal 1
32          %ifdef PREFIX          %ifdef PREFIX
# Line 49  Line 37 
37          %endif          %endif
38  %endmacro  %endmacro
39    
40    ;=============================================================================
41    ; Read only data
42    ;=============================================================================
43    
44  section .text  %ifdef FORMAT_COFF
45    SECTION .rodata data
46    %else
47    SECTION .rodata data align=16
48    %endif
49    
50    ALIGN 16
51    mmx_one:
52            dw 1, 1, 1, 1
53    
54    ;=============================================================================
55    ; Code
56    ;=============================================================================
57    
58  ;===========================================================================  SECTION .text
59    
60    cglobal transfer_8to16copy_mmx
61    cglobal transfer_16to8copy_mmx
62    cglobal transfer_8to16sub_mmx
63    cglobal transfer_8to16subro_mmx
64    cglobal transfer_8to16sub2_mmx
65    cglobal transfer_8to16sub2_xmm
66    cglobal transfer_16to8add_mmx
67    cglobal transfer8x8_copy_mmx
68    
69    ;-----------------------------------------------------------------------------
70  ;  ;
71  ; void transfer_8to16copy_mmx(int16_t * const dst,  ; void transfer_8to16copy_mmx(int16_t * const dst,
72  ;                                                       const uint8_t * const src,  ;                                                       const uint8_t * const src,
73  ;                                                       uint32_t stride);  ;                                                       uint32_t stride);
74  ;  ;
75  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 align 16  
 cglobal transfer_8to16copy_mmx  
 transfer_8to16copy_mmx  
   
                 push    esi  
                 push    edi  
   
                 mov     edi, [esp + 8 + 4]              ; dst  
                 mov     esi, [esp + 8 + 8]              ; src  
                 mov ecx, [esp + 8 + 12]         ; stride  
   
                 pxor mm7, mm7                           ; mm7 = zero  
76    
77                  mov eax, 8  %macro COPY_8_TO_16 1
78      movq mm0, [eax]
79  .loop    movq mm1, [eax+edx]
80                  movq mm0, [esi]    movq mm2, mm0
81                  movq mm1, mm0    movq mm3, mm1
82                  punpcklbw mm0, mm7              ; mm01 = unpack([src])    punpcklbw mm0, mm7
83                  punpckhbw mm1, mm7    movq [ecx+%1*32], mm0
84      punpcklbw mm1, mm7
85                  movq [edi], mm0                 ; [dst] = mm01    movq [ecx+%1*32+16], mm1
86                  movq [edi + 8], mm1    punpckhbw mm2, mm7
87      punpckhbw mm3, mm7
88      lea eax, [eax+2*edx]
89      movq [ecx+%1*32+8], mm2
90      movq [ecx+%1*32+24], mm3
91    %endmacro
92    
93                  add edi, 16  ALIGN 16
94                  add esi, ecx  transfer_8to16copy_mmx:
                 dec eax  
                 jnz .loop  
95    
96                  pop edi    mov ecx, [esp+ 4] ; Dst
97                  pop esi    mov eax, [esp+ 8] ; Src
98      mov edx, [esp+12] ; Stride
99      pxor mm7, mm7
100    
101      COPY_8_TO_16 0
102      COPY_8_TO_16 1
103      COPY_8_TO_16 2
104      COPY_8_TO_16 3
105                  ret                  ret
106    
107    ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
108  ;  ;
109  ; void transfer_16to8copy_mmx(uint8_t * const dst,  ; void transfer_16to8copy_mmx(uint8_t * const dst,
110  ;                                                       const int16_t * const src,  ;                                                       const int16_t * const src,
111  ;                                                       uint32_t stride);  ;                                                       uint32_t stride);
112  ;  ;
113  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 align 16  
 cglobal transfer_16to8copy_mmx  
 transfer_16to8copy_mmx  
   
                 push    esi  
                 push    edi  
   
                 mov     edi, [esp + 8 + 4]              ; dst  
                 mov     esi, [esp + 8 + 8]              ; src  
                 mov ecx, [esp + 8 + 12]         ; stride  
   
                 mov eax, 8  
114    
115  .loop  %macro COPY_16_TO_8 1
116                  movq mm0, [esi]    movq mm0, [eax+%1*32]
117                  packuswb mm0, [esi + 8]         ; mm0 = pack([src])    movq mm1, [eax+%1*32+8]
118      packuswb mm0, mm1
119                  movq [edi], mm0                         ; [dst] = mm0    movq [ecx], mm0
120      movq mm2, [eax+%1*32+16]
121      movq mm3, [eax+%1*32+24]
122      packuswb mm2, mm3
123      movq [ecx+edx], mm2
124    %endmacro
125    
126                  add esi, 16  ALIGN 16
127                  add edi, ecx  transfer_16to8copy_mmx:
                 dec eax  
                 jnz .loop  
   
                 pop edi  
                 pop esi  
128    
129      mov ecx, [esp+ 4] ; Dst
130      mov eax, [esp+ 8] ; Src
131      mov edx, [esp+12] ; Stride
132    
133      COPY_16_TO_8 0
134      lea ecx,[ecx+2*edx]
135      COPY_16_TO_8 1
136      lea ecx,[ecx+2*edx]
137      COPY_16_TO_8 2
138      lea ecx,[ecx+2*edx]
139      COPY_16_TO_8 3
140                  ret                  ret
141    
142    ;-----------------------------------------------------------------------------
 ;===========================================================================  
143  ;  ;
144  ; void transfer_8to16sub_mmx(int16_t * const dct,  ; void transfer_8to16sub_mmx(int16_t * const dct,
145  ;                               uint8_t * const cur,  ;                               uint8_t * const cur,
146  ;                               const uint8_t * const ref,  ;                               const uint8_t * const ref,
147  ;                               const uint32_t stride);  ;                               const uint32_t stride);
148  ;  ;
149  ;===========================================================================  ;-----------------------------------------------------------------------------
 ;/**************************************************************************  
 ; *  
 ; *     History:  
 ; *  
 ; * 27.12.2001  renamed from 'compensate' to 'transfer_8to16sub'  
 ; * 02.12.2001  loop unrolled, code runs 10% faster now (Isibaar)  
 ; * 30.11.2001  16 pixels are processed per iteration (Isibaar)  
 ; * 30.11.2001  .text missing  
 ; *     06.11.2001      inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>  
 ; *  
 ; *************************************************************************/  
   
 align 16  
 cglobal transfer_8to16sub_mmx  
 transfer_8to16sub_mmx  
                 push    esi  
                 push    edi  
                 push    ebx  
   
                 mov     edi, [esp + 12 + 4]             ; dct [out]  
                 mov     edx, [esp + 12 + 8]             ; cur [in/out]  
                 mov     esi, [esp + 12 + 12]            ; ref [in]  
                 mov ecx, [esp + 12 + 16]                ; stride [in]  
150    
151                  mov eax, edx                            ; cur -> eax  ; when second argument == 1, reference (ebx) block is to current (eax)
152                  mov ebx, esi                            ; ref -> ebx  %macro COPY_8_TO_16_SUB 2
153                  add eax, ecx                            ; cur + stride    movq mm0, [eax]      ; cur
154                  add ebx, ecx                            ; ref + stride    movq mm2, [eax+edx]
155    
156      movq mm4, [ebx]      ; ref
157      movq mm5, [ebx+edx]  ; ref
158    
159    %if %2 == 1
160      movq [eax], mm4
161      movq [eax+edx], mm5
162    %endif
163    
164                  shl ecx, 1    lea eax, [eax+2*edx]
165    
166                  pxor mm7, mm7                   ; mm7 = zero    psubsb mm0,mm4
167      psubsb mm2,mm5
168      lea ebx,[ebx+2*edx]
169    
                 movq mm0, [edx]                 ; mm01 = [cur]  
170                  movq mm1, mm0                  movq mm1, mm0
   
                 punpcklbw mm0, mm7  
                 punpckhbw mm1, mm7  
   
                 movq mm4, [eax]  
                 movq mm5, mm4  
   
                 punpcklbw mm4, mm7  
                 punpckhbw mm5, mm7  
   
                 movq mm2, [esi]                 ; mm23 = [ref]  
171                  movq mm3, mm2                  movq mm3, mm2
   
                 movq mm6, [ebx]  
   
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
   
                 punpcklbw mm2, mm7  
                 punpckhbw mm3, mm7  
   
                 psubsw mm0, mm2                 ; mm01 -= mm23  
   
                 movq mm2, mm6  
   
                 punpcklbw mm2, mm7  
                 punpckhbw mm6, mm7  
   
                 psubsw mm1, mm3  
   
                 psubsw mm4, mm2  
                 psubsw mm5, mm6  
   
                 movq [edi], mm0                 ; dct[] = mm01  
                 movq [edi + 8], mm1  
                 movq [edi + 16], mm4  
                 movq [edi + 24], mm5  
   
                 add edx, ecx  
                 add esi, ecx  
                 add eax, ecx  
                 add ebx, ecx  
   
                 movq mm0, [edx]                 ; mm01 = [cur]  
                 movq mm1, mm0  
   
172                  punpcklbw mm0, mm7                  punpcklbw mm0, mm7
173                  punpckhbw mm1, mm7                  punpckhbw mm1, mm7
   
                 movq mm4, [eax]  
                 movq mm5, mm4  
   
                 punpcklbw mm4, mm7  
                 punpckhbw mm5, mm7  
   
                 movq mm2, [esi]                 ; mm23 = [ref]  
                 movq mm3, mm2  
   
                 movq mm6, [ebx]  
   
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
   
174                  punpcklbw mm2, mm7                  punpcklbw mm2, mm7
175                  punpckhbw mm3, mm7                  punpckhbw mm3, mm7
176    
177                  psubsw mm0, mm2                 ; mm01 -= mm23    movq [ecx+%1*32+ 0], mm0 ; dst
178      movq [ecx+%1*32+ 8], mm1
179                  movq mm2, mm6    movq [ecx+%1*32+16], mm2
180      movq [ecx+%1*32+24], mm3
181    %endmacro
182    
183                  punpcklbw mm2, mm7  ALIGN 16
184                  punpckhbw mm6, mm7  transfer_8to16sub_mmx:
185      mov ecx, [esp  + 4] ; Dst
186      mov eax, [esp  + 8] ; Cur
187      push ebx
188      mov ebx, [esp+4+12] ; Ref
189      mov edx, [esp+4+16] ; Stride
190      pxor mm7, mm7
191    
192                  psubsw mm1, mm3    COPY_8_TO_16_SUB 0, 1
193      COPY_8_TO_16_SUB 1, 1
194      COPY_8_TO_16_SUB 2, 1
195      COPY_8_TO_16_SUB 3, 1
196    
197                  psubsw mm4, mm2    pop ebx
198                  psubsw mm5, mm6    ret
199    
                 movq [edi + 32], mm0                    ; dct[] = mm01  
                 movq [edi + 40], mm1  
                 movq [edi + 48], mm4  
                 movq [edi + 56], mm5  
200    
201                  add edx, ecx  ALIGN 16
202                  add esi, ecx  transfer_8to16subro_mmx:
203                  add eax, ecx    mov ecx, [esp  + 4] ; Dst
204                  add ebx, ecx    mov eax, [esp  + 8] ; Cur
205      push ebx
206      mov ebx, [esp+4+12] ; Ref
207      mov edx, [esp+4+16] ; Stride
208      pxor mm7, mm7
209    
210                  movq mm0, [edx]                 ; mm01 = [cur]    COPY_8_TO_16_SUB 0, 0
211                  movq mm1, mm0    COPY_8_TO_16_SUB 1, 0
212      COPY_8_TO_16_SUB 2, 0
213      COPY_8_TO_16_SUB 3, 0
214    
215                  punpcklbw mm0, mm7    pop ebx
216                  punpckhbw mm1, mm7    ret
   
                 movq mm4, [eax]  
                 movq mm5, mm4  
217    
                 punpcklbw mm4, mm7  
                 punpckhbw mm5, mm7  
218    
219                  movq mm2, [esi]                 ; mm23 = [ref]  ;-----------------------------------------------------------------------------
220    ;
221    ; void transfer_8to16sub2_mmx(int16_t * const dct,
222    ;                               uint8_t * const cur,
223    ;                               const uint8_t * ref1,
224    ;                               const uint8_t * ref2,
225    ;                               const uint32_t stride)
226    ;
227    ;-----------------------------------------------------------------------------
228    
229    %macro COPY_8_TO_16_SUB2_MMX 1
230      movq mm0, [eax]      ; cur
231      movq mm2, [eax+edx]
232    
233      ; mm4 <- (ref1+ref2+1) / 2
234      ;(a+b+1)/2 = (a|b)-((a^b)>>1)
235      movq mm4, [ebx]      ; ref1
236      movq mm1, [esi]      ; ref2
237      movq mm3, mm4
238      pxor mm3,mm1
239      por mm4,mm1
240      pandn mm3,mm6
241      psrlq mm3,1
242      psubb mm4,mm3
243      movq [eax],mm4
244    
245      ; mm5 <- (ref1+ref2+1) / 2
246      movq mm5, [ebx+edx]  ; ref1
247      movq mm1, [esi+edx]  ; ref2
248      movq mm3, mm5
249      pxor mm3,mm1
250      por mm5,mm1
251      pandn mm3,mm6
252      psrlq mm3,1
253      psubb mm5,mm3
254      movq [eax+edx],mm5
255    
256      psubsb mm0,mm4
257      psubsb mm2,mm5
258      lea esi, [esi+2*edx]
259      movq mm1,mm0
260                  movq mm3, mm2                  movq mm3, mm2
261      lea eax, [eax+2*edx]
262                  movq mm6, [ebx]    punpcklbw mm0,mm7
   
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
   
263                  punpcklbw mm2, mm7                  punpcklbw mm2, mm7
264      lea ebx, [ebx+2*edx]
265      punpckhbw mm1,mm7
266                  punpckhbw mm3, mm7                  punpckhbw mm3, mm7
267    
268                  psubsw mm0, mm2                 ; mm01 -= mm23    movq [ecx+%1*32+ 0], mm0 ; dst
269      movq [ecx+%1*32+ 8], mm1
270                  movq mm2, mm6    movq [ecx+%1*32+16], mm2
271      movq [ecx+%1*32+24], mm3
272                  punpcklbw mm2, mm7  %endmacro
                 punpckhbw mm6, mm7  
273    
274                  psubsw mm1, mm3  ALIGN 16
275    transfer_8to16sub2_mmx:
276      mov ecx, [esp  + 4] ; Dst
277      mov eax, [esp  + 8] ; Cur
278      push ebx
279      mov ebx, [esp+4+12] ; Ref1
280      push esi
281      mov esi, [esp+8+16] ; Ref2
282      mov edx, [esp+8+20] ; Stride
283      pxor mm6,mm6
284      pcmpeqb mm5,mm5
285      pxor mm7, mm7
286      psubb mm6, mm5; mm6=1
287    
288                  psubsw mm4, mm2    COPY_8_TO_16_SUB2_MMX 0
289                  psubsw mm5, mm6    COPY_8_TO_16_SUB2_MMX 1
290      COPY_8_TO_16_SUB2_MMX 2
291      COPY_8_TO_16_SUB2_MMX 3
292    
293                  movq [edi + 64], mm0                    ; dct[] = mm01    pop esi
294                  movq [edi + 72], mm1    pop ebx
295                  movq [edi + 80], mm4    ret
                 movq [edi + 88], mm5  
296    
297                  add edx, ecx  ;-----------------------------------------------------------------------------
298                  add esi, ecx  ;
299                  add eax, ecx  ; void transfer_8to16sub2_xmm(int16_t * const dct,
300                  add ebx, ecx  ;                               uint8_t * const cur,
301    ;                               const uint8_t * ref1,
302    ;                               const uint8_t * ref2,
303    ;                               const uint32_t stride)
304    ;
305    ;-----------------------------------------------------------------------------
306    
307                  movq mm0, [edx]                 ; mm01 = [cur]  %macro COPY_8_TO_16_SUB2_SSE 1
308                  movq mm1, mm0    movq mm0, [eax]      ; cur
309      movq mm2, [eax+edx]
310    
311                  punpcklbw mm0, mm7    movq mm4, [ebx]     ; ref1
312                  punpckhbw mm1, mm7    pavgb mm4, [esi]     ; ref2
313    
314                  movq mm4, [eax]    movq mm5, [ebx+edx] ; ref
315                  movq mm5, mm4    pavgb mm5, [esi+edx] ; ref2
316    
317                  punpcklbw mm4, mm7    movq [eax], mm4
318                  punpckhbw mm5, mm7    movq [eax+edx], mm5
319    
320                  movq mm2, [esi]                 ; mm23 = [ref]    psubsb mm0,mm4
321      psubsb mm2,mm5
322      lea esi, [esi+2*edx]
323      movq mm1,mm0
324                  movq mm3, mm2                  movq mm3, mm2
325      lea eax, [eax+2*edx]
326                  movq mm6, [ebx]    punpcklbw mm0,mm7
   
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
   
327                  punpcklbw mm2, mm7                  punpcklbw mm2, mm7
328      lea ebx, [ebx+2*edx]
329      punpckhbw mm1,mm7
330                  punpckhbw mm3, mm7                  punpckhbw mm3, mm7
331    
332                  psubsw mm0, mm2                 ; mm01 -= mm23    movq [ecx+%1*32+ 0], mm0 ; dst
333      movq [ecx+%1*32+ 8], mm1
334                  movq mm2, mm6    movq [ecx+%1*32+16], mm2
335      movq [ecx+%1*32+24], mm3
336                  punpcklbw mm2, mm7  %endmacro
                 punpckhbw mm6, mm7  
   
                 psubsw mm1, mm3  
337    
338                  psubsw mm4, mm2  ALIGN 16
339                  psubsw mm5, mm6  transfer_8to16sub2_xmm:
340      mov ecx, [esp  + 4] ; Dst
341      mov eax, [esp  + 8] ; Cur
342      push ebx
343      mov ebx, [esp+4+12] ; Ref1
344      push esi
345      mov esi, [esp+8+16] ; Ref2
346      mov edx, [esp+8+20] ; Stride
347      pxor mm7, mm7
348    
349                  movq [edi + 96], mm0                    ; dct[] = mm01    COPY_8_TO_16_SUB2_SSE 0
350                  movq [edi + 104], mm1    COPY_8_TO_16_SUB2_SSE 1
351                  movq [edi + 112], mm4    COPY_8_TO_16_SUB2_SSE 2
352                  movq [edi + 120], mm5    COPY_8_TO_16_SUB2_SSE 3
353    
                 pop ebx  
                 pop edi  
354                  pop esi                  pop esi
355      pop ebx
356                  ret                  ret
357    
358    ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
359  ;  ;
360  ; void transfer_16to8add_mmx(uint8_t * const dst,  ; void transfer_16to8add_mmx(uint8_t * const dst,
361  ;                                               const int16_t * const src,  ;                                               const int16_t * const src,
362  ;                                               uint32_t stride);  ;                                               uint32_t stride);
363  ;  ;
364  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 align 16  
 cglobal transfer_16to8add_mmx  
 transfer_16to8add_mmx  
   
                 push    esi  
                 push    edi  
   
                 mov     edi, [esp + 8 + 4]              ; dst  
                 mov     esi, [esp + 8 + 8]              ; src  
                 mov ecx, [esp + 8 + 12]         ; stride  
   
                 pxor mm7, mm7  
   
                 mov eax, 8  
   
 .loop  
                 movq mm0, [edi]  
                 movq mm1, mm0  
                 punpcklbw mm0, mm7              ; mm23 = unpack([dst])  
                 punpckhbw mm1, mm7  
365    
366                  movq mm2, [esi]                 ; mm01 = [src]  %macro COPY_16_TO_8_ADD 1
367                  movq mm3, [esi + 8]    movq mm0, [eax+%1*32+ 0] ;src
368      packuswb mm0,[eax+%1*32+8]
369      movq mm1, [eax+%1*32+ 16]
370      packuswb mm1,[eax+%1*32+24]
371    
372      paddusb mm0,[ecx]
373      paddusb mm1,[ecx+edx]
374      movq [ecx],mm0
375      movq [ecx+edx],mm1
376    
377                  paddsw mm0, mm2                 ; mm01 += mm23  %endmacro
                 paddsw mm1, mm3  
   
                 packuswb mm0, mm1               ; [dst] = pack(mm01)  
                 movq [edi], mm0  
378    
                 add esi, 16  
                 add edi, ecx  
                 dec eax  
                 jnz .loop  
   
                 pop edi  
                 pop esi  
379    
380    ALIGN 16
381    transfer_16to8add_mmx:
382      mov ecx, [esp+ 4] ; Dst
383      mov eax, [esp+ 8] ; Src
384      mov edx, [esp+12] ; Stride
385     ; pxor mm7, mm7
386    
387      COPY_16_TO_8_ADD 0
388      lea ecx,[ecx+2*edx]
389      COPY_16_TO_8_ADD 1
390      lea ecx,[ecx+2*edx]
391      COPY_16_TO_8_ADD 2
392      lea ecx,[ecx+2*edx]
393      COPY_16_TO_8_ADD 3
394                  ret                  ret
395    
396    ;-----------------------------------------------------------------------------
 ;===========================================================================  
397  ;  ;
398  ; void transfer8x8_copy_mmx(uint8_t * const dst,  ; void transfer8x8_copy_mmx(uint8_t * const dst,
399  ;                                       const uint8_t * const src,  ;                                       const uint8_t * const src,
400  ;                                       const uint32_t stride);  ;                                       const uint32_t stride);
401  ;  ;
402  ;  ;
403  ;===========================================================================  ;-----------------------------------------------------------------------------
404    
405  align 16  ALIGN 16
406  cglobal transfer8x8_copy_mmx  transfer8x8_copy_mmx:
 transfer8x8_copy_mmx  
                 push    esi  
                 push    edi  
   
                 mov     edi, [esp + 8 + 4]              ; dst [out]  
                 mov     esi, [esp + 8 + 8]              ; src [in]  
                 mov eax, [esp + 8 + 12]         ; stride [in]  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
407    
408                  pop edi    mov eax, [esp+ 8] ; Src
409                  pop esi    mov ecx, [esp+ 4] ; Dst
410      mov edx, [esp+12] ; Stride
411    
412      movq mm0,[eax]
413      lea eax,[eax+edx]
414      movq mm1,[eax]
415      lea eax,[eax+edx]
416      movq mm2,[eax]
417      lea eax,[eax+edx]
418      movq mm3,[eax]
419      lea eax,[eax+edx]
420      movq mm4,[eax]
421      lea eax,[eax+edx]
422      movq mm5,[eax]
423      lea eax,[eax+edx]
424      movq mm6,[eax]
425      lea eax,[eax+edx]
426      movq mm7,[eax]
427    
428      movq [ecx],mm0
429      lea ecx,[ecx+edx]
430      movq [ecx],mm1
431      lea ecx,[ecx+edx]
432      movq [ecx],mm2
433      lea ecx,[ecx+edx]
434      movq [ecx],mm3
435      lea ecx,[ecx+edx]
436      movq [ecx],mm4
437      lea ecx,[ecx+edx]
438      movq [ecx],mm5
439      lea ecx,[ecx+edx]
440      movq [ecx],mm6
441      lea ecx,[ecx+edx]
442      movq [ecx],mm7
443    
444                  ret                  ret

Legend:
Removed from v.3  
changed lines
  Added in v.1424

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