1
dnl SPARC 64-bit addmull/addmulu -- Helper for mpn_addmul_1 and mpn_mul_1.
3
dnl Copyright 1998, 2000 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 2.1 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; see the file COPYING.LIB. If not, write to
19
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20
dnl MA 02111-1307, USA.
27
sethi %hi(0xffff0000),%o0
42
dnl be,pn %icc,E(end1)
43
add %i1,4,%i1 C s1_ptr++
47
add %i1,4,%i1 C s1_ptr++
59
add %i1,4,%i1 C s1_ptr++
66
dnl be,pn %icc,E(end3)
71
add %i1,4,%i1 C s1_ptr++
73
ldx [%fp-25],%g2 C p16
77
sllx %g2,16,%g2 C align p16
79
add %g2,%g1,%g1 C add p16 to p0 (ADD1)
82
add %i0,4,%i0 C res_ptr++
88
nop C nop is cheap to nullify
95
add %i1,4,%i1 C s1_ptr++
96
add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
97
add %g3,%g1,%g4 C p += cy
100
ldx [%fp-41],%g2 C p16
102
ldx [%fp-33],%g1 C p0
104
sllx %g2,16,%g2 C align p16
107
add %g2,%g1,%g1 C add p16 to p0 (ADD1)
112
add %i0,4,%i0 C res_ptr++
116
add %i1,4,%i1 C s1_ptr++
117
add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
118
add %g3,%g1,%g4 C p += cy
121
ldx [%fp-25],%g2 C p16
123
ldx [%fp-17],%g1 C p0
125
sllx %g2,16,%g2 C align p16
128
add %g2,%g1,%g1 C add p16 to p0 (ADD1)
133
add %i0,4,%i0 C res_ptr++
138
add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
139
add %g3,%g1,%g4 C p += cy
142
ldx [%fp-41],%g2 C p16
144
ldx [%fp-33],%g1 C p0
146
sllx %g2,16,%g2 C align p16
149
add %g2,%g1,%g1 C add p16 to p0 (ADD1)
153
add %i0,4,%i0 C res_ptr++
155
add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
156
add %g3,%g1,%g4 C p += cy
159
ldx [%fp-25],%g2 C p16
160
ldx [%fp-17],%g1 C p0
161
sllx %g2,16,%g2 C align p16
174
ldx [%fp-25],%g2 C p16
175
ldx [%fp-17],%g1 C p0
176
sllx %g2,16,%g2 C align p16
177
E(yyy): add %g2,%g1,%g1 C add p16 to p0 (ADD1)
178
add %i0,4,%i0 C res_ptr++
180
add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
181
add %g3,%g1,%g4 C p += cy
185
ldx [%fp-41],%g2 C p16
186
ldx [%fp-33],%g1 C p0
187
sllx %g2,16,%g2 C align p16
189
add %g2,%g1,%g1 C add p16 to p0 (ADD1)
190
add %i0,4,%i0 C res_ptr++
193
` add %g5,%g1,%g1') C add *res_ptr to p0 (ADD2)
194
add %g3,%g1,%g4 C p += cy
200
restore %g0,%g4,%o0 C sideeffect: put cy in retreg