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