beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / sparc32 / v8 / submul_1.asm
blob187314eceff425fb70563fbfbec65db7427bbcc8
1 dnl SPARC v8 mpn_submul_1 -- Multiply a limb vector with a limb and
2 dnl subtract the result from a second limb vector.
4 dnl Copyright 1992-1994, 2000 Free Software Foundation, Inc.
6 dnl This file is part of the GNU MP Library.
7 dnl
8 dnl The GNU MP Library is free software; you can redistribute it and/or modify
9 dnl it under the terms of either:
10 dnl
11 dnl * the GNU Lesser General Public License as published by the Free
12 dnl Software Foundation; either version 3 of the License, or (at your
13 dnl option) any later version.
14 dnl
15 dnl or
16 dnl
17 dnl * the GNU General Public License as published by the Free Software
18 dnl Foundation; either version 2 of the License, or (at your option) any
19 dnl later version.
20 dnl
21 dnl or both in parallel, as here.
22 dnl
23 dnl The GNU MP Library is distributed in the hope that it will be useful, but
24 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 dnl for more details.
27 dnl
28 dnl You should have received copies of the GNU General Public License and the
29 dnl GNU Lesser General Public License along with the GNU MP Library. If not,
30 dnl see https://www.gnu.org/licenses/.
33 include(`../config.m4')
35 C INPUT PARAMETERS
36 C res_ptr o0
37 C s1_ptr o1
38 C size o2
39 C s2_limb o3
41 ASM_START()
42 PROLOGUE(mpn_submul_1)
43 sub %g0,%o2,%o2 C negate ...
44 sll %o2,2,%o2 C ... and scale size
45 sub %o1,%o2,%o1 C o1 is offset s1_ptr
46 sub %o0,%o2,%g1 C g1 is offset res_ptr
48 mov 0,%o0 C clear cy_limb
50 L(loop):
51 ld [%o1+%o2],%o4
52 ld [%g1+%o2],%g2
53 umul %o4,%o3,%o5
54 rd %y,%g3
55 addcc %o5,%o0,%o5
56 addx %g3,0,%o0
57 subcc %g2,%o5,%g2
58 addx %o0,0,%o0
59 st %g2,[%g1+%o2]
61 addcc %o2,4,%o2
62 bne L(loop)
63 nop
65 retl
66 nop
67 EPILOGUE(mpn_submul_1)