~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to mpi/mips3/mpih-mul3.S

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2006-01-24 04:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060124043142-pbg192or6qxv3yk2
Tags: 1.9.20-1
* New Upstream version. Closes:#306890,#344530
  * Closes:#320490: gpg-protect-tool fails to decrypt PKCS-12 files 
* Depend on libopensc2-dev, not -1-. Closes:#348106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* MIPS3 submul_1 -- Multiply a limb vector with a single limb and
 
2
 *                   subtract the product from a second limb vector.
 
3
 *
 
4
 *      Copyright (C) 1992, 1994, 1995, 1998, 2000
 
5
 *                    2001 Free Software Foundation, Inc.
 
6
 *
 
7
 * This file is part of GnuPG.
 
8
 *
 
9
 * GnuPG is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License as published by
 
11
 * the Free Software Foundation; either version 2 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * GnuPG is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
22
 */
 
23
 
 
24
 
 
25
/*******************
 
26
 * mpi_limb_t
 
27
 * mpihelp_submul_1( mpi_ptr_t res_ptr,      (r4)
 
28
 *                   mpi_ptr_t s1_ptr,       (r5)
 
29
 *                   mpi_size_t s1_size,     (r6)
 
30
 *                   mpi_limb_t s2_limb)     (r7)
 
31
 */
 
32
 
 
33
        .text
 
34
        .align  4
 
35
        .globl  mpihelp_submul_1
 
36
        .ent    mpihelp_submul_1
 
37
mpihelp_submul_1:
 
38
        .set    noreorder
 
39
        .set    nomacro
 
40
 
 
41
/* # warm up phase 0 */
 
42
        ld      $8,0($5)
 
43
 
 
44
/* # warm up phase 1 */
 
45
        daddiu  $5,$5,8
 
46
        dmultu  $8,$7
 
47
 
 
48
        daddiu  $6,$6,-1
 
49
        beq     $6,$0,$LC0
 
50
         move   $2,$0           # zero cy2
 
51
 
 
52
        daddiu  $6,$6,-1
 
53
        beq     $6,$0,$LC1
 
54
        ld      $8,0($5)        # load new s1 limb as early as possible
 
55
 
 
56
Loop:   ld      $10,0($4)
 
57
        mflo    $3
 
58
        mfhi    $9
 
59
        daddiu  $5,$5,8
 
60
        daddu   $3,$3,$2        # add old carry limb to low product limb
 
61
        dmultu  $8,$7
 
62
        ld      $8,0($5)        # load new s1 limb as early as possible
 
63
        daddiu  $6,$6,-1        # decrement loop counter
 
64
        sltu    $2,$3,$2        # carry from previous addition -> $2
 
65
        dsubu   $3,$10,$3
 
66
        sgtu    $10,$3,$10
 
67
        daddu   $2,$2,$10
 
68
        sd      $3,0($4)
 
69
        daddiu  $4,$4,8
 
70
        bne     $6,$0,Loop
 
71
         daddu  $2,$9,$2        # add high product limb and carry from addition
 
72
 
 
73
/* # cool down phase 1 */
 
74
$LC1:   ld      $10,0($4)
 
75
        mflo    $3
 
76
        mfhi    $9
 
77
        daddu   $3,$3,$2
 
78
        sltu    $2,$3,$2
 
79
        dmultu  $8,$7
 
80
        dsubu   $3,$10,$3
 
81
        sgtu    $10,$3,$10
 
82
        daddu   $2,$2,$10
 
83
        sd      $3,0($4)
 
84
        daddiu  $4,$4,8
 
85
        daddu   $2,$9,$2        # add high product limb and carry from addition
 
86
 
 
87
/* # cool down phase 0 */
 
88
$LC0:   ld      $10,0($4)
 
89
        mflo    $3
 
90
        mfhi    $9
 
91
        daddu   $3,$3,$2
 
92
        sltu    $2,$3,$2
 
93
        dsubu   $3,$10,$3
 
94
        sgtu    $10,$3,$10
 
95
        daddu   $2,$2,$10
 
96
        sd      $3,0($4)
 
97
        j       $31
 
98
        daddu   $2,$9,$2        # add high product limb and carry from addition
 
99
 
 
100
        .end    mpihelp_submul_1
 
101