1 dnl x86-64 mpn_addlsh1_n and mpn_sublsh1_n, optimized for "Core" 2.
3 dnl Copyright 2008 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')
34 ifdef(`OPERATION_addlsh1_n', `
37 define(func, mpn_addlsh1_n)')
38 ifdef(`OPERATION_sublsh1_n', `
41 define(func, mpn_sublsh1_n)')
43 MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
52 mov R32(%rcx), R32(%rax)
58 xor R32(%r11), R32(%r11)
60 mov -24(vp,n,8), %r8 C do first limb early
69 L(b3): mov -16(vp,n,8), %r9
83 sbb R32(%rax), R32(%rax) C save cy
88 L(b1): mov -24(up,n,8), %r12
92 sbb R32(%rax), R32(%rax) C save cy
97 L(b2): mov -16(vp,n,8), %r9
101 mov %r12, -24(rp,n,8)
102 mov -16(up,n,8), %r12
104 mov %r12, -16(rp,n,8)
106 sbb R32(%rax), R32(%rax) C save cy
112 L(top): mov -24(vp,n,8), %r8
114 L(b0): mov -16(vp,n,8), %r9
121 add R32(%rax), R32(%rax) C restore cy
123 mov -24(up,n,8), %r12
125 mov %r12, -24(rp,n,8)
127 mov -16(up,n,8), %r12
129 mov %r12, -16(rp,n,8)
140 sbb R32(%rax), R32(%rax) C save cy
145 L(end): add %r11, %r11