Convert to keyserv, telnetd and telnet to libcrypto's BIGNUM
[dragonfly.git] / contrib / libgmp / mpn / alpha / sub_n.s
1 /* $Id$
2  # Alpha __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
3  # store difference in a third limb vector.
4
5  # Copyright (C) 1995 Free Software Foundation, Inc.
6
7  # This file is part of the GNU MP Library.
8
9  # The GNU MP Library is free software; you can redistribute it and/or modify
10  # it under the terms of the GNU Library General Public License as published by
11  # the Free Software Foundation; either version 2 of the License, or (at your
12  # option) any later version.
13
14  # The GNU MP Library is distributed in the hope that it will be useful, but
15  # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
17  # License for more details.
18
19  # You should have received a copy of the GNU Library General Public License
20  # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
21  # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22  # MA 02111-1307, USA.
23
24
25  # INPUT PARAMETERS
26  # res_ptr      $16
27  # s1_ptr       $17
28  # s2_ptr       $18
29  # size         $19
30 */
31
32         .set    noreorder
33         .set    noat
34 .text
35         .align  3
36         .globl  __mpn_sub_n
37         .ent    __mpn_sub_n
38 __mpn_sub_n:
39         .frame  $30,0,$26,0
40
41         ldq     $3,0($17)
42         ldq     $4,0($18)
43
44         subq    $19,1,$19
45         and     $19,4-1,$2      # number of limbs in first loop
46         bis     $31,$31,$0
47         beq     $2,.L0          # if multiple of 4 limbs, skip first loop
48
49         subq    $19,$2,$19
50
51 .Loop0: subq    $2,1,$2
52         ldq     $5,8($17)
53         addq    $4,$0,$4
54         ldq     $6,8($18)
55         cmpult  $4,$0,$1
56         subq    $3,$4,$4
57         cmpult  $3,$4,$0
58         stq     $4,0($16)
59         or      $0,$1,$0
60
61         addq    $17,8,$17
62         addq    $18,8,$18
63         bis     $5,$5,$3
64         bis     $6,$6,$4
65         addq    $16,8,$16
66         bne     $2,.Loop0
67
68 .L0:    beq     $19,.Lend
69
70         .align  3
71 .Loop:  subq    $19,4,$19
72
73         ldq     $5,8($17)
74         addq    $4,$0,$4
75         ldq     $6,8($18)
76         cmpult  $4,$0,$1
77         subq    $3,$4,$4
78         cmpult  $3,$4,$0
79         stq     $4,0($16)
80         or      $0,$1,$0
81
82         ldq     $3,16($17)
83         addq    $6,$0,$6
84         ldq     $4,16($18)
85         cmpult  $6,$0,$1
86         subq    $5,$6,$6
87         cmpult  $5,$6,$0
88         stq     $6,8($16)
89         or      $0,$1,$0
90
91         ldq     $5,24($17)
92         addq    $4,$0,$4
93         ldq     $6,24($18)
94         cmpult  $4,$0,$1
95         subq    $3,$4,$4
96         cmpult  $3,$4,$0
97         stq     $4,16($16)
98         or      $0,$1,$0
99
100         ldq     $3,32($17)
101         addq    $6,$0,$6
102         ldq     $4,32($18)
103         cmpult  $6,$0,$1
104         subq    $5,$6,$6
105         cmpult  $5,$6,$0
106         stq     $6,24($16)
107         or      $0,$1,$0
108
109         addq    $17,32,$17
110         addq    $18,32,$18
111         addq    $16,32,$16
112         bne     $19,.Loop
113
114 .Lend:  addq    $4,$0,$4
115         cmpult  $4,$0,$1
116         subq    $3,$4,$4
117         cmpult  $3,$4,$0
118         stq     $4,0($16)
119         or      $0,$1,$0
120         ret     $31,($26),1
121
122         .end    __mpn_sub_n