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