[BACK]Return to submul_1.s CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / sh / sh2

Annotation of OpenXM_contrib/gmp/mpn/sh/sh2/submul_1.s, Revision 1.1.1.1

1.1       maekawa     1: ! SH2 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
                      2: ! the result from a second 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:
                     24: ! INPUT PARAMETERS
                     25: ! res_ptr      r4
                     26: ! s1_ptr       r5
                     27: ! size         r6
                     28: ! s2_limb      r7
                     29:
                     30:        .text
                     31:        .align 1
                     32:        .global ___mpn_submul_1
                     33: ___mpn_submul_1:
                     34:        mov     #0,r2           ! cy_limb = 0
                     35:        mov     #0,r0           ! Keep r0 = 0 for entire loop
                     36:        clrt
                     37:
                     38: Loop:  mov.l   @r5+,r3
                     39:        dmulu.l r3,r7
                     40:        sts     macl,r1
                     41:        addc    r2,r1           ! lo_prod += old cy_limb
                     42:        sts     mach,r2         ! new cy_limb = hi_prod
                     43:        mov.l   @r4,r3
                     44:        addc    r0,r2           ! cy_limb += T, T = 0
                     45:        subc    r3,r1
                     46:        addc    r0,r2           ! cy_limb += T, T = 0
                     47:        dt      r6
                     48:        mov.l   r1,@r4
                     49:        bf.s    Loop
                     50:        add     #4,r4
                     51:
                     52:        rts
                     53:        mov     r2,r0

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