1 dnl Intel Pentium mpn_mul_1 -- mpn by limb multiplication.
3 dnl Copyright 1992, 1994, 1996, 1999, 2000, 2002 Free Software Foundation,
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 3 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 License
19 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
21 include(`../config.m4')
24 C P5: 12.0 cycles/limb
27 C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
28 C mp_limb_t multiplier);
29 C mp_limb_t mpn_mul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
30 C mp_limb_t multiplier, mp_limb_t carry);
33 defframe(PARAM_CARRY, 20)
34 defframe(PARAM_MULTIPLIER,16)
35 defframe(PARAM_SIZE, 12)
36 defframe(PARAM_SRC, 8)
37 defframe(PARAM_DST, 4)
44 movl PARAM_CARRY, %ecx
45 pushl %esi FRAME_pushl()
57 pushl %esi FRAME_pushl()
94 pushl %edi FRAME_pushl()
95 pushl %ebx FRAME_pushl()
98 leal -1(%eax), %ebx C size/2-1
100 notl %ebx C -size, preserve carry
102 leal (%esi,%eax,8), %esi C src end
103 leal (%edi,%eax,8), %edi C dst end
105 pushl %ebp FRAME_pushl()
109 C size was odd, process one limb separately
111 movl (%esi,%ebx,8), %eax
114 mull PARAM_MULTIPLIER
119 movl %eax, (%edi,%ebx,8)
125 C ebx counter, negative
133 movl (%esi,%ebx,8), %eax
135 mull PARAM_MULTIPLIER
141 movl 4(%esi,%ebx,8), %eax
143 mull PARAM_MULTIPLIER
145 movl %ecx, (%edi,%ebx,8)
148 movl %eax, 4(%edi,%ebx,8)