1 dnl AMD64 mpn_addlshC_n -- rp[] = up[] + (vp[] << C)
2 dnl AMD64 mpn_rsblshC_n -- rp[] = (vp[] << C) - up[]
4 dnl Copyright 2009-2012 Free Software Foundation, Inc.
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/.
49 define(M, eval(m4_lshift(1,LSH)))
79 L(b11): mov 8(vp,n,8), %r10
80 lea (%r8,%r10,M), %r14
83 lea (%r10,%r11,M), %r15
86 ADCSBB 8(up,n,8), %r14
87 ADCSBB 16(up,n,8), %r15
88 sbb R32(%rax), R32(%rax) C save carry for next
98 sbb R32(%rax), R32(%rax) C save carry for next
104 L(b10): mov 8(vp,n,8), %r11
105 lea (%r8,%r11,M), %r15
107 ADDSUB (up,n,8), %r12
108 ADCSBB 8(up,n,8), %r15
109 sbb R32(%rax), R32(%rax) C save carry for next
116 L(b00): mov 8(vp,n,8), %r9
121 L(top): mov 16(vp,n,8), %r10
124 lea (%r11,%r8,M), %r12
126 L(e00): lea (%r8,%r9,M), %r13
129 lea (%r9,%r10,M), %r14
131 lea (%r10,%r11,M), %r15
133 add R32(%rax), R32(%rax) C restore carry
134 ADCSBB (up,n,8), %r12
135 ADCSBB 8(up,n,8), %r13
136 ADCSBB 16(up,n,8), %r14
137 ADCSBB 24(up,n,8), %r15
141 sbb R32(%rax), R32(%rax) C save carry for next
148 sub R32(%r11), R32(%rax)
151 add R32(%r11), R32(%rax)
152 movslq R32(%rax), %rax