1 dnl SPARC v9 32-bit mpn_submul_1 -- Multiply a limb vector with a limb and
2 dnl subtract the result from 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_submul_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 %g3,%g1,%g4 C p += cy
117 subcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
120 ldx [%fp-24],%g2 C p16
122 ldx [%fp-16],%g1 C p0
124 sllx %g2,16,%g2 C align p16
128 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
134 add %i0,4,%i0 C res_ptr++
138 add %i1,4,%i1 C s1_ptr++
139 add %g3,%g1,%g4 C p += cy
140 subcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
143 ldx [%fp-40],%g2 C p16
145 ldx [%fp-32],%g1 C p0
147 sllx %g2,16,%g2 C align p16
151 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
157 add %i0,4,%i0 C res_ptr++
161 add %g3,%g1,%g4 C p += cy
162 subcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
165 ldx [%fp-24],%g2 C p16
167 ldx [%fp-16],%g1 C p0
169 sllx %g2,16,%g2 C align p16
175 add %g3,%g1,%g4 C p += cy
176 subcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
179 ldx [%fp-40],%g2 C p16
181 ldx [%fp-32],%g1 C p0
183 sllx %g2,16,%g2 C align p16
186 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
190 add %i0,4,%i0 C res_ptr++
192 add %g3,%g1,%g4 C p += cy
193 subxcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
196 ldx [%fp-24],%g2 C p16
197 ldx [%fp-16],%g1 C p0
198 sllx %g2,16,%g2 C align p16
205 ldx [%fp-24],%g2 C p16
207 ldx [%fp-16],%g1 C p0
209 sllx %g2,16,%g2 C align p16
210 L(xxx): fdtox %f16,%f14
211 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
215 add %i0,4,%i0 C res_ptr++
217 add %g3,%g1,%g4 C p += cy
218 subxcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
221 ldx [%fp-40],%g2 C p16
222 ldx [%fp-32],%g1 C p0
223 sllx %g2,16,%g2 C align p16
225 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
226 add %i0,4,%i0 C res_ptr++
228 add %g3,%g1,%g4 C p += cy
229 subxcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
232 ldx [%fp-24],%g2 C p16
233 ldx [%fp-16],%g1 C p0
234 sllx %g2,16,%g2 C align p16
236 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
237 add %i0,4,%i0 C res_ptr++
249 ldx [%fp-24],%g2 C p16
250 ldx [%fp-16],%g1 C p0
251 sllx %g2,16,%g2 C align p16
252 L(yyy): add %g2,%g1,%g1 C add p16 to p0 (ADD1)
253 add %i0,4,%i0 C res_ptr++
255 add %g3,%g1,%g4 C p += cy
256 subxcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
259 ldx [%fp-40],%g2 C p16
260 ldx [%fp-32],%g1 C p0
261 sllx %g2,16,%g2 C align p16
263 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
264 add %i0,4,%i0 C res_ptr++
277 ldx [%fp-24],%g2 C p16
278 ldx [%fp-16],%g1 C p0
279 sllx %g2,16,%g2 C align p16
280 add %g2,%g1,%g1 C add p16 to p0 (ADD1)
281 add %i0,4,%i0 C res_ptr++
283 L(ret): add %g3,%g1,%g4 C p += cy
284 subxcc %g5,%g4,%l2 C add *res_ptr to p0 (ADD2)
290 restore %g0,%g3,%o0 C sideeffect: put cy in retreg
291 EPILOGUE(mpn_submul_1)