1dnl  x86 mpn_copyd -- copy limb vector, decrementing.
2
3dnl  Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
4dnl
5dnl  This file is part of the GNU MP Library.
6dnl
7dnl  The GNU MP Library is free software; you can redistribute it and/or
8dnl  modify it under the terms of the GNU Lesser General Public License as
9dnl  published by the Free Software Foundation; either version 2.1 of the
10dnl  License, or (at your option) any later version.
11dnl
12dnl  The GNU MP Library is distributed in the hope that it will be useful,
13dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
14dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15dnl  Lesser General Public License for more details.
16dnl
17dnl  You should have received a copy of the GNU Lesser General Public
18dnl  License along with the GNU MP Library; see the file COPYING.LIB.  If
19dnl  not, write to the Free Software Foundation, Inc., 51 Franklin Street,
20dnl  Fifth Floor, Boston, MA 02110-1301, USA.
21
22include(`../config.m4')
23
24
25C     cycles/limb  startup (approx)
26C P5:     1.0         40
27C P6      2.4         70
28C K6      1.0         55
29C K7:     1.3         75
30C P4:     2.6        175
31C
32C (Startup time includes some function call overheads.)
33
34
35C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
36C
37C Copy src,size to dst,size, working from high to low addresses.
38C
39C The code here is very generic and can be expected to be reasonable on all
40C the x86 family.
41
42defframe(PARAM_SIZE,12)
43defframe(PARAM_SRC, 8)
44defframe(PARAM_DST, 4)
45deflit(`FRAME',0)
46
47	TEXT
48	ALIGN(32)
49
50PROLOGUE(mpn_copyd)
51	C eax	saved esi
52	C ebx
53	C ecx	counter
54	C edx	saved edi
55	C esi	src
56	C edi	dst
57	C ebp
58
59	movl	PARAM_SIZE, %ecx
60	movl	%esi, %eax
61
62	movl	PARAM_SRC, %esi
63	movl	%edi, %edx
64
65	movl	PARAM_DST, %edi
66	leal	-4(%esi,%ecx,4), %esi
67
68	leal	-4(%edi,%ecx,4), %edi
69
70	std
71
72	rep
73	movsl
74
75	cld
76
77	movl	%eax, %esi
78	movl	%edx, %edi
79
80	ret
81
82EPILOGUE()
83