Annotation of OpenXM_contrib/gmp/mpn/mips32/add_n.asm, Revision 1.1.1.1
1.1 ohara 1: dnl MIPS32 mpn_add_n -- Add two limb vectors of the same length > 0 and store
2: dnl sum in a third limb vector.
3:
4: dnl Copyright 1995, 2000, 2002 Free Software Foundation, Inc.
5:
6: dnl This file is part of the GNU MP Library.
7:
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.
12:
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.
17:
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.
22:
23: include(`../config.m4')
24:
25: C INPUT PARAMETERS
26: C res_ptr $4
27: C s1_ptr $5
28: C s2_ptr $6
29: C size $7
30:
31: ASM_START()
32: PROLOGUE(mpn_add_n)
33:
34: lw $10,0($5)
35: lw $11,0($6)
36:
37: addiu $7,$7,-1
38: and $9,$7,4-1 C number of limbs in first loop
39: beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
40: move $2,$0
41:
42: subu $7,$7,$9
43:
44: .Loop0: addiu $9,$9,-1
45: lw $12,4($5)
46: addu $11,$11,$2
47: lw $13,4($6)
48: sltu $8,$11,$2
49: addu $11,$10,$11
50: sltu $2,$11,$10
51: sw $11,0($4)
52: or $2,$2,$8
53:
54: addiu $5,$5,4
55: addiu $6,$6,4
56: move $10,$12
57: move $11,$13
58: bne $9,$0,.Loop0
59: addiu $4,$4,4
60:
61: .L0: beq $7,$0,.Lend
62: nop
63:
64: .Loop: addiu $7,$7,-4
65:
66: lw $12,4($5)
67: addu $11,$11,$2
68: lw $13,4($6)
69: sltu $8,$11,$2
70: addu $11,$10,$11
71: sltu $2,$11,$10
72: sw $11,0($4)
73: or $2,$2,$8
74:
75: lw $10,8($5)
76: addu $13,$13,$2
77: lw $11,8($6)
78: sltu $8,$13,$2
79: addu $13,$12,$13
80: sltu $2,$13,$12
81: sw $13,4($4)
82: or $2,$2,$8
83:
84: lw $12,12($5)
85: addu $11,$11,$2
86: lw $13,12($6)
87: sltu $8,$11,$2
88: addu $11,$10,$11
89: sltu $2,$11,$10
90: sw $11,8($4)
91: or $2,$2,$8
92:
93: lw $10,16($5)
94: addu $13,$13,$2
95: lw $11,16($6)
96: sltu $8,$13,$2
97: addu $13,$12,$13
98: sltu $2,$13,$12
99: sw $13,12($4)
100: or $2,$2,$8
101:
102: addiu $5,$5,16
103: addiu $6,$6,16
104:
105: bne $7,$0,.Loop
106: addiu $4,$4,16
107:
108: .Lend: addu $11,$11,$2
109: sltu $8,$11,$2
110: addu $11,$10,$11
111: sltu $2,$11,$10
112: sw $11,0($4)
113: j $31
114: or $2,$2,$8
115: EPILOGUE(mpn_add_n)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>