3 dnl Copyright 2003, 2004, 2005, 2007, 2008 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 the GNU Lesser General Public License as published
9 dnl by the Free Software Foundation; either version 3 of the License, or (at
10 dnl your option) any later version.
12 dnl The GNU MP Library is distributed in the hope that it will be useful, but
13 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 dnl License for more details.
17 dnl You should have received a copy of the GNU Lesser General Public License
18 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
20 include(`../config.m4')
30 C The inner loop of this code is the result of running a code generation and
31 C optimization tool suite written by David Harvey and Torbjorn Granlund.
34 C * The inner loop is great, but the prologue and epilogue code was
35 C quickly written. Tune it!
40 define(`n_param',`%rdx')
58 mov (up), %rax C read first u limb early
59 mov n_param, %rbx C move away n from rdx, mul uses it
76 L(gt1): lea 8(up,n,8), up
80 xor R32(%rbx), R32(%rbx)
86 L(b0): lea (up,n,8), up
94 L(b3): lea -8(up,n,8), up
101 L(b2): lea -16(up,n,8), up
105 xor R32(%rbx), R32(%rbx)
112 L(top): mov %r10, (rp,n,8)
121 L(L0): mov 8(up,n,8), %rax
126 L(L3): mov 16(up,n,8), %rax
144 L(ret): mov %rdx, %rax