3 dnl Copyright
2003-2005, 2007, 2008, 2012 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
')
45 C The loop of this code is the result of running a code generation and
46 C optimization tool suite written by David Harvey and Torbjorn Granlund.
49 C * The loop is great, but the prologue and epilogue code was quickly written.
52 define(`rp', `
%rdi
') C rcx
53 define(`up', `
%rsi
') C rdx
54 define(`n_param', `
%rdx
') C r8
55 define(`vl', `
%rcx
') C r9
62 IFDOS(` define(`up', ``
%rsi
'') ') dnl
63 IFDOS(` define(`rp', ``
%rcx
'') ') dnl
64 IFDOS(` define(`vl', ``
%r9
'') ') dnl
65 IFDOS(` define(`r9', ``rdi
'') ') dnl
66 IFDOS(` define(`n', ``
%r8
'') ') dnl
67 IFDOS(` define(`r8', ``r11
'') ') dnl
75 IFDOS(``mov %rdx, %rsi '')
77 IFSTD(` mov %r8, %r10')
78 IFDOS
(`
mov 64(%rsp
), %r10
') C 40 + 3*8 (3 push insns)
85 IFDOS(``mov %rdx, %rsi '')
90 mov (up), %rax C read first u limb early
91 IFSTD(` mov n_param, %rbx ') C move away n from rdx
, mul uses it
92 IFDOS
(`
mov n
, %rbx
')
94 IFSTD(` mov %rbx, n ')
109 L
(gt1
): lea 8(up
,n
,8), up
113 xor R32
(%rbx
), R32
(%rbx
)
119 L
(b0
): lea (up
,n
,8), up
127 L
(b3
): lea -8(up
,n
,8), up
134 L
(b2
): lea -16(up
,n
,8), up
138 xor R32
(%rbx
), R32
(%rbx
)
145 L
(top
): mov %r10
, (rp
,n
,8)
154 L
(L0
): mov 8(up
,n
,8), %rax
159 L
(L3
): mov 16(up
,n
,8), %rax
162 mov $0, R32
(%r8
) C zero
177 L
(ret): mov %rdx
, %rax