1 dnl x86 mpn_mul_1 (for 386, 486, and Pentium Pro) -- Multiply a limb vector
2 dnl with a limb and store the result in a second limb vector.
7 dnl The following CPUs have their own optimized code, but for reference the
8 dnl code here runs as follows.
16 dnl Copyright (C) 1992, 1994, 1997, 1998, 1999, 2000 Free Software
19 dnl This file is part of the GNU MP Library.
21 dnl The GNU MP Library is free software; you can redistribute it and/or
22 dnl modify it under the terms of the GNU Lesser General Public License as
23 dnl published by the Free Software Foundation; either version 2.1 of the
24 dnl License, or (at your option) any later version.
26 dnl The GNU MP Library is distributed in the hope that it will be useful,
27 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
28 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 dnl Lesser General Public License for more details.
31 dnl You should have received a copy of the GNU Lesser General Public
32 dnl License along with the GNU MP Library; see the file COPYING.LIB. If
33 dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
34 dnl Suite 330, Boston, MA 02111-1307, USA.
37 include(`../config.m4')
40 C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
41 C mp_limb_t multiplier);
43 defframe(PARAM_MULTIPLIER,16)
44 defframe(PARAM_SIZE, 12)
45 defframe(PARAM_SRC, 8)
46 defframe(PARAM_DST, 4)
75 movl %edx,%ebx C propagate carry into cylimb
88 L(oop): movl (%esi),%eax
97 addl %eax,%ebp C new lo + cylimb
102 mull PARAM_MULTIPLIER
104 addl %eax,%ebx C new lo + cylimb
109 mull PARAM_MULTIPLIER
111 addl %eax,%ebp C new lo + cylimb
122 L(end): movl %ebx,%eax