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 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. */
23
include(`../config.m4')
26
C P5: 12.0 cycles/limb
29
C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
30
C mp_limb_t multiplier);
31
C mp_limb_t mpn_mul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
32
C mp_limb_t multiplier, mp_limb_t carry);
35
defframe(PARAM_CARRY, 20)
36
defframe(PARAM_MULTIPLIER,16)
37
defframe(PARAM_SIZE, 12)
38
defframe(PARAM_SRC, 8)
39
defframe(PARAM_DST, 4)
46
movl PARAM_CARRY, %ecx
47
pushl %esi FRAME_pushl()
59
pushl %esi FRAME_pushl()
96
pushl %edi FRAME_pushl()
97
pushl %ebx FRAME_pushl()
100
leal -1(%eax), %ebx C size/2-1
102
notl %ebx C -size, preserve carry
104
leal (%esi,%eax,8), %esi C src end
105
leal (%edi,%eax,8), %edi C dst end
107
pushl %ebp FRAME_pushl()
111
C size was odd, process one limb separately
113
movl (%esi,%ebx,8), %eax
116
mull PARAM_MULTIPLIER
121
movl %eax, (%edi,%ebx,8)
127
C ebx counter, negative
135
movl (%esi,%ebx,8), %eax
137
mull PARAM_MULTIPLIER
143
movl 4(%esi,%ebx,8), %eax
145
mull PARAM_MULTIPLIER
147
movl %ecx, (%edi,%ebx,8)
150
movl %eax, 4(%edi,%ebx,8)