1 dnl SPARC v9 64-bit mpn_sqr_diagonal.
3 dnl Copyright 2001, 2002 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')
26 C This was generated by the Sun C compiler. It runs at 22 cycles/limb on the
27 C UltraSPARC-1/2, three cycles slower than theoretically possible for optimal
28 C code using the same algorithm. For 1-3 limbs, a special loop was generated,
29 C which causes performance problems in particular for 2 and 3 limbs.
30 C Ultimately, this should be replaced by hand-written code in the same software
31 C pipeline style as e.g., addmul_1.asm.
34 REGISTER(%g2,#scratch)
35 REGISTER(%g3,#scratch)
36 PROLOGUE(mpn_sqr_diagonal)
39 sethi %hi(0x1ffc00), %o0
40 sethi %hi(0x3ffc00), %o1
65 fmuld %f12, %f12, %f10
97 .Loop: srlx %o2, 21, %g3
114 fmuld %f10, %f10, %f0
116 fmuld %f10, %f14, %f6
118 fmuld %f10, %f8, %f12
123 fmuld %f14, %f14, %f10
166 fmuld %f16, %f16, %f14
187 faddd %f10, %f12, %f16
214 faddd %f10, %f10, %f10
216 fmuld %f12, %f12, %f4
268 restore %g0, %g0, %g0
293 fmuld %f10, %f10, %f0
330 restore %g0, %g0, %g0
331 EPILOGUE(mpn_sqr_diagonal)