2 ; bdist2_mmx.s: MMX optimized bidirectional squared distance sum
4 ; Original believed to be Copyright (C) 2000 Brent Byeler
6 ; This program is free software; you can reaxstribute it and/or
7 ; modify it under the terms of the GNU General Public License
8 ; as published by the Free Software Foundation; either version 2
9 ; of the License, or (at your option) any later version.
11 ; This program is distributed in the hope that it will be useful,
12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ; GNU General Public License for more details.
16 ; You should have received a copy of the GNU General Public License
17 ; along with this program; if not, write to the Free Software
18 ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 ; * squared error between a (16*h) block and a bidirectional
25 ; * p2: address of top left pel of block
26 ; * pf,hxf,hyf: address and half pel flags of forward ref. block
27 ; * pb,hxb,hyb: address and half pel flags of backward ref. block
28 ; * h: height of block
29 ; * lx: distance (in bytes) of vertically adjacent pels in p2,pf,pb
34 ;unsigned char *pf, unsigned char *pb, unsigned char *p2,
35 ;int lx, int hxf, int hyf, int hxb, int hyb, int h)
37 ; unsigned char *pfa,*pfb,*pfc,*pba,*pbb,*pbc;
40 ; Handy macros for readbility
65 push ebp ; save frame pointer
74 ;; Make space for local variables on stack
101 xor esi, esi ; esi = s (accumulated sym)
105 test edi, edi ; h = 0?
312 ;; Get rid of local variables
315 ;; Retore (callee saves convention...)
323 pop ebp ; restore stack pointer
325 emms ; clear mmx registers