1 dnl AMD K7 mpn_copyd
-- copy limb vector
, decrementing.
3 dnl Copyright
1999, 2000, 2002 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 alignment dst/src, A=0mod8 N=4mod8
36 C K7 0.75 1.0 1.0 0.75
39 C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
41 C The various comments in mpn/x86/k7/copyi.asm apply here too.
43 defframe(PARAM_SIZE,12)
44 defframe(PARAM_SRC, 8)
45 defframe(PARAM_DST, 4)
48 dnl parameter space reused
49 define
(SAVE_EBX
,`PARAM_SIZE
')
50 define(SAVE_ESI,`PARAM_SRC')
52 dnl minimum
5 since the unrolled code can
't handle less than 5
53 deflit(UNROLL_THRESHOLD, 5)
65 cmpl $UNROLL_THRESHOLD, %ecx
77 C this loop is 2 cycles/limb
79 movl -4(%eax,%ecx,4), %ebx
80 movl %ebx, -4(%edx,%ecx,4)
91 leal (%eax,%ecx,4), %ebx
92 leal (%edx,%ecx,4), %esi
96 subl $4, %ecx C size-4
98 testl $4, %ebx C testl to pad code closer to 16 bytes for L(top)
101 C both src and dst unaligned, process one limb to align them
102 movl 12(%eax,%ecx,4), %ebx
103 movl %ebx, 12(%edx,%ecx,4)
115 movq 8(%eax,%ecx,4), %mm0
116 movq (%eax,%ecx,4), %mm1
118 movq %mm0, 16+8(%edx,%ecx,4)
119 movq %mm1, 16(%edx,%ecx,4)
123 C now %ecx is -4 to -1 representing respectively 0 to 3 limbs remaining
128 movq 8(%eax,%ecx,4), %mm0
129 movq %mm0, 8(%edx,%ecx,4)