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
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
')
37 C This was generated by the Sun C compiler. It runs at 22 cycles/limb on the
38 C UltraSPARC-1/2, three cycles slower than theoretically possible for optimal
39 C code using the same algorithm. For 1-3 limbs, a special loop was generated,
40 C which causes performance problems in particular for 2 and 3 limbs.
41 C Ultimately, this should be replaced by hand-written code in the same software
42 C pipeline style as e.g., addmul_1.asm.
45 REGISTER(%g2,#scratch)
46 REGISTER(%g3,#scratch)
47 PROLOGUE(mpn_sqr_diagonal)
50 sethi %hi(0x1ffc00), %o0
51 sethi %hi(0x3ffc00), %o1
76 fmuld %f12, %f12, %f10
108 .Loop: srlx %o2, 21, %g3
125 fmuld %f10, %f10, %f0
127 fmuld %f10, %f14, %f6
129 fmuld %f10, %f8, %f12
134 fmuld %f14, %f14, %f10
177 fmuld %f16, %f16, %f14
198 faddd %f10, %f12, %f16
225 faddd %f10, %f10, %f10
227 fmuld %f12, %f12, %f4
279 restore %g0, %g0, %g0
304 fmuld %f10, %f10, %f0
341 restore %g0, %g0, %g0
342 EPILOGUE(mpn_sqr_diagonal)