[svn] / branches / release-1_2-branch / xvidcore / src / motion / x86_asm / sad_mmx.asm Repository:
ViewVC logotype

Diff of /branches/release-1_2-branch/xvidcore/src/motion/x86_asm/sad_mmx.asm

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

revision 652, Sun Nov 17 00:35:33 2002 UTC revision 1599, Sat Feb 19 23:20:27 2005 UTC
# Line 1  Line 1 
1  ;/*****************************************************************************  ;/****************************************************************************
2  ; *  ; *
3  ; *  XVID MPEG-4 VIDEO CODEC  ; *  XVID MPEG-4 VIDEO CODEC
4  ; *  mmx sum of absolute difference  ; *  - K7 optimized SAD operators -
5  ; *  ; *
6  ; *  Copyright(C) 2002 Peter Ross <pross@xvid.org>  ; *  Copyright(C) 2001 Peter Ross <pross@xvid.org>
7    ; *               2002 Pascal Massimino <skal@planet-d.net>
8  ; *  ; *
9  ; *  This file is part of XviD, a free MPEG-4 video encoder/decoder  ; *  This program is free software; you can redistribute it and/or modify it
 ; *  
 ; *  XviD is free software; you can redistribute it and/or modify it  
10  ; *  under the terms of the GNU General Public License as published by  ; *  under the terms of the GNU General Public License as published by
11  ; *  the Free Software Foundation; either version 2 of the License, or  ; *  the Free Software Foundation; either version 2 of the License, or
12  ; *  (at your option) any later version.  ; *  (at your option) any later version.
# Line 21  Line 20 
20  ; *  along with this program; if not, write to the Free Software  ; *  along with this program; if not, write to the Free Software
21  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22  ; *  ; *
23  ; *  Under section 8 of the GNU General Public License, the copyright  ; * $Id: sad_mmx.asm,v 1.17 2005-02-19 23:20:27 suxen_drol Exp $
 ; *  holders of XVID explicitly forbid distribution in the following  
 ; *  countries:  
 ; *  
 ; *    - Japan  
 ; *    - United States of America  
 ; *  
 ; *  Linking XviD statically or dynamically with other modules is making a  
 ; *  combined work based on XviD.  Thus, the terms and conditions of the  
 ; *  GNU General Public License cover the whole combination.  
 ; *  
 ; *  As a special exception, the copyright holders of XviD give you  
 ; *  permission to link XviD with independent modules that communicate with  
 ; *  XviD solely through the VFW1.1 and DShow interfaces, regardless of the  
 ; *  license terms of these independent modules, and to copy and distribute  
 ; *  the resulting combined work under terms of your choice, provided that  
 ; *  every copy of the combined work is accompanied by a complete copy of  
 ; *  the source code of XviD (the version of XviD used to produce the  
 ; *  combined work), being distributed under the terms of the GNU General  
 ; *  Public License plus this exception.  An independent module is a module  
 ; *  which is not derived from or based on XviD.  
24  ; *  ; *
25  ; *  Note that people who make modified versions of XviD are not obligated  ; ***************************************************************************/
 ; *  to grant this special exception for their modified versions; it is  
 ; *  their choice whether to do so.  The GNU General Public License gives  
 ; *  permission to release a modified version without this exception; this  
 ; *  exception also makes it possible to release a modified version which  
 ; *  carries forward this exception.  
 ; *  
 ; * $Id: sad_mmx.asm,v 1.10 2002-11-17 00:32:06 edgomez Exp $  
 ; *  
 ; ****************************************************************************/  
26    
27  bits 32  BITS 32
28    
29  %macro cglobal 1  %macro cglobal 1
30          %ifdef PREFIX          %ifdef PREFIX
31                    %ifdef MARK_FUNCS
32                            global _%1:function %1.endfunc-%1
33                            %define %1 _%1:function %1.endfunc-%1
34                    %else
35                  global _%1                  global _%1
36                  %define %1 _%1                  %define %1 _%1
37                    %endif
38            %else
39                    %ifdef MARK_FUNCS
40                            global %1:function %1.endfunc-%1
41          %else          %else
42                  global %1                  global %1
43          %endif          %endif
44            %endif
45  %endmacro  %endmacro
46    
47  section .data  ;=============================================================================
48    ; Read only data
49    ;=============================================================================
50    
51  align 16  %ifdef FORMAT_COFF
52  mmx_one times 4 dw 1  SECTION .rodata
53    %else
54  section .text  SECTION .rodata align=16
55    %endif
56    
57  cglobal  sad16_mmx  ALIGN 16
58  cglobal  sad8_mmx  mmx_one:
59  cglobal  sad16bi_mmx          times 4 dw 1
60  cglobal  sad8bi_mmx  
61  cglobal  dev16_mmx  ;=============================================================================
62    ; Helper macros
63  ;===========================================================================  ;=============================================================================
 ;  
 ; uint32_t sad16_mmx(const uint8_t * const cur,  
 ;                                        const uint8_t * const ref,  
 ;                                        const uint32_t stride,  
 ;                                        const uint32_t best_sad);  
 ;  
 ; (early termination ignore; slows this down)  
 ;  
 ;===========================================================================  
64    
65  %macro SAD_16x16_MMX 0  %macro SAD_16x16_MMX 0
66      movq mm0, [eax]      movq mm0, [eax]
# Line 101  Line 74 
74      lea eax,[eax+ecx]      lea eax,[eax+ecx]
75      movq mm5, mm2      movq mm5, mm2
76      psubusb mm2, mm3      psubusb mm2, mm3
     lea edx,[edx+ecx]  
77    
78      psubusb mm1, mm4      psubusb mm1, mm4
     por mm0, mm1  
79      psubusb mm3, mm5      psubusb mm3, mm5
80      por mm0, mm1
81      por mm2, mm3      por mm2, mm3
82    
83      movq mm1,mm0      movq mm1,mm0
     movq mm3,mm2  
   
84      punpcklbw mm0,mm7      punpcklbw mm0,mm7
85      movq mm3, mm2
86      punpckhbw mm1,mm7      punpckhbw mm1,mm7
87      lea edx, [edx+ecx]
88      punpcklbw mm2,mm7      punpcklbw mm2,mm7
     punpckhbw mm3,mm7  
   
89      paddusw mm0,mm1      paddusw mm0,mm1
90      punpckhbw mm3,mm7
91      paddusw mm6,mm0      paddusw mm6,mm0
92      paddusw mm2,mm3      paddusw mm2,mm3
93      paddusw mm6,mm2      paddusw mm6,mm2
 %endmacro  
   
 align 16  
 sad16_mmx:  
   
     mov eax, [esp+ 4] ; Src1  
     mov edx, [esp+ 8] ; Src2  
     mov ecx, [esp+12] ; Stride  
   
     pxor mm6, mm6 ; accum  
     pxor mm7, mm7 ; zero  
   
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
   
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
     SAD_16x16_MMX  
94    
95      pmaddwd mm6, [mmx_one] ; collapse  %endmacro
     movq mm7, mm6  
     psrlq mm7, 32  
     paddd mm6, mm7  
   
     movd eax, mm6  
   
     ret  
   
   
 ;===========================================================================  
 ;  
 ; uint32_t sad8_mmx(const uint8_t * const cur,  
 ;                                       const uint8_t * const ref,  
 ;                                       const uint32_t stride);  
 ;  
 ;===========================================================================  
96    
97  %macro SAD_8x8_MMX  0  %macro SAD_8x8_MMX  0
98      movq mm0, [eax]      movq mm0, [eax]
# Line 184  Line 110 
110      psubusb mm2, mm3      psubusb mm2, mm3
111    
112      psubusb mm1, mm4      psubusb mm1, mm4
     por mm0, mm1  
113      psubusb mm3, mm5      psubusb mm3, mm5
114      por mm0, mm1
115      por mm2, mm3      por mm2, mm3
116    
117      movq mm1,mm0      movq mm1,mm0
     movq mm3,mm2  
   
118      punpcklbw mm0,mm7      punpcklbw mm0,mm7
119      movq mm3,mm2
120      punpckhbw mm1,mm7      punpckhbw mm1,mm7
121      punpcklbw mm2,mm7      punpcklbw mm2,mm7
     punpckhbw mm3,mm7  
   
122      paddusw mm0,mm1      paddusw mm0,mm1
123      punpckhbw mm3,mm7
124      paddusw mm6,mm0      paddusw mm6,mm0
125      paddusw mm2,mm3      paddusw mm2,mm3
126      paddusw mm6,mm2      paddusw mm6,mm2
127  %endmacro  %endmacro
128    
 align 16  
 sad8_mmx:  
   
     mov eax, [esp+ 4] ; Src1  
     mov edx, [esp+ 8] ; Src2  
     mov ecx, [esp+12] ; Stride  
   
     pxor mm6, mm6 ; accum  
     pxor mm7, mm7 ; zero  
   
     SAD_8x8_MMX  
     SAD_8x8_MMX  
     SAD_8x8_MMX  
     SAD_8x8_MMX  
   
     pmaddwd mm6, [mmx_one] ; collapse  
     movq mm7, mm6  
     psrlq mm7, 32  
     paddd mm6, mm7  
129    
130      movd eax, mm6  %macro SADV_16x16_MMX 0
131      movq mm0, [eax]
132      movq mm1, [edx]
133    
134      ret    movq mm2, [eax+8]
135      movq mm4, mm0
136      movq mm3, [edx+8]
137      psubusb mm0, mm1
138    
139      psubusb mm1, mm4
140      lea eax,[eax+ecx]
141      por mm0, mm1
142    
143      movq mm4, mm2
144      psubusb mm2, mm3
145    
146      psubusb mm3, mm4
147      por mm2, mm3
148    
149      movq mm1,mm0
150      punpcklbw mm0,mm7
151      movq mm3,mm2
152      punpckhbw mm1,mm7
153      punpcklbw mm2,mm7
154      paddusw mm0,mm1
155      punpckhbw mm3,mm7
156      paddusw mm5, mm0
157      paddusw mm2,mm3
158      lea edx,[edx+ecx]
159      paddusw mm6, mm2
160    %endmacro
161    
 ;===========================================================================  
 ;  
 ; uint32_t sad16bi_mmx(const uint8_t * const cur,  
 ; const uint8_t * const ref1,  
 ; const uint8_t * const ref2,  
 ; const uint32_t stride);  
 ;  
 ;===========================================================================  
162  %macro SADBI_16x16_MMX 2    ; SADBI_16x16_MMX( int_ptr_offset, bool_increment_ptr );  %macro SADBI_16x16_MMX 2    ; SADBI_16x16_MMX( int_ptr_offset, bool_increment_ptr );
163    
164     movq mm0, [edx+%1]     movq mm0, [edx+%1]
# Line 288  Line 209 
209    
210  %endmacro  %endmacro
211    
212  align 16  %macro MEAN_16x16_MMX 0
213      movq mm0, [eax]
214      movq mm2, [eax+8]
215      lea eax, [eax+ecx]
216      movq mm1, mm0
217      punpcklbw mm0, mm7
218      movq mm3, mm2
219      punpckhbw mm1, mm7
220      paddw mm5, mm0
221      punpcklbw mm2, mm7
222      paddw mm6, mm1
223      punpckhbw mm3, mm7
224      paddw mm5, mm2
225      paddw mm6, mm3
226    %endmacro
227    
228    %macro ABS_16x16_MMX 0
229      movq mm0, [eax]
230      movq mm2, [eax+8]
231      lea eax, [eax+ecx]
232      movq mm1, mm0
233      movq mm3, mm2
234      punpcklbw mm0, mm7
235      punpcklbw mm2, mm7
236      punpckhbw mm1, mm7
237      punpckhbw mm3, mm7
238      movq mm4, mm6
239      psubusw mm4, mm0
240    
241      psubusw mm0, mm6
242      por mm0, mm4
243      movq mm4, mm6
244      psubusw mm4, mm1
245      psubusw mm1, mm6
246      por mm1, mm4
247    
248      movq mm4, mm6
249      psubusw mm4, mm2
250      psubusw mm2, mm6
251      por mm2, mm4
252      movq mm4, mm6
253      psubusw mm4, mm3
254      psubusw mm3, mm6
255      por mm3, mm4
256    
257      paddw mm0, mm1
258      paddw mm2, mm3
259      paddw mm5, mm0
260      paddw mm5, mm2
261    %endmacro
262    
263    ;=============================================================================
264    ; Code
265    ;=============================================================================
266    
267    SECTION .text
268    
269    cglobal sad16_mmx
270    cglobal sad16v_mmx
271    cglobal sad8_mmx
272    cglobal sad16bi_mmx
273    cglobal sad8bi_mmx
274    cglobal dev16_mmx
275    cglobal sse8_16bit_mmx
276    cglobal sse8_8bit_mmx
277    
278    ;-----------------------------------------------------------------------------
279    ;
280    ; uint32_t sad16_mmx(const uint8_t * const cur,
281    ;                                        const uint8_t * const ref,
282    ;                                        const uint32_t stride,
283    ;                                        const uint32_t best_sad);
284    ;
285    ; (early termination ignore; slows this down)
286    ;
287    ;-----------------------------------------------------------------------------
288    
289    ALIGN 16
290    sad16_mmx:
291    
292      mov eax, [esp+ 4] ; Src1
293      mov edx, [esp+ 8] ; Src2
294      mov ecx, [esp+12] ; Stride
295    
296      pxor mm6, mm6 ; accum
297      pxor mm7, mm7 ; zero
298    
299      SAD_16x16_MMX
300      SAD_16x16_MMX
301      SAD_16x16_MMX
302      SAD_16x16_MMX
303      SAD_16x16_MMX
304      SAD_16x16_MMX
305      SAD_16x16_MMX
306      SAD_16x16_MMX
307    
308      SAD_16x16_MMX
309      SAD_16x16_MMX
310      SAD_16x16_MMX
311      SAD_16x16_MMX
312      SAD_16x16_MMX
313      SAD_16x16_MMX
314      SAD_16x16_MMX
315      SAD_16x16_MMX
316    
317      pmaddwd mm6, [mmx_one] ; collapse
318      movq mm7, mm6
319      psrlq mm7, 32
320      paddd mm6, mm7
321    
322      movd eax, mm6
323    
324      ret
325    .endfunc
326    
327    ;-----------------------------------------------------------------------------
328    ;
329    ; uint32_t sad8_mmx(const uint8_t * const cur,
330    ;                                       const uint8_t * const ref,
331    ;                                       const uint32_t stride);
332    ;
333    ;-----------------------------------------------------------------------------
334    
335    ALIGN 16
336    sad8_mmx:
337    
338      mov eax, [esp+ 4] ; Src1
339      mov edx, [esp+ 8] ; Src2
340      mov ecx, [esp+12] ; Stride
341    
342      pxor mm6, mm6 ; accum
343      pxor mm7, mm7 ; zero
344    
345      SAD_8x8_MMX
346      SAD_8x8_MMX
347      SAD_8x8_MMX
348      SAD_8x8_MMX
349    
350      pmaddwd mm6, [mmx_one] ; collapse
351      movq mm7, mm6
352      psrlq mm7, 32
353      paddd mm6, mm7
354    
355      movd eax, mm6
356    
357      ret
358    .endfunc
359    
360    ;-----------------------------------------------------------------------------
361    ;
362    ; uint32_t sad16v_mmx(const uint8_t * const cur,
363    ;                                     const uint8_t * const ref,
364    ;                                         const uint32_t stride,
365    ;                                         int32_t *sad);
366    ;
367    ;-----------------------------------------------------------------------------
368    
369    ALIGN 16
370    sad16v_mmx:
371    
372      push ebx
373      push edi
374    
375      mov eax, [esp + 8 + 4] ; Src1
376      mov edx, [esp + 8 + 8] ; Src2
377      mov ecx, [esp + 8 + 12] ; Stride
378      mov ebx, [esp + 8 + 16] ; sad ptr
379    
380      pxor mm5, mm5 ; accum
381      pxor mm6, mm6 ; accum
382      pxor mm7, mm7 ; zero
383    
384      SADV_16x16_MMX
385      SADV_16x16_MMX
386      SADV_16x16_MMX
387      SADV_16x16_MMX
388      SADV_16x16_MMX
389      SADV_16x16_MMX
390      SADV_16x16_MMX
391      SADV_16x16_MMX
392    
393      pmaddwd mm5, [mmx_one] ; collapse
394      pmaddwd mm6, [mmx_one] ; collapse
395    
396      movq mm2, mm5
397      movq mm3, mm6
398    
399      psrlq mm2, 32
400      psrlq mm3, 32
401    
402      paddd mm5, mm2
403      paddd mm6, mm3
404    
405      movd [ebx], mm5
406      movd [ebx + 4], mm6
407    
408      paddd mm5, mm6
409    
410      movd edi, mm5
411    
412      pxor mm5, mm5
413      pxor mm6, mm6
414    
415      SADV_16x16_MMX
416      SADV_16x16_MMX
417      SADV_16x16_MMX
418      SADV_16x16_MMX
419      SADV_16x16_MMX
420      SADV_16x16_MMX
421      SADV_16x16_MMX
422      SADV_16x16_MMX
423    
424      pmaddwd mm5, [mmx_one] ; collapse
425      pmaddwd mm6, [mmx_one] ; collapse
426    
427      movq mm2, mm5
428      movq mm3, mm6
429    
430      psrlq mm2, 32
431      psrlq mm3, 32
432    
433      paddd mm5, mm2
434      paddd mm6, mm3
435    
436      movd [ebx + 8], mm5
437      movd [ebx + 12], mm6
438    
439      paddd mm5, mm6
440    
441      movd eax, mm5
442    
443      add eax, edi
444    
445      pop edi
446      pop ebx
447    
448      ret
449    .endfunc
450    
451    ;-----------------------------------------------------------------------------
452    ;
453    ; uint32_t sad16bi_mmx(const uint8_t * const cur,
454    ; const uint8_t * const ref1,
455    ; const uint8_t * const ref2,
456    ; const uint32_t stride);
457    ;
458    ;-----------------------------------------------------------------------------
459    
460    ALIGN 16
461  sad16bi_mmx:  sad16bi_mmx:
462     push ebx     push ebx
463     mov eax, [esp+4+ 4] ; Src     mov eax, [esp+4+ 4] ; Src
# Line 340  Line 509 
509    
510     movd eax, mm6     movd eax, mm6
511     pop ebx     pop ebx
512    
513     ret     ret
514    .endfunc
515    
516  ;===========================================================================  ;-----------------------------------------------------------------------------
517  ;  ;
518  ; uint32_t sad8bi_mmx(const uint8_t * const cur,  ; uint32_t sad8bi_mmx(const uint8_t * const cur,
519  ; const uint8_t * const ref1,  ; const uint8_t * const ref1,
520  ; const uint8_t * const ref2,  ; const uint8_t * const ref2,
521  ; const uint32_t stride);  ; const uint32_t stride);
522  ;  ;
523  ;===========================================================================  ;-----------------------------------------------------------------------------
524  align 16  
525    ALIGN 16
526  sad8bi_mmx:  sad8bi_mmx:
527     push ebx     push ebx
528     mov eax, [esp+4+ 4] ; Src     mov eax, [esp+4+ 4] ; Src
# Line 378  Line 550 
550     movd eax, mm6     movd eax, mm6
551     pop ebx     pop ebx
552     ret     ret
553    .endfunc
554    
555    ;-----------------------------------------------------------------------------
   
   
 ;===========================================================================  
556  ;  ;
557  ; uint32_t dev16_mmx(const uint8_t * const cur,  ; uint32_t dev16_mmx(const uint8_t * const cur,
558  ;                                       const uint32_t stride);  ;                                       const uint32_t stride);
559  ;  ;
560  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 %macro MEAN_16x16_MMX 0  
     movq mm0, [eax]  
     movq mm2, [eax+8]  
     lea eax,[eax+ecx]  
     movq mm1, mm0  
     movq mm3, mm2  
     punpcklbw mm0,mm7  
     punpcklbw mm2,mm7  
     punpckhbw mm1,mm7  
     punpckhbw mm3,mm7  
     paddw mm5, mm0  
     paddw mm6, mm1  
     paddw mm5, mm2  
     paddw mm6, mm3  
 %endmacro  
   
 %macro ABS_16x16_MMX 0  
     movq mm0, [eax]  
     movq mm2, [eax+8]  
     lea eax,[eax+ecx]  
     movq mm1, mm0  
     movq mm3, mm2  
     punpcklbw mm0, mm7  
     punpcklbw mm2, mm7  
     punpckhbw mm1, mm7  
     punpckhbw mm3, mm7  
     movq mm4, mm6  
         psubusw mm4, mm0  
   
         psubusw mm0, mm6  
         por mm0, mm4  
         movq mm4, mm6  
         psubusw mm4, mm1  
         psubusw mm1, mm6  
         por mm1, mm4  
561    
562      movq mm4, mm6  ALIGN 16
         psubusw mm4, mm2  
         psubusw mm2, mm6  
         por mm2, mm4  
         movq mm4, mm6  
         psubusw mm4, mm3  
         psubusw mm3, mm6  
         por mm3, mm4  
   
         paddw mm0, mm1  
         paddw mm2, mm3  
         paddw mm5, mm0  
         paddw mm5, mm2  
 %endmacro  
   
 align 16  
563  dev16_mmx:  dev16_mmx:
564      mov eax, [esp+ 4] ; Src      mov eax, [esp+ 4] ; Src
565      mov ecx, [esp+ 8] ; Stride      mov ecx, [esp+ 8] ; Stride
# Line 509  Line 628 
628      paddd mm6, mm5      paddd mm6, mm5
629    
630      movd eax, mm6      movd eax, mm6
631    
632      ret
633    .endfunc
634    
635    ;-----------------------------------------------------------------------------
636    ;
637    ; uint32_t sse8_16bit_mmx(const int16_t *b1,
638    ;                         const int16_t *b2,
639    ;                         const uint32_t stride);
640    ;
641    ;-----------------------------------------------------------------------------
642    
643    %macro ROW_SSE_16bit_MMX 2
644      movq mm0, [%1]
645      movq mm1, [%1+8]
646      psubw mm0, [%2]
647      psubw mm1, [%2+8]
648      pmaddwd mm0, mm0
649      pmaddwd mm1, mm1
650      paddd mm2, mm0
651      paddd mm2, mm1
652    %endmacro
653    
654    sse8_16bit_mmx:
655      push esi
656      push edi
657    
658      ;; Load the function params
659      mov esi, [esp+8+4]
660      mov edi, [esp+8+8]
661      mov edx, [esp+8+12]
662    
663      ;; Reset the sse accumulator
664      pxor mm2, mm2
665    
666      ;; Let's go
667    %rep 8
668      ROW_SSE_16bit_MMX esi, edi
669      lea esi, [esi+edx]
670      lea edi, [edi+edx]
671    %endrep
672    
673      ;; Finish adding each dword of the accumulator
674      movq mm3, mm2
675      psrlq mm2, 32
676      paddd mm2, mm3
677      movd eax, mm2
678    
679      ;; All done
680      pop edi
681      pop esi
682      ret
683    .endfunc
684    
685    ;-----------------------------------------------------------------------------
686    ;
687    ; uint32_t sse8_8bit_mmx(const int8_t *b1,
688    ;                        const int8_t *b2,
689    ;                        const uint32_t stride);
690    ;
691    ;-----------------------------------------------------------------------------
692    
693    %macro ROW_SSE_8bit_MMX 2
694      movq mm0, [%1] ; load a row
695      movq mm2, [%2] ; load a row
696    
697      movq mm1, mm0  ; copy row
698      movq mm3, mm2  ; copy row
699    
700      punpcklbw mm0, mm7 ; turn the 4low elements into 16bit
701      punpckhbw mm1, mm7 ; turn the 4high elements into 16bit
702    
703      punpcklbw mm2, mm7 ; turn the 4low elements into 16bit
704      punpckhbw mm3, mm7 ; turn the 4high elements into 16bit
705    
706      psubw mm0, mm2 ; low  part of src-dst
707      psubw mm1, mm3 ; high part of src-dst
708    
709      pmaddwd mm0, mm0 ; compute the square sum
710      pmaddwd mm1, mm1 ; compute the square sum
711    
712      paddd mm6, mm0 ; add to the accumulator
713      paddd mm6, mm1 ; add to the accumulator
714    %endmacro
715    
716    sse8_8bit_mmx:
717      push esi
718      push edi
719    
720      ;; Load the function params
721      mov esi, [esp+8+4]
722      mov edi, [esp+8+8]
723      mov edx, [esp+8+12]
724    
725      ;; Reset the sse accumulator
726      pxor mm6, mm6
727    
728      ;; Used to interleave 8bit data with 0x00 values
729      pxor mm7, mm7
730    
731      ;; Let's go
732    %rep 8
733      ROW_SSE_8bit_MMX esi, edi
734      lea esi, [esi+edx]
735      lea edi, [edi+edx]
736    %endrep
737    
738      ;; Finish adding each dword of the accumulator
739      movq mm7, mm6
740      psrlq mm6, 32
741      paddd mm6, mm7
742      movd eax, mm6
743    
744      ;; All done
745      pop edi
746      pop esi
747      ret      ret
748    .endfunc
749    

Legend:
Removed from v.652  
changed lines
  Added in v.1599

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