~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gmp/mpn/mips64/submul_1.asm

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2006-05-17 02:46:26 UTC
  • Revision ID: james.westby@ubuntu.com-20060517024626-lljr08ftv9g9vefl
Tags: upstream-0.9h-20060510
ImportĀ upstreamĀ versionĀ 0.9h-20060510

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl  MIPS64 mpn_submul_1 -- Multiply a limb vector with a single limb and
 
2
dnl  subtract the product from a second limb vector.
 
3
 
 
4
dnl  Copyright 1992, 1994, 1995, 2000, 2001, 2002 Free Software Foundation,
 
5
dnl  Inc.
 
6
 
 
7
dnl  This file is part of the GNU MP Library.
 
8
 
 
9
dnl  The GNU MP Library is free software; you can redistribute it and/or modify
 
10
dnl  it under the terms of the GNU Lesser General Public License as published
 
11
dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
 
12
dnl  your option) any later version.
 
13
 
 
14
dnl  The GNU MP Library is distributed in the hope that it will be useful, but
 
15
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
16
dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 
17
dnl  License for more details.
 
18
 
 
19
dnl  You should have received a copy of the GNU Lesser General Public License
 
20
dnl  along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 
21
dnl  the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 
22
dnl  MA 02111-1307, USA.
 
23
 
 
24
include(`../config.m4')
 
25
 
 
26
C INPUT PARAMETERS
 
27
C res_ptr       $4
 
28
C s1_ptr        $5
 
29
C size          $6
 
30
C s2_limb       $7
 
31
 
 
32
ASM_START()
 
33
PROLOGUE(mpn_submul_1)
 
34
 
 
35
C feed-in phase 0
 
36
        ld      $8,0($5)
 
37
 
 
38
C feed-in phase 1
 
39
        daddiu  $5,$5,8
 
40
        dmultu  $8,$7
 
41
 
 
42
        daddiu  $6,$6,-1
 
43
        beq     $6,$0,$LC0
 
44
         move   $2,$0           C zero cy2
 
45
 
 
46
        daddiu  $6,$6,-1
 
47
        beq     $6,$0,$LC1
 
48
        ld      $8,0($5)        C load new s1 limb as early as possible
 
49
 
 
50
Loop:   ld      $10,0($4)
 
51
        mflo    $3
 
52
        mfhi    $9
 
53
        daddiu  $5,$5,8
 
54
        daddu   $3,$3,$2        C add old carry limb to low product limb
 
55
        dmultu  $8,$7
 
56
        ld      $8,0($5)        C load new s1 limb as early as possible
 
57
        daddiu  $6,$6,-1        C decrement loop counter
 
58
        sltu    $2,$3,$2        C carry from previous addition -> $2
 
59
        dsubu   $3,$10,$3
 
60
        sgtu    $10,$3,$10
 
61
        daddu   $2,$2,$10
 
62
        sd      $3,0($4)
 
63
        daddiu  $4,$4,8
 
64
        bne     $6,$0,Loop
 
65
         daddu  $2,$9,$2        C add high product limb and carry from addition
 
66
 
 
67
C wind-down phase 1
 
68
$LC1:   ld      $10,0($4)
 
69
        mflo    $3
 
70
        mfhi    $9
 
71
        daddu   $3,$3,$2
 
72
        sltu    $2,$3,$2
 
73
        dmultu  $8,$7
 
74
        dsubu   $3,$10,$3
 
75
        sgtu    $10,$3,$10
 
76
        daddu   $2,$2,$10
 
77
        sd      $3,0($4)
 
78
        daddiu  $4,$4,8
 
79
        daddu   $2,$9,$2        C add high product limb and carry from addition
 
80
 
 
81
C wind-down phase 0
 
82
$LC0:   ld      $10,0($4)
 
83
        mflo    $3
 
84
        mfhi    $9
 
85
        daddu   $3,$3,$2
 
86
        sltu    $2,$3,$2
 
87
        dsubu   $3,$10,$3
 
88
        sgtu    $10,$3,$10
 
89
        daddu   $2,$2,$10
 
90
        sd      $3,0($4)
 
91
        j       $31
 
92
        daddu   $2,$9,$2        C add high product limb and carry from addition
 
93
EPILOGUE(mpn_submul_1)