1 # I960 __gmpn_add_n -- Add two limb vectors of the same length > 0 and store
2 # sum in a third limb vector.
4 # Copyright 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 3 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. If not, see http://www.gnu.org/licenses/.
25 mov 0,g6 # clear carry-save register
28 Loop: subo 1,g3,g3 # update loop counter
29 ld (g1),g5 # load from s1_ptr
30 addo 4,g1,g1 # s1_ptr++
31 ld (g2),g4 # load from s2_ptr
32 addo 4,g2,g2 # s2_ptr++
33 cmpo g6,1 # restore cy from g6, relies on cy being 0
34 addc g4,g5,g4 # main add
35 subc 0,0,g6 # save cy in g6
36 st g4,(g0) # store result to res_ptr
37 addo 4,g0,g0 # res_ptr++
38 cmpobne 0,g3,Loop # when branch is taken, clears C bit