1 dnl X86
-64 mpn_mul_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
')
48 C The loop of this code is the result of running a code generation and
49 C optimisation tool suite written by David Harvey and Torbjorn Granlund.
52 C * The loop is great, but the prologue code was quickly written. Tune it!
53 C * Add mul_1c entry point.
54 C * We could preserve one less register under DOS64 calling conventions, using
57 define(`rp', `
%rdi
') C rcx
58 define(`up', `
%rsi
') C rdx
59 define(`n_param', `
%rdx
') C r8
60 define(`v0', `
%rcx
') C r9
67 IFDOS(` define(`up', ``
%rsi
'')') dnl
68 IFDOS(` define(`rp', ``
%rcx
'')') dnl
69 IFDOS(` define(`v0', ``
%r9
'')') dnl
70 IFDOS(` define(`r9', ``rdi
'')') dnl
71 IFDOS(` define(`n_param',``
%r8
'')') dnl
72 IFDOS(` define(`n', ``
%r8
'')') dnl
73 IFDOS(` define(`r8', ``r11
'')') dnl
82 IFDOS(``mov %rdx, %rsi '')
85 mov R32(`n_param'), R32
(%r10
)
86 IFSTD
(`
mov n_param
, n
')
88 lea (up,n_param,8), up
89 lea -8(rp,n_param,8), rp
126 L(top): mov %rdx, %r8
128 L(L1): mov 0(up,n,8), %rax
153 L(end): add %rax, %r9