1 dnl x86 mpn_copyi -- copy limb vector, incrementing.
4 dnl Copyright (C) 1999, 2000 Free Software Foundation, Inc.
6 dnl This file is part of the GNU MP Library.
8 dnl The GNU MP Library is free software; you can redistribute it and/or
9 dnl modify it under the terms of the GNU Lesser General Public License as
10 dnl published by the Free Software Foundation; either version 2.1 of the
11 dnl License, or (at your option) any later version.
13 dnl The GNU MP Library is distributed in the hope that it will be useful,
14 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 dnl Lesser General Public License for more details.
18 dnl You should have received a copy of the GNU Lesser General Public
19 dnl License along with the GNU MP Library; see the file COPYING.LIB. If
20 dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
21 dnl Suite 330, Boston, MA 02111-1307, USA.
24 include(`../config.m4')
27 C void mpn_copyi (mp_ptr dst, mp_srcptr src, mp_size_t size);
29 C Copy src,size to dst,size, working from low to high addresses.
31 C The code here is very generic and can be expected to be reasonable on all
34 C P5 - 1.0 cycles/limb.
36 C P6 - 0.75 cycles/limb. An MMX based copy was tried, but was found to be
37 C slower than a rep movs in all cases. The fastest MMX found was 0.8
38 C cycles/limb (when fully aligned). A rep movs seems to have a startup
39 C time of about 15 cycles, but doing something special for small sizes
40 C could lead to a branch misprediction that would destroy any saving.
41 C For now a plain rep movs seems ok for P6.
43 defframe(PARAM_SIZE,12)
44 defframe(PARAM_SRC, 8)
45 defframe(PARAM_DST, 4)
69 cld C better safe than sorry, see mpn/x86/README.family