1 # Alpha 21064 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
2 # the result to a second limb vector.
4 # Copyright (C) 1992, 1994, 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 Lesser General Public License as published by
10 # the Free Software Foundation; either version 2.1 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 Lesser General Public
16 # License for more details.
18 # You should have received a copy of the GNU Lesser 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., 59 Temple Place - Suite 330, Boston,
30 # This code runs at 42 cycles/limb on EV4 and 18 cycles/limb on EV5.
41 ldq $
2,0($
17) # $2 = s1_limb
42 addq $
17,8,$
17 # s1_ptr++
43 subq $
18,1,$
18 # size--
44 mulq $
2,$
19,$
3 # $3 = prod_low
45 ldq $
5,0($
16) # $5 = *res_ptr
46 umulh $
2,$
19,$
0 # $0 = prod_high
47 beq $
18,.Lend1 # jump if size was == 1
48 ldq $
2,0($
17) # $2 = s1_limb
49 addq $
17,8,$
17 # s1_ptr++
50 subq $
18,1,$
18 # size--
54 addq $
16,8,$
16 # res_ptr++
55 beq $
18,.Lend2 # jump if size was == 2
58 .Loop: mulq $2,$19,$3 # $3 = prod_low
59 ldq $
5,0($
16) # $5 = *res_ptr
60 addq $
4,$
0,$
0 # cy_limb = cy_limb + 'cy'
61 subq $
18,1,$
18 # size--
62 umulh $
2,$
19,$
4 # $4 = cy_limb
63 ldq $
2,0($
17) # $2 = s1_limb
64 addq $
17,8,$
17 # s1_ptr++
65 addq $
3,$
0,$
3 # $3 = cy_limb + prod_low
66 cmpult $
3,$
0,$
0 # $0 = carry from (cy_limb + prod_low)
70 addq $
16,8,$
16 # res_ptr++
71 addq $
5,$
0,$
0 # combine carries
74 .Lend2: mulq $2,$19,$3 # $3 = prod_low
75 ldq $
5,0($
16) # $5 = *res_ptr
76 addq $
4,$
0,$
0 # cy_limb = cy_limb + 'cy'
77 umulh $
2,$
19,$
4 # $4 = cy_limb
78 addq $
3,$
0,$
3 # $3 = cy_limb + prod_low
79 cmpult $
3,$
0,$
0 # $0 = carry from (cy_limb + prod_low)
83 addq $
5,$
0,$
0 # combine carries
84 addq $
4,$
0,$
0 # cy_limb = prod_high + cy