1 dnl Intel P6-15 mpn_add_n/mpn_sub_n -- mpn add or subtract.
3 dnl Copyright 2006, 2007 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 the GNU Lesser General Public License as published
9 dnl by the Free Software Foundation; either version 3 of the License, or (at
10 dnl your option) any later version.
12 dnl The GNU MP Library is distributed in the hope that it will be useful, but
13 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 dnl License for more details.
17 dnl You should have received a copy of the GNU Lesser General Public License
18 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
20 include(`../config.m4')
37 ifdef(`OPERATION_add_n', `
39 define(func, mpn_add_n)
40 define(func_nc, mpn_add_nc)')
41 ifdef(`OPERATION_sub_n', `
43 define(func, mpn_sub_n)
44 define(func_nc, mpn_sub_nc)')
46 MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
70 add %rax, n C clear low rcx bits for jrcxz
75 L(b11): shr %r8 C set cy
78 L(b00): shr %r8 C set cy
84 L(b01): shr %r8 C set cy
87 L(b10): shr %r8 C set cy
92 L(end): ADCSBB %r11, %r10
94 mov %ecx, %eax C clear eax, ecx contains 0
103 mov %r10, -24(rp,n,8)
105 mov -16(up,n,8), %r10
106 mov -16(vp,n,8), %r11