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.
4 dnl Copyright 1992, 1994, 1997, 1999, 2000, 2001, 2002, 2005 Free Software
7 dnl This file is part of the GNU MP Library.
9 dnl The GNU MP Library is free software; you can redistribute it and/or
10 dnl modify it under the terms of the GNU Lesser General Public License as
11 dnl published by the Free Software Foundation; either version 3 of the
12 dnl License, or (at your option) any later version.
14 dnl The GNU MP Library is distributed in the hope that it will be useful,
15 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 dnl Lesser General Public License for more details.
19 dnl You should have received a copy of the GNU Lesser General Public License
20 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
22 include(`../config.m4')
27 C P6 model 0-8,10-12) 7.5
29 C P6 model 13 (Dothan) 6.75
30 C P4 model 0 (Willamette) 24.0
32 C P4 model 2 (Northwood) 24.0
33 C P4 model 3 (Prescott)
40 ifdef(`OPERATION_addmul_1',`
42 define(M4_function_1, mpn_addmul_1)
44 ',`ifdef(`OPERATION_submul_1',`
46 define(M4_function_1, mpn_submul_1)
48 ',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
51 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
54 C mp_limb_t M4_function_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
57 define(PARAM_MULTIPLIER, `FRAME+16(%esp)')
58 define(PARAM_SIZE, `FRAME+12(%esp)')
59 define(PARAM_SRC, `FRAME+8(%esp)')
60 define(PARAM_DST, `FRAME+4(%esp)')
65 PROLOGUE(M4_function_1)
90 adcl %edx,%ebx C propagate carry into cylimb
102 L(oop): movl (%esi),%eax
103 mull PARAM_MULTIPLIER
109 mull PARAM_MULTIPLIER
111 adcl %eax,%ebp C new lo + cylimb
116 mull PARAM_MULTIPLIER
118 adcl %eax,%ebx C new lo + cylimb
123 mull PARAM_MULTIPLIER
125 adcl %eax,%ebp C new lo + cylimb
129 M4_inst %ebp,12(%edi)
130 adcl $0,%ebx C propagate carry into cylimb
137 L(end): movl %ebx,%eax