1 dnl SPARC 64-bit mpn_mul_1 -- Multiply a limb vector with a limb and
2 dnl store 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.
23 include(`../config.m4')
32 .register %g2,#scratch
33 .register %g3,#scratch
38 C We store 0.0 in f10 and keep it invariant accross thw two
39 C function calls below. Note that this is not ABI conformant,
40 C but since the functions are local, that's acceptable.
43 ld [%o7+L(noll)-L(pc)],%f10',
44 ` sethi %hh(L(noll)),%g2
45 sethi %lm(L(noll)),%g1
46 or %g2,%hm(L(noll)),%g2
47 or %g1,%lo(L(noll)),%g1
54 bcc,pt %xcc,L(nooverlap)
57 sllx %i2,3,%g2 C compute stack allocation byte count
63 mov %i1,%o1 C copy s1_ptr to mpn_copyi's srcp
65 mov %i2,%o2 C copy n to mpn_copyi's count parameter
70 C First multiply-add with low 32 bits of s2_limb
77 mov %o0,%l0 C keep carry-out from accmull
79 C Now multiply-add with high 32 bits of s2_limb, unless it is zero.
94 C Put a zero in the text segment to allow us to t the address
95 C quickly when compiling for PIC
107 include_mpn(`sparc64/mul_1h.asm')
112 define(`E',`L(u.$1)')
113 include_mpn(`sparc64/addmul1h.asm')