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

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

1.1.1.2 ! maekawa     1: ! Z8000 (32 bit limb version) __gmpn_sub_n -- Subtract two limb vectors of the
1.1       maekawa     2: ! same length > 0 and store difference in a third limb vector.
                      3:
1.1.1.2 ! maekawa     4: ! Copyright (C) 1993, 1994, 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:
                     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:        segm
                     35:        .text
                     36:        even
1.1.1.2 ! maekawa    37:        global ___gmpn_sub_n
        !            38: ___gmpn_sub_n:
1.1       maekawa    39:        popl    rr0,@r6
                     40:        popl    rr8,@r5
                     41:        subl    rr0,rr8
                     42:        ldl     @r7,rr0
                     43:        dec     r4
                     44:        jr      eq,Lend
                     45: Loop:  popl    rr0,@r6
                     46:        popl    rr8,@r5
                     47:        sbc     r1,r9
                     48:        sbc     r0,r8
                     49:        inc     r7,#4
                     50:        ldl     @r7,rr0
                     51:        dec     r4
                     52:        jr      ne,Loop
                     53: Lend:  ld      r2,r4           ! use 0 already in r4
                     54:        ld      r3,r4
                     55:        adc     r2,r2
                     56:        ret     t

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