1 dnl Intel Pentium mpn_addmul_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 3 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 License
19 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
21 include(`../config.m4')
24 C P5: 14.0 cycles/limb
27 ifdef(`OPERATION_addmul_1', `
29 define(M4_function_1, mpn_addmul_1)
30 define(M4_function_1c, mpn_addmul_1c)
32 ',`ifdef(`OPERATION_submul_1', `
34 define(M4_function_1, mpn_submul_1)
35 define(M4_function_1c, mpn_submul_1c)
37 ',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
40 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
43 C mp_limb_t mpn_addmul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
45 C mp_limb_t mpn_addmul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
46 C mp_limb_t mult, mp_limb_t carry);
48 C mp_limb_t mpn_submul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
50 C mp_limb_t mpn_submul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
51 C mp_limb_t mult, mp_limb_t carry);
54 defframe(PARAM_CARRY, 20)
55 defframe(PARAM_MULTIPLIER,16)
56 defframe(PARAM_SIZE, 12)
57 defframe(PARAM_SRC, 8)
58 defframe(PARAM_DST, 4)
63 PROLOGUE(M4_function_1c)
66 movl PARAM_CARRY, %ecx
67 pushl %esi FRAME_pushl()
75 PROLOGUE(M4_function_1)
79 pushl %esi FRAME_pushl()
85 pushl %edi FRAME_pushl()
86 pushl %ebx FRAME_pushl()
89 leal -1(%eax), %ebx C size-1
91 leal (%esi,%eax,4), %esi
92 xorl $-1, %ebx C -size, and clear carry
94 leal (%edi,%eax,4), %edi
98 C ebx counter, negative
106 movl (%esi,%ebx,4), %eax
108 mull PARAM_MULTIPLIER
111 movl (%edi,%ebx,4), %ecx
116 movl %ecx, (%edi,%ebx,4)