1 dnl AMD64 mpn_addmul_1
and mpn_submul_1 optimised for AMD bobcat.
3 dnl Copyright
2003-2005, 2007, 2008, 2011, 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
')
48 ifdef(`OPERATION_addmul_1',`
49 define
(`ADDSUB
', `add')
50 define
(`func
', `mpn_addmul_1')
52 ifdef(`OPERATION_submul_1',`
53 define
(`ADDSUB
', `sub')
54 define
(`func
', `mpn_submul_1')
57 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
62 define(`n_param', `
%rdx
')
64 C Standard allocations
72 IFDOS(` define(`rp', `
%rcx
') ') dnl
73 IFDOS
(` define
(`up
', `%rsi') ') dnl
74 IFDOS(` define(`n_param', `
%r8
') ') dnl
75 IFDOS
(` define
(`v0
', `%r9') ') dnl
77 IFDOS(` define(`n', `
%rbx
') ') dnl
78 IFDOS
(` define
(`w0
', `%r8') ') dnl
79 IFDOS(` define(`w1', `
%rdi
') ') dnl
80 IFDOS
(` define
(`w2
', `%r10') ') dnl
81 IFDOS(` define(`w3', `
%r11
') ') dnl
89 IFDOS
(`
mov %rdx
, %rsi
')
94 lea -16(rp,n_param,8), rp
95 lea -16(up,n_param,8), up
112 L(n1): ADDSUB %rax, 8(rp)
141 L(top): ADDSUB w0, -16(rp,n,8)
144 L(L1): mov 0(up,n,8), %rax
148 ADDSUB w2, -8(rp,n,8)
151 L(L0): mov 8(up,n,8), %rax
158 L(L3): mov 16(up,n,8), %rax
165 L(L2): mov 24(up,n,8), %rax
172 L(end): ADDSUB w0, (rp)