1 dnl Intel Pentium mpn_mul_basecase -- mpn by mpn multiplication.
3 dnl P5: 14.2 cycles/crossproduct (approx)
6 dnl Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
8 dnl This file is part of the GNU MP Library.
10 dnl The GNU MP Library is free software; you can redistribute it and/or
11 dnl modify it under the terms of the GNU Lesser General Public License as
12 dnl published by the Free Software Foundation; either version 2.1 of the
13 dnl License, or (at your option) any later version.
15 dnl The GNU MP Library is distributed in the hope that it will be useful,
16 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 dnl Lesser General Public License for more details.
20 dnl You should have received a copy of the GNU Lesser General Public
21 dnl License along with the GNU MP Library; see the file COPYING.LIB. If
22 dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
23 dnl Suite 330, Boston, MA 02111-1307, USA.
26 include(`../config.m4')
29 C void mpn_mul_basecase (mp_ptr wp,
30 C mp_srcptr xp, mp_size_t xsize,
31 C mp_srcptr yp, mp_size_t ysize);
33 defframe(PARAM_YSIZE, 20)
34 defframe(PARAM_YP, 16)
35 defframe(PARAM_XSIZE, 12)
39 defframe(VAR_COUNTER, -4)
43 PROLOGUE(mpn_mul_basecase)
45 pushl %eax C dummy push for allocating stack slot
55 movl (%esi),%eax C load xp[0]
56 mull (%ebp) C multiply by yp[0]
57 movl %eax,(%edi) C store to wp[0]
58 movl PARAM_XSIZE,%ecx C xsize
59 decl %ecx C If xsize = 1, ysize = 1 too
66 leal (%esi,%eax,4),%esi C make xp point at end
67 leal (%edi,%eax,4),%edi C offset wp by xsize
68 negl %ecx C negate j size/index for inner loop
69 xorl %eax,%eax C clear carry
73 movl (%esi,%ecx,4),%eax C load next limb at xp[j]
76 movl %eax,(%edi,%ecx,4)
83 movl %ebx,(%edi) C most significant limb of product
84 addl $4,%edi C increment wp
87 movl %eax,VAR_COUNTER C set index i to ysize
90 addl $4,%ebp C make ebp point to next y limb
95 C code at 0x61 here, close enough to aligned
98 movl (%esi,%ecx,4),%eax
101 movl (%edi,%ecx,4),%ebx
104 movl %ebx,(%edi,%ecx,4)
113 movl VAR_COUNTER,%eax
115 movl %eax,VAR_COUNTER
127 movl %edx,4(%edi) C store to wp[1]
131 popl %eax C dummy pop for deallocating stack slot