Debian Codegraph @

mpn/sparc32/v8/mul_1.asm

raw
1 dnl SPARC v8 mpn_mul_1 -- Multiply a limb vector with a single limb and
2 dnl store the product in a second limb vector.
3
4 dnl Copyright 1992, 1994, 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_mul_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 st %g3,[%o0+0] C 1
64 rd %y,%g2 C 1
65 L(00): umul %o4,%o3,%g3 C 2
66 addxcc %g3,%g2,%g3 C 2
67 ld [%o1+8],%o4 C 3
68 st %g3,[%o0+4] C 2
69 rd %y,%g2 C 2
70 L(11): umul %o4,%o3,%g3 C 3
71 addxcc %g3,%g2,%g3 C 3
72 ld [%o1+12],%o4 C 4
73 add %o1,16,%o1
74 st %g3,[%o0+8] C 3
75 rd %y,%g2 C 3
76 L(10): umul %o4,%o3,%g3 C 4
77 addxcc %g3,%g2,%g3 C 4
78 ld [%o1+0],%o4 C 1
79 st %g3,[%o0+12] C 4
80 add %o0,16,%o0
81 rd %y,%g2 C 4
82 addx %g0,%g2,%g2
83 L(01): addcc %o2,-4,%o2
84 bg L(top)
85 umul %o4,%o3,%g3 C 1
86
87 addcc %g3,%g2,%g3 C 4
88 st %g3,[%o0+0] C 4
89 rd %y,%g2 C 4
90
91 retl
92 addx %g0,%g2,%o0
93 EPILOGUE(mpn_mul_1)