* sysdeps/unix/sysv/linux/tcdrain.c: Define tcdrain, not
[glibc.git] / sysdeps / mips / sub_n.s
blob63f3b553542285e4bd82b78aad81c047a4d28fd2
1 # MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
2 # store difference in a third limb vector.
4 # Copyright (C) 1995 Free Software Foundation, Inc.
6 # This file is part of the GNU MP Library.
8 # The GNU MP Library is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU Library General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or (at your
11 # option) any later version.
13 # The GNU MP Library is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
16 # License for more details.
18 # You should have received a copy of the GNU Library General Public License
19 # along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20 # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 # INPUT PARAMETERS
24 # res_ptr $4
25 # s1_ptr $5
26 # s2_ptr $6
27 # size $7
29 .text
30 .align 2
31 .globl __mpn_sub_n
32 .ent __mpn_sub_n
33 __mpn_sub_n:
34 .set noreorder
35 .set nomacro
37 lw $10,0($5)
38 lw $11,0($6)
40 addiu $7,$7,-1
41 and $9,$7,4-1 # number of limbs in first loop
42 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop
43 move $2,$0
45 subu $7,$7,$9
47 .Loop0: addiu $9,$9,-1
48 lw $12,4($5)
49 addu $11,$11,$2
50 lw $13,4($6)
51 sltu $8,$11,$2
52 subu $11,$10,$11
53 sltu $2,$10,$11
54 sw $11,0($4)
55 or $2,$2,$8
57 addiu $5,$5,4
58 addiu $6,$6,4
59 move $10,$12
60 move $11,$13
61 bne $9,$0,.Loop0
62 addiu $4,$4,4
64 .L0: beq $7,$0,.Lend
65 nop
67 .Loop: addiu $7,$7,-4
69 lw $12,4($5)
70 addu $11,$11,$2
71 lw $13,4($6)
72 sltu $8,$11,$2
73 subu $11,$10,$11
74 sltu $2,$10,$11
75 sw $11,0($4)
76 or $2,$2,$8
78 lw $10,8($5)
79 addu $13,$13,$2
80 lw $11,8($6)
81 sltu $8,$13,$2
82 subu $13,$12,$13
83 sltu $2,$12,$13
84 sw $13,4($4)
85 or $2,$2,$8
87 lw $12,12($5)
88 addu $11,$11,$2
89 lw $13,12($6)
90 sltu $8,$11,$2
91 subu $11,$10,$11
92 sltu $2,$10,$11
93 sw $11,8($4)
94 or $2,$2,$8
96 lw $10,16($5)
97 addu $13,$13,$2
98 lw $11,16($6)
99 sltu $8,$13,$2
100 subu $13,$12,$13
101 sltu $2,$12,$13
102 sw $13,12($4)
103 or $2,$2,$8
105 addiu $5,$5,16
106 addiu $6,$6,16
108 bne $7,$0,.Loop
109 addiu $4,$4,16
111 .Lend: addu $11,$11,$2
112 sltu $8,$11,$2
113 subu $11,$10,$11
114 sltu $2,$10,$11
115 sw $11,0($4)
116 j $31
117 or $2,$2,$8
119 .end __mpn_sub_n