Annotation of OpenXM_contrib/gmp/mpn/x86/pentium4/copyd.asm, Revision 1.1.1.1
1.1 ohara 1: dnl Pentium-4 mpn_copyd -- copy limb vector, decrementing.
2: dnl
3:
4: dnl Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
5: dnl
6: dnl This file is part of the GNU MP Library.
7: dnl
8: dnl The GNU MP Library is free software; you can redistribute it and/or
9: dnl modify it under the terms of the GNU Lesser General Public License as
10: dnl published by the Free Software Foundation; either version 2.1 of the
11: dnl License, or (at your option) any later version.
12: dnl
13: dnl The GNU MP Library is distributed in the hope that it will be useful,
14: dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15: dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: dnl Lesser General Public License for more details.
17: dnl
18: dnl You should have received a copy of the GNU Lesser General Public
19: dnl License along with the GNU MP Library; see the file COPYING.LIB. If
20: dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
21: dnl Suite 330, Boston, MA 02111-1307, USA.
22:
23:
24: dnl The std/rep/movsl/cld is very slow for small blocks on pentium4. Its
25: dnl startup time seems to be about 165 cycles. It then copies at a rate of
26: dnl one limb per cycle. We therefore fall back to an open-coded 2 c/l
27: dnl copying loop for smaller sizes.
28:
29: dnl Ultimately, we may want to use 64-bit movq or 128-bit movdqu in some
30: dnl nifty unrolled arrangement. Clearly, that could reach much higher
31: dnl speeds, at least for large blocks.
32:
33: include(`../config.m4')
34:
35:
36: defframe(PARAM_SIZE, 12)
37: defframe(PARAM_SRC, 8)
38: defframe(PARAM_DST, 4)
39:
40: TEXT
41: ALIGN(8)
42:
43: PROLOGUE(mpn_copyd)
44: deflit(`FRAME',0)
45:
46: movl PARAM_SIZE, %ecx
47:
48: movl PARAM_SRC, %eax
49: movl PARAM_DST, %edx
50: movl %ebx, PARAM_SIZE
51: addl $-1, %ecx
52: js L(end)
53:
54: L(loop):
55: movl (%eax,%ecx,4), %ebx
56: movl %ebx, (%edx,%ecx,4)
57: addl $-1, %ecx
58:
59: jns L(loop)
60: L(end):
61: movl PARAM_SIZE, %ebx
62: ret
63:
64: EPILOGUE()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>