1 dnl Intel Pentium mpn_add_n
/mpn_sub_n
-- mpn addition
and subtraction.
3 dnl Copyright
1992, 1994-1996, 1999, 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: 2.375 cycles/limb
37 ifdef(`OPERATION_add_n',`
39 define
(M4_function_n
, mpn_add_n
)
40 define
(M4_function_nc
, mpn_add_nc
)
42 ',`ifdef(`OPERATION_sub_n',`
44 define
(M4_function_n
, mpn_sub_n
)
45 define
(M4_function_nc
, mpn_sub_nc
)
47 ',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
50 MULFUNC_PROLOGUE
(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc
)
53 C mp_limb_t M4_function_n
(mp_ptr dst
, mp_srcptr src1
, mp_srcptr src2
,
55 C mp_limb_t M4_function_nc
(mp_ptr dst
, mp_srcptr src1
, mp_srcptr src2
,
56 C mp_size_t
size, mp_limb_t carry
);
58 defframe
(PARAM_CARRY
,20)
59 defframe
(PARAM_SIZE
, 16)
60 defframe
(PARAM_SRC2
, 12)
61 defframe
(PARAM_SRC1
, 8)
62 defframe
(PARAM_DST
, 4)
66 PROLOGUE
(M4_function_nc
)
85 testl %ecx,%ecx C zero carry flag
91 shrl %eax C shift bit 0 into carry
97 shrl
%eax C shift bit
0 into carry
104 PROLOGUE
(M4_function_n
)
123 testl %ecx,%ecx C zero carry flag
129 L(oop): movl 28(%edi),%eax C fetch destination cache line
132 L(1): movl (%esi),%eax
141 L(2): movl 8(%esi),%eax
150 L(3): movl 16(%esi),%eax
159 L(4): movl 24(%esi),%eax
176 decl %edx C test %edx w/o clobbering carry