1
dnl x86 __gmpn_addmul_1 (for 386 and 486) -- Multiply a limb vector with a
2
dnl limb and add the result to a second limb vector.
11
dnl Copyright 1992, 1994, 1997, 1999, 2000, 2001 Free Software Foundation,
14
dnl This file is part of the GNU MP Library.
16
dnl The GNU MP Library is free software; you can redistribute it and/or
17
dnl modify it under the terms of the GNU Lesser General Public License as
18
dnl published by the Free Software Foundation; either version 2.1 of the
19
dnl License, or (at your option) any later version.
21
dnl The GNU MP Library is distributed in the hope that it will be useful,
22
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
23
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24
dnl Lesser General Public License for more details.
26
dnl You should have received a copy of the GNU Lesser General Public
27
dnl License along with the GNU MP Library; see the file COPYING.LIB. If
28
dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
29
dnl Suite 330, Boston, MA 02111-1307, USA.
32
include(`../config.m4')
35
ifdef(`OPERATION_addmul_1',`
37
define(M4_function_1, mpn_addmul_1)
39
',`ifdef(`OPERATION_submul_1',`
41
define(M4_function_1, mpn_submul_1)
43
',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
46
MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
49
C mp_limb_t M4_function_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
52
define(PARAM_MULTIPLIER, `FRAME+16(%esp)')
53
define(PARAM_SIZE, `FRAME+12(%esp)')
54
define(PARAM_SRC, `FRAME+8(%esp)')
55
define(PARAM_DST, `FRAME+4(%esp)')
60
PROLOGUE(M4_function_1)
85
adcl %edx,%ebx C propagate carry into cylimb
97
L(oop): movl (%esi),%eax
104
mull PARAM_MULTIPLIER
106
adcl %eax,%ebp C new lo + cylimb
111
mull PARAM_MULTIPLIER
113
adcl %eax,%ebx C new lo + cylimb
118
mull PARAM_MULTIPLIER
120
adcl %eax,%ebp C new lo + cylimb
124
M4_inst %ebp,12(%edi)
125
adcl $0,%ebx C propagate carry into cylimb
132
L(end): movl %ebx,%eax