Annotation of OpenXM/src/kan96xx/gmp-2.0.2-ssh-2/mpn/i960/sub_n.s, Revision 1.1
1.1 ! takayama 1: # I960 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
! 2: # store difference in a third limb vector.
! 3:
! 4: # Copyright (C) 1995 Free Software Foundation, Inc.
! 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
! 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.
! 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
! 15: # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
! 16: # License for more details.
! 17:
! 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,
! 21: # MA 02111-1307, USA.
! 22:
! 23: .text
! 24: .align 4
! 25: .globl ___mpn_sub_n
! 26: ___mpn_sub_n:
! 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>