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 modify
8 dnl it under the terms of
either:
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.
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
20 dnl
or both
in parallel
, as here.
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
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 P5: 1.25 cycles/limb
37 C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
39 C See comments in copyi.asm.
41 defframe(PARAM_SIZE,12)
42 defframe(PARAM_SRC, 8)
43 defframe(PARAM_DST, 4)
53 pushl
%esi FRAME_pushl
()
54 pushl
%edi FRAME_pushl
()
56 leal
-4(%eax,%ecx,4), %eax C
&src
[size-1]
59 subl
$7, %ecx C
size-7
62 movl
28-4(%edx,%ecx,4), %esi C prefetch cache
, dst
[size-1]
66 C
eax src
, decrementing
74 movl
28-32(%edx,%ecx,4), %esi C prefetch dst cache line
77 movl
(%eax), %esi C read words pairwise
79 movl
%esi, 56(%edx,%ecx,4) C store words pairwise
80 movl
%edi, 52(%edx,%ecx,4)
84 movl
%esi, 48(%edx,%ecx,4)
85 movl
%edi, 44(%edx,%ecx,4)
89 movl
%esi, 40(%edx,%ecx,4)
90 movl
%edi, 36(%edx,%ecx,4)
94 movl
%esi, 32(%edx,%ecx,4)
95 movl
%edi, 28(%edx,%ecx,4)
102 C
ecx -7 to
0, representing respectively
0 to
7 limbs remaining
104 C
edx dst
, next location to store
111 movl
%esi, 8(%edx,%ecx,4)
112 movl
%edi, 4(%edx,%ecx,4)
116 movl
%esi, (%edx,%ecx,4)
117 movl
%edi, -4(%edx,%ecx,4)
128 movl
%esi, (%edx,%ecx,4)
129 movl
%edi, -4(%edx,%ecx,4)
138 movl
%ecx, (%edx) C risk of cache bank clash here