Debian Codegraph @

mpn/sparc32/v8/addmul_1.asm

raw
1 dnl SPARC v8 mpn_addmul_1 -- Multiply a limb vector with a limb and
2 dnl add the result to a second limb vector.
3
4 dnl Copyright 1992-1995, 2000 Free Software Foundation, Inc.
5
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/.
31
32
33 include(`../config.m4')
34
35 C INPUT PARAMETERS
36 C res_ptr o0
37 C s1_ptr o1
38 C size o2
39 C s2_limb o3
40
41 ASM_START()
42 PROLOGUE(mpn_addmul_1)
43 ld [%o1+0],%o4
44 andcc %o2,1,%g0
45 be L(bx0)
46 andcc %o2,2,%g0
47 L(bx1): be L(01)
48 orcc %g0,%g0,%g2
49 L(b11): add %o0,-8,%o0
50 b L(11)
51 add %o1,-8,%o1
52 L(bx0): be L(b00)
53 orcc %g0,%g0,%g2
54 L(b10): add %o0,-12,%o0
55 b L(10)
56 add %o1,4,%o1
57 L(b00): add %o0,-4,%o0
58 b L(00)
59 add %o1,-4,%o1
60
61 L(top): addcc %g3,%g2,%g3 C 1
62 ld [%o1+4],%o4 C 2
63 rd %y,%g2 C 1
64 addx %g0,%g2,%g2
65 ld [%o0+0],%g1 C 2
66 addcc %g1,%g3,%g3
67 st %g3,[%o0+0] C 1
68 L(00): umul %o4,%o3,%g3 C 2
69 ld [%o0+4],%g1 C 2
70 addxcc %g3,%g2,%g3 C 2
71 ld [%o1+8],%o4 C 3
72 rd %y,%g2 C 2
73 addx %g0,%g2,%g2
74 nop
75 addcc %g1,%g3,%g3
76 st %g3,[%o0+4] C 2
77 L(11): umul %o4,%o3,%g3 C 3
78 addxcc %g3,%g2,%g3 C 3
79 ld [%o1+12],%o4 C 4
80 rd %y,%g2 C 3
81 add %o1,16,%o1
82 addx %g0,%g2,%g2
83 ld [%o0+8],%g1 C 2
84 addcc %g1,%g3,%g3
85 st %g3,[%o0+8] C 3
86 L(10): umul %o4,%o3,%g3 C 4
87 addxcc %g3,%g2,%g3 C 4
88 ld [%o1+0],%o4 C 1
89 rd %y,%g2 C 4
90 addx %g0,%g2,%g2
91 ld [%o0+12],%g1 C 2
92 addcc %g1,%g3,%g3
93 st %g3,[%o0+12] C 4
94 add %o0,16,%o0
95 addx %g0,%g2,%g2
96 L(01): addcc %o2,-4,%o2
97 bg L(top)
98 umul %o4,%o3,%g3 C 1
99
100 addcc %g3,%g2,%g3 C 4
101 rd %y,%g2 C 4
102 addx %g0,%g2,%g2
103 ld [%o0+0],%g1 C 2
104 addcc %g1,%g3,%g3
105 st %g3,[%o0+0] C 4
106
107 retl
108 addx %g0,%g2,%o0
109 EPILOGUE(mpn_addmul_1)