.
[glibc.git] / sysdeps / alpha / sub_n.s
blob5200025b4156aab7f150cde46d26f600cd6f854a
1 # Alpha __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 $16
25 # s1_ptr $17
26 # s2_ptr $18
27 # size $19
29 .set noreorder
30 .set noat
31 .text
32 .align 3
33 .globl __mpn_sub_n
34 .ent __mpn_sub_n
35 __mpn_sub_n:
36 .frame $30,0,$26,0
38 ldq $3,0($17)
39 ldq $4,0($18)
41 subq $19,1,$19
42 and $19,4-1,$2 # number of limbs in first loop
43 bis $31,$31,$0
44 beq $2,.L0 # if multiple of 4 limbs, skip first loop
46 subq $19,$2,$19
48 .Loop0: subq $2,1,$2
49 ldq $5,8($17)
50 addq $4,$0,$4
51 ldq $6,8($18)
52 cmpult $4,$0,$1
53 subq $3,$4,$4
54 cmpult $3,$4,$0
55 stq $4,0($16)
56 or $0,$1,$0
58 addq $17,8,$17
59 addq $18,8,$18
60 bis $5,$5,$3
61 bis $6,$6,$4
62 addq $16,8,$16
63 bne $2,.Loop0
65 .L0: beq $19,.Lend
67 .align 3
68 .Loop: subq $19,4,$19
70 ldq $5,8($17)
71 addq $4,$0,$4
72 ldq $6,8($18)
73 cmpult $4,$0,$1
74 subq $3,$4,$4
75 cmpult $3,$4,$0
76 stq $4,0($16)
77 or $0,$1,$0
79 ldq $3,16($17)
80 addq $6,$0,$6
81 ldq $4,16($18)
82 cmpult $6,$0,$1
83 subq $5,$6,$6
84 cmpult $5,$6,$0
85 stq $6,8($16)
86 or $0,$1,$0
88 ldq $5,24($17)
89 addq $4,$0,$4
90 ldq $6,24($18)
91 cmpult $4,$0,$1
92 subq $3,$4,$4
93 cmpult $3,$4,$0
94 stq $4,16($16)
95 or $0,$1,$0
97 ldq $3,32($17)
98 addq $6,$0,$6
99 ldq $4,32($18)
100 cmpult $6,$0,$1
101 subq $5,$6,$6
102 cmpult $5,$6,$0
103 stq $6,24($16)
104 or $0,$1,$0
106 addq $17,32,$17
107 addq $18,32,$18
108 addq $16,32,$16
109 bne $19,.Loop
111 .Lend: addq $4,$0,$4
112 cmpult $4,$0,$1
113 subq $3,$4,$4
114 cmpult $3,$4,$0
115 stq $4,0($16)
116 or $0,$1,$0
117 ret $31,($26),1
119 .end __mpn_sub_n