1 # PowerPC-32 __mpn_sub_n -- Subtract two limb vectors of the same length > 0
2 # and store difference in a third 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 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., 59 Temple Place - Suite 330, Boston,
31 .extern __mpn_sub_n[DS]
37 .csect __mpn_sub_n[DS]
39 .long .__mpn_sub_n, TOC[tc0], 0
42 mtctr 6 # copy size into CTR
43 lwz 8,0(4) # load least significant s1 limb
44 lwz 0,0(5) # load least significant s2 limb
45 addi 3,3,-4 # offset res_ptr, it's updated before used
46 subfc 7,0,8 # add least significant limbs, set cy
47 bdz Lend # If done, skip loop
48 Loop: lwzu 8,4(4) # load s1 limb and update s1_ptr
49 lwzu 0,4(5) # load s2 limb and update s2_ptr
50 stwu 7,4(3) # store previous limb in load latency slot
51 subfe 7,0,8 # add new limbs with cy, set cy
52 bdnz Loop # decrement CTR and loop back
53 Lend: stw 7,4(3) # store ultimate result limb
54 subfe 3,0,0 # load !cy into ...
55 subfic 3,3,0 # ... return value register