1 dnl Intel Pentium mpn_copyd -- copy limb vector, decrementing.
3 dnl Copyright 1996, 2001, 2002, 2006 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
7 dnl The GNU MP Library is free software; you can redistribute it and/or
8 dnl modify it under the terms of the GNU Lesser General Public License as
9 dnl published by the Free Software Foundation; either version 3 of the
10 dnl License, or (at your option) any later version.
12 dnl The GNU MP Library is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 dnl Lesser General Public License for more details.
17 dnl You should have received a copy of the GNU Lesser General Public License
18 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
20 include(`../config.m4')
23 C P5: 1.25 cycles/limb
26 C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
28 C See comments in copyi.asm.
30 defframe(PARAM_SIZE,12)
31 defframe(PARAM_SRC, 8)
32 defframe(PARAM_DST, 4)
42 pushl %esi FRAME_pushl()
43 pushl %edi FRAME_pushl()
45 leal -4(%eax,%ecx,4), %eax C &src[size-1]
48 subl $7, %ecx C size-7
51 movl 28-4(%edx,%ecx,4), %esi C prefetch cache, dst[size-1]
55 C eax src, decrementing
63 movl 28-32(%edx,%ecx,4), %esi C prefetch dst cache line
66 movl (%eax), %esi C read words pairwise
68 movl %esi, 56(%edx,%ecx,4) C store words pairwise
69 movl %edi, 52(%edx,%ecx,4)
73 movl %esi, 48(%edx,%ecx,4)
74 movl %edi, 44(%edx,%ecx,4)
78 movl %esi, 40(%edx,%ecx,4)
79 movl %edi, 36(%edx,%ecx,4)
83 movl %esi, 32(%edx,%ecx,4)
84 movl %edi, 28(%edx,%ecx,4)
91 C ecx -7 to 0, representing respectively 0 to 7 limbs remaining
93 C edx dst, next location to store
100 movl %esi, 8(%edx,%ecx,4)
101 movl %edi, 4(%edx,%ecx,4)
105 movl %esi, (%edx,%ecx,4)
106 movl %edi, -4(%edx,%ecx,4)
117 movl %esi, (%edx,%ecx,4)
118 movl %edi, -4(%edx,%ecx,4)
127 movl %ecx, (%edx) C risk of cache bank clash here