[BACK]Return to sub_n.s CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / i960

Annotation of OpenXM_contrib/gmp/mpn/i960/sub_n.s, Revision 1.1.1.2

1.1.1.2 ! maekawa     1: # I960 __gmpn_sub_n -- Subtract two limb vectors of the same length > 0 and
1.1       maekawa     2: # store difference in a third limb vector.
                      3:
1.1.1.2 ! maekawa     4: # Copyright (C) 1995, 2000 Free Software Foundation, Inc.
1.1       maekawa     5:
                      6: # This file is part of the GNU MP Library.
                      7:
                      8: # The GNU MP Library is free software; you can redistribute it and/or modify
1.1.1.2 ! maekawa     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
1.1       maekawa    11: # option) any later version.
                     12:
                     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
1.1.1.2 ! maekawa    15: # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
1.1       maekawa    16: # License for more details.
                     17:
1.1.1.2 ! maekawa    18: # You should have received a copy of the GNU Lesser General Public License
1.1       maekawa    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,
                     21: # MA 02111-1307, USA.
                     22:
                     23: .text
                     24:        .align 4
1.1.1.2 ! maekawa    25:        .globl ___gmpn_sub_n
        !            26: ___gmpn_sub_n:
1.1       maekawa    27:        mov     1,g6            # set carry-save register
                     28:        cmpo    1,0             # clear cy
                     29:
                     30: Loop:  subo    1,g3,g3         # update loop counter
                     31:        ld      (g1),g5         # load from s1_ptr
                     32:        addo    4,g1,g1         # s1_ptr++
                     33:        ld      (g2),g4         # load from s2_ptr
                     34:        addo    4,g2,g2         # s2_ptr++
                     35:        cmpo    g6,1            # restore cy from g6, relies on cy being 0
                     36:        subc    g4,g5,g4        # main subtract
                     37:        subc    0,0,g6          # save cy in g6
                     38:        st      g4,(g0)         # store result to res_ptr
                     39:        addo    4,g0,g0         # res_ptr++
                     40:        cmpobne 0,g3,Loop       # when branch is taken, cy will be 0
                     41:
                     42:        mov     g6,g0
                     43:        ret

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>