Debian Codegraph @

mpn/pa32/hppa1_1/pa7100/add_n.asm

raw
1 dnl HP-PA mpn_add_n -- Add two limb vectors of the same length > 0 and store
2 dnl sum in a third limb vector. Optimized for the PA7100, where is runs at
3 dnl 4.25 cycles/limb.
4
5 dnl Copyright 1992, 1994, 2000-2003 Free Software Foundation, Inc.
6
7 dnl This file is part of the GNU MP Library.
8 dnl
9 dnl The GNU MP Library is free software; you can redistribute it and/or modify
10 dnl it under the terms of either:
11 dnl
12 dnl * the GNU Lesser General Public License as published by the Free
13 dnl Software Foundation; either version 3 of the License, or (at your
14 dnl option) any later version.
15 dnl
16 dnl or
17 dnl
18 dnl * the GNU General Public License as published by the Free Software
19 dnl Foundation; either version 2 of the License, or (at your option) any
20 dnl later version.
21 dnl
22 dnl or both in parallel, as here.
23 dnl
24 dnl The GNU MP Library is distributed in the hope that it will be useful, but
25 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
26 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 dnl for more details.
28 dnl
29 dnl You should have received copies of the GNU General Public License and the
30 dnl GNU Lesser General Public License along with the GNU MP Library. If not,
31 dnl see https://www.gnu.org/licenses/.
32
33 include(`../config.m4')
34
35 C INPUT PARAMETERS
36 C res_ptr r26
37 C s1_ptr r25
38 C s2_ptr r24
39 C size r23
40
41 ASM_START()
42 PROLOGUE(mpn_add_n)
43 ldws,ma 4(0,%r25),%r20
44 ldws,ma 4(0,%r24),%r19
45
46 addib,<= -5,%r23,L(rest)
47 add %r20,%r19,%r28 C add first limbs ignoring cy
48
49 LDEF(loop)
50 ldws,ma 4(0,%r25),%r20
51 ldws,ma 4(0,%r24),%r19
52 stws,ma %r28,4(0,%r26)
53 addc %r20,%r19,%r28
54 ldws,ma 4(0,%r25),%r20
55 ldws,ma 4(0,%r24),%r19
56 stws,ma %r28,4(0,%r26)
57 addc %r20,%r19,%r28
58 ldws,ma 4(0,%r25),%r20
59 ldws,ma 4(0,%r24),%r19
60 stws,ma %r28,4(0,%r26)
61 addc %r20,%r19,%r28
62 ldws,ma 4(0,%r25),%r20
63 ldws,ma 4(0,%r24),%r19
64 stws,ma %r28,4(0,%r26)
65 addib,> -4,%r23,L(loop)
66 addc %r20,%r19,%r28
67
68 LDEF(rest)
69 addib,= 4,%r23,L(end)
70 nop
71
72 LDEF(eloop)
73 ldws,ma 4(0,%r25),%r20
74 ldws,ma 4(0,%r24),%r19
75 stws,ma %r28,4(0,%r26)
76 addib,> -1,%r23,L(eloop)
77 addc %r20,%r19,%r28
78
79 LDEF(end)
80 stws %r28,0(0,%r26)
81 bv 0(%r2)
82 addc %r0,%r0,%r28
83 EPILOGUE()