1 dnl Intel Pentium mpn_mul_basecase
-- mpn by mpn multiplication.
3 dnl Copyright
1996, 1998-2000, 2002 Free Software Foundation
, Inc.
5 dnl
This file is part of the GNU MP Library.
7 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
8 dnl it under the terms of
either:
10 dnl
* the GNU Lesser General
Public License as published by the Free
11 dnl Software Foundation
; either version 3 of the License, or (at your
12 dnl option
) any later version.
16 dnl
* the GNU General
Public License as published by the Free Software
17 dnl Foundation
; either version 2 of the License, or (at your option) any
20 dnl
or both
in parallel
, as here.
22 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
23 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
24 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
27 dnl You should have received copies of the GNU General
Public License
and the
28 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
29 dnl see
https://www.gnu.
org/licenses
/.
31 include(`..
/config.m4
')
34 C P5: 14.2 cycles/crossproduct (approx)
37 C void mpn_mul_basecase (mp_ptr wp,
38 C mp_srcptr xp, mp_size_t xsize,
39 C mp_srcptr yp, mp_size_t ysize);
41 defframe(PARAM_YSIZE, 20)
42 defframe(PARAM_YP, 16)
43 defframe(PARAM_XSIZE, 12)
47 defframe(VAR_COUNTER, -4)
51 PROLOGUE(mpn_mul_basecase)
53 pushl %eax C dummy push for allocating stack slot
63 movl
(%esi),%eax C load xp
[0]
64 mull
(%ebp) C multiply by yp
[0]
65 movl
%eax,(%edi) C store to wp
[0]
66 movl PARAM_XSIZE
,%ecx C xsize
67 decl
%ecx C If xsize
= 1, ysize
= 1 too
74 leal
(%esi,%eax,4),%esi C make xp point at
end
75 leal
(%edi,%eax,4),%edi C
offset wp by xsize
76 negl
%ecx C negate j
size/index for inner
loop
77 xorl
%eax,%eax C clear carry
81 movl
(%esi,%ecx,4),%eax C load next limb at xp
[j
]
84 movl
%eax,(%edi,%ecx,4)
91 movl
%ebx,(%edi) C most significant limb of product
92 addl
$4,%edi C increment wp
95 movl
%eax,VAR_COUNTER C set index i to ysize
98 addl
$4,%ebp C make
ebp point to next y limb
103 C code at
0x61 here
, close enough to aligned
106 movl
(%esi,%ecx,4),%eax
109 movl
(%edi,%ecx,4),%ebx
112 movl
%ebx,(%edi,%ecx,4)
121 movl VAR_COUNTER
,%eax
123 movl
%eax,VAR_COUNTER
135 movl
%edx,4(%edi) C store to wp
[1]
139 popl
%eax C dummy
pop for deallocating stack slot