1 dnl AMD64 mpn_addlshC_n
, mpn_sublshC_n
-- rp
[] = up
[] +- (vp
[] << C
), where
2 dnl C is
1, 2, 3. Optimized for Pentium
4.
4 dnl Contributed to the GNU project by Torbjorn Granlund.
6 dnl Copyright
2008, 2010-2012 Free Software Foundation
, Inc.
8 dnl
This file is part of the GNU MP Library.
10 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
11 dnl it under the terms of
either:
13 dnl
* the GNU Lesser General
Public License as published by the Free
14 dnl Software Foundation
; either version 3 of the License, or (at your
15 dnl option
) any later version.
19 dnl
* the GNU General
Public License as published by the Free Software
20 dnl Foundation
; either version 2 of the License, or (at your option) any
23 dnl
or both
in parallel
, as here.
25 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
26 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
27 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
30 dnl You should have received copies of the GNU General
Public License
and the
31 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
32 dnl see
https://www.gnu.
org/licenses
/.
50 define
(M
, eval
(m4_lshift
(1,LSH
)))
68 xor R32
(%rbx
), R32
(%rbx
)
72 jne L
(n00
) C n
= 0, 4, 8, ...
85 L
(n00
): cmp $2, R32
(%rax
)
86 jnc L
(n01
) C n
= 1, 5, 9, ...
93 jz L
(1) C jump for n
= 1
102 L
(n01
): jne L
(n10
) C n
= 2, 6, 10, ...
108 lea (%rbp
,%r9
,M
), %r9
110 mov 12(vp
), R32
(%rbp
)
115 L
(n10
): mov (up
), %r10
120 lea (%rbp
,%r9
,M
), %r9
122 mov 12(vp
), R32
(%rbp
)
128 L
(c0
): mov $1, R8
(%rbx
)
130 L
(c1
): mov $1, R8
(%rax
)
132 L
(c2
): mov $1, R8
(%rbx
)
136 L
(top
): mov (up
), %r8 C
not on critical path
138 ADDSUB
%r9
, %r11 C
not on critical path
140 lea (%rbp
,%r9
,M
), %r9
141 setc R8
(%rbx
) C save carry
out
144 ADDSUB
%rax
, %r11 C apply previous carry
out
145 jc L
(c0
) C jump if ripple
147 L
(L01
): mov 8(up
), %r10
151 lea (%rbp
,%r9
,M
), %r9
153 mov 12(vp
), R32
(%rbp
)
158 L
(L00
): mov 16(up
), %r12
162 lea (%rbp
,%r9
,M
), %r9
164 mov 20(vp
), R32
(%rbp
)
169 L
(L11
): mov 24(up
), %r11
173 lea (%rbp
,%r9
,M
), %r9
177 mov -4(vp
), R32
(%rbp
)
181 L
(rc3
): lea 32(rp
), rp
193 L
(1): mov %r11
, 8(rp
)
194 lea (%rbx
,%rbp
), R32
(%rax
)
200 L
(c3
): mov $1, R8
(%rax
)