Annotation of OpenXM_contrib/gmp/mpn/mips32/sub_n.asm, Revision 1.1.1.1
1.1 ohara 1: dnl MIPS32 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
2: dnl store difference 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_sub_n)
33: lw $10,0($5)
34: lw $11,0($6)
35:
36: addiu $7,$7,-1
37: and $9,$7,4-1 C number of limbs in first loop
38: beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
39: move $2,$0
40:
41: subu $7,$7,$9
42:
43: .Loop0: addiu $9,$9,-1
44: lw $12,4($5)
45: addu $11,$11,$2
46: lw $13,4($6)
47: sltu $8,$11,$2
48: subu $11,$10,$11
49: sltu $2,$10,$11
50: sw $11,0($4)
51: or $2,$2,$8
52:
53: addiu $5,$5,4
54: addiu $6,$6,4
55: move $10,$12
56: move $11,$13
57: bne $9,$0,.Loop0
58: addiu $4,$4,4
59:
60: .L0: beq $7,$0,.Lend
61: nop
62:
63: .Loop: addiu $7,$7,-4
64:
65: lw $12,4($5)
66: addu $11,$11,$2
67: lw $13,4($6)
68: sltu $8,$11,$2
69: subu $11,$10,$11
70: sltu $2,$10,$11
71: sw $11,0($4)
72: or $2,$2,$8
73:
74: lw $10,8($5)
75: addu $13,$13,$2
76: lw $11,8($6)
77: sltu $8,$13,$2
78: subu $13,$12,$13
79: sltu $2,$12,$13
80: sw $13,4($4)
81: or $2,$2,$8
82:
83: lw $12,12($5)
84: addu $11,$11,$2
85: lw $13,12($6)
86: sltu $8,$11,$2
87: subu $11,$10,$11
88: sltu $2,$10,$11
89: sw $11,8($4)
90: or $2,$2,$8
91:
92: lw $10,16($5)
93: addu $13,$13,$2
94: lw $11,16($6)
95: sltu $8,$13,$2
96: subu $13,$12,$13
97: sltu $2,$12,$13
98: sw $13,12($4)
99: or $2,$2,$8
100:
101: addiu $5,$5,16
102: addiu $6,$6,16
103:
104: bne $7,$0,.Loop
105: addiu $4,$4,16
106:
107: .Lend: addu $11,$11,$2
108: sltu $8,$11,$2
109: subu $11,$10,$11
110: sltu $2,$10,$11
111: sw $11,0($4)
112: j $31
113: or $2,$2,$8
114: EPILOGUE(mpn_sub_n)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>