1 ; HP-PA 7100/7200 __gmpn_addmul_1 -- Multiply a limb vector with a limb and
2 ; add the result to a second limb vector.
4 ; Copyright (C) 1995, 2000 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,
39 #define hi1 %r23 /* safe to reuse */
44 .export __gmpn_addmul_1
47 .callinfo frame=128,no_calls
51 stws s2_limb,-16(%r30)
52 add %r0,%r0,cylimb ; clear cy and cylimb
53 addib,< -4,size,L$few_limbs
54 fldws -16(%r30),%fr31R
65 fldws,ma 4(s1_ptr),%fr4
67 xmpyu %fr4,%fr31R,%fr5
72 addib,< -1,size,L$few_limbs
75 ; start software pipeline ----------------------------------------------------
76 L$0 fldds,ma 8(s1_ptr),%fr4
77 fldds,ma 8(s1_ptr),%fr8
79 xmpyu %fr4L,%fr31R,%fr5
80 xmpyu %fr4R,%fr31R,%fr6
81 xmpyu %fr8L,%fr31R,%fr9
82 xmpyu %fr8R,%fr31R,%fr10
103 addib,< -4,size,L$end
104 addc %r0,hi3,cylimb ; propagate carry into cylimb
105 ; main loop ------------------------------------------------------------------
106 L$loop fldds,ma 8(s1_ptr),%fr4
107 fldds,ma 8(s1_ptr),%fr8
110 xmpyu %fr4L,%fr31R,%fr5
112 xmpyu %fr4R,%fr31R,%fr6
114 xmpyu %fr8L,%fr31R,%fr9
116 xmpyu %fr8R,%fr31R,%fr10
137 stws,ma s0,4(res_ptr)
139 stws,ma s1,4(res_ptr)
141 stws,ma s2,4(res_ptr)
143 stws,ma s3,4(res_ptr)
145 addib,>= -4,size,L$loop
146 addc %r0,hi3,cylimb ; propagate carry into cylimb
147 ; finish software pipeline ---------------------------------------------------
148 L$end ldws 0(res_ptr),s0
154 stws,ma s0,4(res_ptr)
156 stws,ma s1,4(res_ptr)
158 stws,ma s2,4(res_ptr)
160 stws,ma s3,4(res_ptr)
162 ; restore callee-saves registers ---------------------------------------------
170 addib,=,n 4,size,L$ret
171 L$loop2 fldws,ma 4(s1_ptr),%fr4
173 xmpyu %fr4,%fr31R,%fr5
180 stws,ma s0,4(res_ptr)
181 addib,<> -1,size,L$loop2
184 L$ret addc %r0,cylimb,cylimb