1 dnl Intel P6 mpn_lshsub_n -- mpn papillion support.
3 dnl Copyright 2006 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')
22 C P6/13: 3.35 cycles/limb (separate mpn_sub_n + mpn_lshift needs 4.12)
24 C (1) The loop is is not scheduled in any way, and scheduling attempts have not
25 C improved speed on P6/13. Presumably, the K7 will want scheduling, if it
26 C at all wants to use MMX.
27 C (2) We could save a register by not alternatingly using eax and edx in the
41 PROLOGUE(mpn_lshsub_n)
63 lea (%eax,%eax,4), %edx C edx = 10x
68 lea L(ent)(%eax,%edx,2), %eax C eax = 22x
78 C See mpn/x86/README about old gas bugs
79 lea (%eax,%edx,2), %eax
80 add $L(ent)-L(here), %eax
85 L(end): C compute (cy<<cnt) | (edx>>(32-cnt))
99 L(ent): mov 0(up,n,4), %eax
125 movd %mm0, 12(rp,n,4)
132 movd %mm1, 16(rp,n,4)
139 movd %mm0, 20(rp,n,4)
146 movd %mm1, 24(rp,n,4)
153 movd %mm0, 28(rp,n,4)