~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to gmp3/mpn/powerpc32/sqr_diagonal.asm

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl PowerPC-32 mpn_sqr_diagonal.
 
2
 
 
3
dnl Copyright 2001 Free Software Foundation, Inc.
 
4
 
 
5
dnl This file is part of the GNU MP Library.
 
6
 
 
7
dnl The GNU MP Library is free software; you can redistribute it and/or modify
 
8
dnl it under the terms of the GNU Lesser General Public License as published by
 
9
dnl the Free Software Foundation; either version 2.1 of the License, or (at your
 
10
dnl option) any later version.
 
11
 
 
12
dnl The GNU MP Library is distributed in the hope that it will be useful, but
 
13
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
14
dnl or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 
15
dnl License for more details.
 
16
 
 
17
dnl You should have received a copy of the GNU Lesser General Public License
 
18
dnl along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 
19
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 
20
dnl MA 02111-1307, USA.
 
21
 
 
22
 
 
23
dnl INPUT PARAMETERS
 
24
dnl res_ptr     r3
 
25
dnl s1_ptr      r4
 
26
dnl size        r5
 
27
 
 
28
dnl This runs at 4 cycles/limb on the PPC604.  That's saturating the multiply
 
29
dnl unit.
 
30
 
 
31
include(`../config.m4')
 
32
 
 
33
ASM_START()
 
34
PROLOGUE(mpn_sqr_diagonal)
 
35
        lwz     r6,0(r4)
 
36
        mtctr   r5
 
37
 
 
38
        addi    r3,r3,-4
 
39
        bdz     .Lend1
 
40
 
 
41
        lwzu    r7,4(r4)
 
42
        mullw   r9,r6,r6
 
43
        mulhwu  r11,r6,r6
 
44
        bdz     .Lend2
 
45
 
 
46
        lwzu    r6,4(r4)
 
47
        mullw   r8,r7,r7
 
48
        mulhwu  r10,r7,r7
 
49
        bdz     .Lende
 
50
 
 
51
.Loop:  lwzu    r7,4(r4)
 
52
        stw     r9,4(r3)
 
53
        mullw   r9,r6,r6
 
54
        stwu    r11,8(r3)
 
55
        mulhwu  r11,r6,r6
 
56
        bdz     .Lendo
 
57
        lwzu    r6,4(r4)
 
58
        stw     r8,4(r3)
 
59
        mullw   r8,r7,r7
 
60
        stwu    r10,8(r3)
 
61
        mulhwu  r10,r7,r7
 
62
        bdnz    .Loop
 
63
 
 
64
.Lende: stw     r9,4(r3)
 
65
        mullw   r9,r6,r6
 
66
        stw     r11,8(r3)
 
67
        mulhwu  r11,r6,r6
 
68
        stw     r8,12(r3)
 
69
        stw     r10,16(r3)
 
70
        stw     r9,20(r3)
 
71
        stw     r11,24(r3)
 
72
        blr
 
73
.Lendo: stw     r8,4(r3)
 
74
        mullw   r8,r7,r7
 
75
        stw     r10,8(r3)
 
76
        mulhwu  r10,r7,r7
 
77
        stw     r9,12(r3)
 
78
        stw     r11,16(r3)
 
79
        stw     r8,20(r3)
 
80
        stw     r10,24(r3)
 
81
        blr
 
82
 
 
83
.Lend2: mullw   r8,r7,r7
 
84
        stw     r9,4(r3)
 
85
        mulhwu  r10,r7,r7
 
86
        stw     r11,8(r3)
 
87
        stw     r8,12(r3)
 
88
        stw     r10,16(r3)
 
89
        blr
 
90
.Lend1: mullw   r9,r6,r6
 
91
        mulhwu  r11,r6,r6
 
92
        stw     r9,4(r3)
 
93
        stw     r11,8(r3)
 
94
        blr
 
95
EPILOGUE(mpn_sqr_diagonal)