1 dnl x86 mpn_copyi
-- copy limb vector
, incrementing.
3 dnl Copyright
1999-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 cycles/limb startup (approx)
41 C (Startup time includes some function call overheads.)
44 C void mpn_copyi (mp_ptr dst, mp_srcptr src, mp_size_t size);
46 C Copy src,size to dst,size, working from low to high addresses.
48 C The code here is very generic and can be expected to be reasonable on all
51 C P6 - An MMX based copy was tried, but was found to be slower than a rep
52 C movs in all cases. The fastest MMX found was 0.8 cycles/limb (when
53 C fully aligned). A rep movs seems to have a startup time of about 15
54 C cycles, but doing something special for small sizes could lead to a
55 C branch misprediction that would destroy any saving. For now a plain
58 C K62 - We used to have a big chunk of code doing an MMX copy at 0.56 c/l if
59 C aligned or a 1.0 rep movs if not. But that seemed excessive since
60 C it only got an advantage half the time, and even then only showed it
61 C above 50 limbs or so.
63 defframe(PARAM_SIZE,12)
64 defframe(PARAM_SRC, 8)
65 defframe(PARAM_DST, 4)
89 cld C better safe than sorry
, see mpn
/x86
/README