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 modify
9 dnl it under the terms of
either:
11 dnl
* the GNU Lesser General
Public License as published by the Free
12 dnl Software Foundation
; either version 3 of the License, or (at your
13 dnl option
) any later version.
17 dnl
* the GNU General
Public License as published by the Free Software
18 dnl Foundation
; either version 2 of the License, or (at your option) any
21 dnl
or both
in parallel
, as here.
23 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
24 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
25 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
28 dnl You should have received copies of the GNU General
Public License
and the
29 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
30 dnl see
https://www.gnu.
org/licenses
/.
32 include(`..
/config.m4
')
35 C P5: 14.0 cycles/limb
38 ifdef(`OPERATION_addmul_1', `
40 define
(M4_function_1
, mpn_addmul_1
)
41 define
(M4_function_1c
, mpn_addmul_1c
)
43 ',`ifdef(`OPERATION_submul_1', `
45 define
(M4_function_1
, mpn_submul_1
)
46 define
(M4_function_1c
, mpn_submul_1c
)
48 ',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
51 MULFUNC_PROLOGUE
(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c
)
54 C mp_limb_t mpn_addmul_1
(mp_ptr dst
, mp_srcptr src
, mp_size_t
size,
56 C mp_limb_t mpn_addmul_1c
(mp_ptr dst
, mp_srcptr src
, mp_size_t
size,
57 C mp_limb_t mult
, mp_limb_t carry
);
59 C mp_limb_t mpn_submul_1
(mp_ptr dst
, mp_srcptr src
, mp_size_t
size,
61 C mp_limb_t mpn_submul_1c
(mp_ptr dst
, mp_srcptr src
, mp_size_t
size,
62 C mp_limb_t mult
, mp_limb_t carry
);
65 defframe
(PARAM_CARRY
, 20)
66 defframe
(PARAM_MULTIPLIER
,16)
67 defframe
(PARAM_SIZE
, 12)
68 defframe
(PARAM_SRC
, 8)
69 defframe
(PARAM_DST
, 4)
74 PROLOGUE
(M4_function_1c
)
77 movl PARAM_CARRY, %ecx
78 pushl %esi FRAME_pushl()
86 PROLOGUE(M4_function_1)
90 pushl
%esi FRAME_pushl
()
96 pushl
%edi FRAME_pushl
()
97 pushl
%ebx FRAME_pushl
()
100 leal
-1(%eax), %ebx C
size-1
102 leal
(%esi,%eax,4), %esi
103 xorl $
-1, %ebx C
-size, and clear carry
105 leal
(%edi,%eax,4), %edi
109 C
ebx counter
, negative
117 movl
(%esi,%ebx,4), %eax
119 mull PARAM_MULTIPLIER
122 movl
(%edi,%ebx,4), %ecx
127 movl
%ecx, (%edi,%ebx,4)