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