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

« back to all changes in this revision

Viewing changes to src/gmp/mpn/powerpc32/mul_1.asm

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2007-04-09 11:51:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070409115151-ql8cr0kalzx1jmla
Tags: 0.9i-20070324-2
Upload to unstable. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl PowerPC-32 mpn_mul_1 -- Multiply a limb vector with a limb and store
2
 
dnl the result in a second limb vector.
3
 
 
4
 
dnl Copyright 1995, 1997, 2000, 2002 Free Software Foundation, Inc.
5
 
 
6
 
dnl This file is part of the GNU MP Library.
7
 
 
8
 
dnl The GNU MP Library is free software; you can redistribute it and/or modify
9
 
dnl it under the terms of the GNU Lesser General Public License as published by
10
 
dnl the Free Software Foundation; either version 2.1 of the License, or (at your
11
 
dnl option) any later version.
12
 
 
13
 
dnl The GNU MP Library is distributed in the hope that it will be useful, but
14
 
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
 
dnl or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
16
 
dnl License for more details.
17
 
 
18
 
dnl You should have received a copy of the GNU Lesser General Public License
19
 
dnl along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
20
 
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21
 
dnl MA 02111-1307, USA.
22
 
 
23
 
 
24
 
dnl INPUT PARAMETERS
25
 
dnl res_ptr     r3
26
 
dnl s1_ptr      r4
27
 
dnl size        r5
28
 
dnl s2_limb     r6
29
 
 
30
 
dnl This is optimized for the PPC604 but it runs decently even on PPC601.  It
31
 
dnl has not been tested on a PPC603 since I don't have access to any such
32
 
dnl machines.
 
1
dnl  PowerPC-32 mpn_mul_1 -- Multiply a limb vector with a limb and store the
 
2
dnl  result in a second limb vector.
 
3
 
 
4
dnl  Copyright 1995, 1997, 2000, 2002, 2003, 2005 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
 
21
dnl  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
22
dnl  Boston, MA 02110-1301, USA.
33
23
 
34
24
include(`../config.m4')
35
25
 
 
26
C                cycles/limb
 
27
C 603e:            ?
 
28
C 604e:            4.0
 
29
C 75x (G3):        4.5-11
 
30
C 7400,7410 (G4):  4.5-11
 
31
C 744x,745x (G4+): 6.0
 
32
C power4/ppc970:   6.0
 
33
C power5:          5.63
 
34
 
 
35
C INPUT PARAMETERS
 
36
C rp    r3
 
37
C up    r4
 
38
C n     r5
 
39
C vl    r6
 
40
 
36
41
ASM_START()
37
42
PROLOGUE(mpn_mul_1)
38
43
        mtctr   r5
47
52
        mulhwu  r0,r8,r6
48
53
        bdz     L(end1)
49
54
C Software pipelined main loop
50
 
L(oop): lwz     r8,4(r4)
 
55
L(loop):
 
56
        lwz     r8,4(r4)
51
57
        mullw   r10,r9,r6
52
58
        adde    r5,r11,r12
53
59
        mulhwu  r12,r9,r6
58
64
        adde    r7,r10,r0
59
65
        mulhwu  r0,r8,r6
60
66
        stwu    r7,8(r3)
61
 
        bdnz    L(oop)
 
67
        bdnz    L(loop)
62
68
C Finish software pipeline
63
69
L(end1):
64
70
        mullw   r10,r9,r6