1 dnl SPARC v9 32-bit mpn_addmul_1 -- Multiply a limb vector with a limb and
2 dnl add the result to a second limb vector.
4 dnl Copyright (C) 1998, 2000 Free Software Foundation, Inc.
6 dnl This file is part of the GNU MP Library.
8 dnl The GNU MP Library is free software; you can redistribute it and/or modify
9 dnl it under the terms of the GNU Lesser General Public License as published
10 dnl by the Free Software Foundation; either version 2.1 of the License, or (at
11 dnl your option) any later version.
13 dnl The GNU MP Library is distributed in the hope that it will be useful, but
14 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 dnl License for more details.
18 dnl You should have received a copy of the GNU Lesser General Public License
19 dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21 dnl MA 02111-1307, USA.
24 include(`../config.m4')
39 PROLOGUE(mpn_addmul_1)
44 ld [%o7+L(noll)-L(pc)],%f10',
45 ` sethi %hi(L(noll)),%g1
46 ld [%g1+%lo(L(noll))],%f10')
48 sethi %hi(0xffff0000),%o0
64 add %i1,4,%i1 C s1_ptr++
68 add %i1,4,%i1 C s1_ptr++
80 add %i1,4,%i1 C s1_ptr++
92 add %i1,4,%i1 C s1_ptr++
94 ldx [%fp-24],%g2 C p16
98 sllx %g2,16,%g2 C align p16
100 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
103 add %i0,4,%i0 C res_ptr++
115 add %i1,4,%i1 C s1_ptr++
116 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
117 add %g3,%g1,%g4 C p += cy
120 ldx [%fp-24],%g2 C p16
122 ldx [%fp-16],%g1 C p0
124 sllx %g2,16,%g2 C align p16
127 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
133 add %i0,4,%i0 C res_ptr++
137 add %i1,4,%i1 C s1_ptr++
138 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
139 add %g3,%g1,%g4 C p += cy
142 ldx [%fp-40],%g2 C p16
144 ldx [%fp-32],%g1 C p0
146 sllx %g2,16,%g2 C align p16
149 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
155 add %i0,4,%i0 C res_ptr++
159 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
160 add %g3,%g1,%g4 C p += cy
163 ldx [%fp-24],%g2 C p16
165 ldx [%fp-16],%g1 C p0
167 sllx %g2,16,%g2 C align p16
173 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
174 add %g3,%g1,%g4 C p += cy
177 ldx [%fp-40],%g2 C p16
179 ldx [%fp-32],%g1 C p0
181 sllx %g2,16,%g2 C align p16
184 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
188 add %i0,4,%i0 C res_ptr++
190 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
191 add %g3,%g1,%g4 C p += cy
194 ldx [%fp-24],%g2 C p16
195 ldx [%fp-16],%g1 C p0
196 sllx %g2,16,%g2 C align p16
203 ldx [%fp-24],%g2 C p16
205 ldx [%fp-16],%g1 C p0
207 sllx %g2,16,%g2 C align p16
208 L(xxx): fdtox %f16,%f14
209 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
213 add %i0,4,%i0 C res_ptr++
215 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
216 add %g3,%g1,%g4 C p += cy
219 ldx [%fp-40],%g2 C p16
220 ldx [%fp-32],%g1 C p0
221 sllx %g2,16,%g2 C align p16
223 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
224 add %i0,4,%i0 C res_ptr++
226 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
227 add %g3,%g1,%g4 C p += cy
230 ldx [%fp-24],%g2 C p16
231 ldx [%fp-16],%g1 C p0
232 sllx %g2,16,%g2 C align p16
234 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
235 add %i0,4,%i0 C res_ptr++
247 ldx [%fp-24],%g2 C p16
248 ldx [%fp-16],%g1 C p0
249 sllx %g2,16,%g2 C align p16
250 L(yyy): add %g2,%g1,%g1 C add p16 to p0 (ADD1)
251 add %i0,4,%i0 C res_ptr++
253 add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
254 add %g3,%g1,%g4 C p += cy
257 ldx [%fp-40],%g2 C p16
258 ldx [%fp-32],%g1 C p0
259 sllx %g2,16,%g2 C align p16
261 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
262 add %i0,4,%i0 C res_ptr++
275 ldx [%fp-24],%g2 C p16
276 ldx [%fp-16],%g1 C p0
277 sllx %g2,16,%g2 C align p16
278 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
279 add %i0,4,%i0 C res_ptr++
281 L(ret): add %g5,%g1,%g1 C add *res_ptr to p0 (ADD2)
282 add %g3,%g1,%g4 C p += cy
287 restore %g0,%g3,%o0 C sideeffect: put cy in retreg
288 EPILOGUE(mpn_addmul_1)