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

« back to all changes in this revision

Viewing changes to gmp3/mpn/hppa/hppa1_1/addmul_1.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  HP-PA 1.1 mpn_addmul_1 -- Multiply a limb vector with a limb and add the
 
2
dnl  result to a second limb vector.
 
3
 
 
4
dnl  Copyright 1992, 1993, 1994, 2000, 2001 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
 
10
dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
 
11
dnl  your 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
include(`../config.m4')
 
24
 
 
25
C INPUT PARAMETERS
 
26
C res_ptr       r26
 
27
C s1_ptr        r25
 
28
C size          r24
 
29
C s2_limb       r23
 
30
 
 
31
C This runs at 11 cycles/limb on a PA7000.  With the used instructions, it can
 
32
C not become faster due to data cache contention after a store.  On the PA7100
 
33
C it runs at 10 cycles/limb.
 
34
 
 
35
C There are some ideas described in mul_1.asm that applies to this code too.
 
36
 
 
37
ASM_START()
 
38
PROLOGUE(mpn_addmul_1)
 
39
C       .callinfo       frame=64,no_calls
 
40
 
 
41
        ldo             64(%r30),%r30
 
42
        fldws,ma        4(%r25),%fr5
 
43
        stw             %r23,-16(%r30)          C move s2_limb ...
 
44
        addib,=         -1,%r24,L$just_one_limb
 
45
         fldws          -16(%r30),%fr4          C ... into fr4
 
46
        add             %r0,%r0,%r0             C clear carry
 
47
        xmpyu           %fr4,%fr5,%fr6
 
48
        fldws,ma        4(%r25),%fr7
 
49
        fstds           %fr6,-16(%r30)
 
50
        xmpyu           %fr4,%fr7,%fr8
 
51
        ldw             -12(%r30),%r19          C least significant limb in product
 
52
        ldw             -16(%r30),%r28
 
53
 
 
54
        fstds           %fr8,-16(%r30)
 
55
        addib,=         -1,%r24,L$end
 
56
         ldw            -12(%r30),%r1
 
57
 
 
58
C Main loop
 
59
        .label  L$loop
 
60
        ldws            0(%r26),%r29
 
61
        fldws,ma        4(%r25),%fr5
 
62
        add             %r29,%r19,%r19
 
63
        stws,ma         %r19,4(%r26)
 
64
        addc            %r28,%r1,%r19
 
65
        xmpyu           %fr4,%fr5,%fr6
 
66
        ldw             -16(%r30),%r28
 
67
        fstds           %fr6,-16(%r30)
 
68
        addc            %r0,%r28,%r28
 
69
        addib,<>        -1,%r24,L$loop
 
70
         ldw            -12(%r30),%r1
 
71
 
 
72
        .label  L$end
 
73
        ldw             0(%r26),%r29
 
74
        add             %r29,%r19,%r19
 
75
        stws,ma         %r19,4(%r26)
 
76
        addc            %r28,%r1,%r19
 
77
        ldw             -16(%r30),%r28
 
78
        ldws            0(%r26),%r29
 
79
        addc            %r0,%r28,%r28
 
80
        add             %r29,%r19,%r19
 
81
        stws,ma         %r19,4(%r26)
 
82
        addc            %r0,%r28,%r28
 
83
        bv              0(%r2)
 
84
         ldo            -64(%r30),%r30
 
85
 
 
86
        .label  L$just_one_limb
 
87
        xmpyu           %fr4,%fr5,%fr6
 
88
        ldw             0(%r26),%r29
 
89
        fstds           %fr6,-16(%r30)
 
90
        ldw             -12(%r30),%r1
 
91
        ldw             -16(%r30),%r28
 
92
        add             %r29,%r1,%r19
 
93
        stw             %r19,0(%r26)
 
94
        addc            %r0,%r28,%r28
 
95
        bv              0(%r2)
 
96
         ldo            -64(%r30),%r30
 
97
EPILOGUE(mpn_addmul_1)