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

Annotation of OpenXM_contrib/gmp/mpn/z8000/sub_n.s, Revision 1.1.1.1

1.1       maekawa     1: ! Z8000 __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) 1993, 1994 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:
                     24: ! INPUT PARAMETERS
                     25: ! res_ptr      r7
                     26: ! s1_ptr       r6
                     27: ! s2_ptr       r5
                     28: ! size         r4
                     29:
                     30: ! If we are really crazy, we can use push to write a few result words
                     31: ! backwards, using push just because it is faster than reg+disp.  We'd
                     32: ! then add 2x the number of words written to r7...
                     33:
                     34:        unseg
                     35:        .text
                     36:        even
                     37:        global ___mpn_sub_n
                     38: ___mpn_sub_n:
                     39:        pop     r0,@r6
                     40:        pop     r1,@r5
                     41:        sub     r0,r1
                     42:        ld      @r7,r0
                     43:        dec     r4
                     44:        jr      eq,Lend
                     45: Loop:  pop     r0,@r6
                     46:        pop     r1,@r5
                     47:        sbc     r0,r1
                     48:        inc     r7,#2
                     49:        ld      @r7,r0
                     50:        dec     r4
                     51:        jr      ne,Loop
                     52: Lend:  ld      r2,r4           ! use 0 already in r4
                     53:        adc     r2,r2
                     54:        ret     t

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