1 dnl X86
-64 mpn_addmul_1
and mpn_submul_1 optimised for Intel Sandy Bridge.
3 dnl Contributed to the GNU project by Torbjörn Granlund.
5 dnl Copyright
2003-2005, 2007, 2008, 2011-2013 Free Software Foundation
, Inc.
7 dnl
This file is part of the GNU MP Library.
9 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
10 dnl it under the terms of
either:
12 dnl
* the GNU Lesser General
Public License as published by the Free
13 dnl Software Foundation
; either version 3 of the License, or (at your
14 dnl option
) any later version.
18 dnl
* the GNU General
Public License as published by the Free Software
19 dnl Foundation
; either version 2 of the License, or (at your option) any
22 dnl
or both
in parallel
, as here.
24 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
25 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
26 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
29 dnl You should have received copies of the GNU General
Public License
and the
30 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
31 dnl see
https://www.gnu.
org/licenses
/.
33 include(`..
/config.m4
')
46 C Intel SBR 3.24 (average, fluctuating in 3.20-3.57)
53 C The loop of this code is the result of running a code generation and
54 C optimization tool suite written by David Harvey and Torbjörn Granlund.
56 define(`rp', `
%rdi
') C rcx
57 define(`up', `
%rsi
') C rdx
58 define(`n_param', `
%rdx
') C r8
59 define(`v0', `
%rcx
') C r9
65 ifdef(`OPERATION_addmul_1',`
66 define
(`ADDSUB
', `add')
67 define
(`func
', `mpn_addmul_1')
69 ifdef(`OPERATION_submul_1',`
70 define
(`ADDSUB
', `sub')
71 define
(`func
', `mpn_submul_1')
77 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
79 IFDOS(` define(`up', ``
%rsi
'')') dnl
80 IFDOS(` define(`rp', ``
%rcx
'')') dnl
81 IFDOS(` define(`v0', ``
%r9
'')') dnl
82 IFDOS(` define(`r9', ``rdi
'')') dnl
83 IFDOS(` define(`n_param',``
%r8
'')') dnl
92 IFDOS(``mov %rdx, %rsi '')
96 lea (up,n_param,8), up
97 lea (rp,n_param,8), rp
102 L(b02): xor R32(%r11), R32(%r11)
106 L(b0): mov $1, R32(n)
122 L(b13): xor R32(%r9), R32(%r9)
126 L(b1): mov $2, R32(n)
130 mov -16(rp,n,8), %r10
135 L(b3): xor R32(n), R32(n)
143 mov -16(rp,n,8), %r10
148 L(e1): ADDSUB %rax, %r10
156 mov %r10, -16(rp,n,8)
157 L(e0): ADDSUB %rax, %r8
165 L(e3): mov %rdx, %r11
175 L(e2): ADDSUB %rax, %r8
182 mov I(-8(rp),-16(rp,n,8)), %r10
186 mov %r8, I(-16(rp),-24(rp,n,8))
191 mov %r10, I(-8(rp),-16(rp,n,8))