~ubuntu-branches/ubuntu/vivid/gcl/vivid

« back to all changes in this revision

Viewing changes to gmp/mpn/sh/sh2/addmul_1.s

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-03-04 14:29:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020304142959-dey14w08kr7lldu3
Tags: upstream-2.5.0.cvs20020219
ImportĀ upstreamĀ versionĀ 2.5.0.cvs20020219

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! SH2 __gmpn_addmul_1 -- Multiply a limb vector with a limb and add
 
2
! the result to a second limb vector.
 
3
 
 
4
! Copyright (C) 1995, 2000 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 Lesser General Public License as published by
 
10
! the Free Software Foundation; either version 2.1 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 Lesser General Public
 
16
! License for more details.
 
17
 
 
18
! You should have received a copy of the GNU Lesser 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 ___gmpn_addmul_1
 
33
___gmpn_addmul_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
        addc    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