new beta-0.90.0
[luatex.git] / source / libs / gmp / gmp-src / mpn / sparc64 / ultrasparct1 / addmul_1.asm
blob29dba966f3d1a89b75ca9fd68f504151063d42e3
1 dnl SPARC v9 mpn_addmul_1 for T1/T2.
3 dnl Copyright 2010 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
6 dnl
7 dnl The GNU MP Library is free software; you can redistribute it and/or modify
8 dnl it under the terms of either:
9 dnl
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.
13 dnl
14 dnl or
15 dnl
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
18 dnl later version.
19 dnl
20 dnl or both in parallel, as here.
21 dnl
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
25 dnl for more details.
26 dnl
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')
33 C cycles/limb
34 C UltraSPARC T1: 74
35 C UltraSPARC T2: ?
37 C INPUT PARAMETERS
38 define(`rp', `%i0')
39 define(`up', `%i1')
40 define(`n', `%i2')
41 define(`v0', `%i3')
43 ASM_START()
44 REGISTER(%g2,#scratch)
45 REGISTER(%g3,#scratch)
46 PROLOGUE(mpn_addmul_1)
47 save %sp, -176, %sp
48 mov 1, %o2
49 mov %i0, %g2
50 srlx %i3, 32, %o4
51 sllx %o2, 32, %o2
52 srl %i3, 0, %i3
53 mov 0, %g3
54 mov 0, %i0
56 L(top): ldx [%i1+%g3], %g1
57 srl %g1, 0, %g4
58 mulx %g4, %i3, %o5
59 srlx %g1, 32, %g1
60 mulx %g1, %i3, %g5
61 mulx %g4, %o4, %g4
62 mulx %g1, %o4, %g1
63 srlx %o5, 32, %o1
64 add %g5, %o1, %o1
65 addcc %o1, %g4, %g4
66 srl %o5, 0, %o0
67 ldx [%g2+%g3], %o5
68 sllx %g4, 32, %o1
69 add %g1, %o2, %l1
70 movlu %xcc, %l1, %g1
71 add %o1, %o0, %l0
72 addcc %l0, %i0, %g5
73 srlx %g4, 32, %i0
74 add %i0, 1, %g4
75 movlu %xcc, %g4, %i0
76 addcc %o5, %g5, %g5
77 stx %g5, [%g2+%g3]
78 add %i0, 1, %g4
79 movlu %xcc, %g4, %i0
80 add %i2, -1, %i2
81 add %i0, %g1, %i0
82 brnz,pt %i2, L(top)
83 add %g3, 8, %g3
84 return %i7+8
85 nop
86 EPILOGUE()