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

« back to all changes in this revision

Viewing changes to src/gmp/mpn/pa32/hppa1_1/mul_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  HP-PA 1.1 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 1992, 1993, 1994, 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       r26
 
28
C s1_ptr        r25
 
29
C size          r24
 
30
C s2_limb       r23
 
31
 
 
32
C This runs at 9 cycles/limb on a PA7000.  With the used instructions, it can
 
33
C not become faster due to data cache contention after a store.  On the PA7100
 
34
C it runs at 7 cycles/limb.
 
35
 
 
36
C We could use fldds to read two limbs at a time from the S1 array, and that
 
37
C could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and
 
38
C PA7100, respectively.  We don't do that since it does not seem worth the
 
39
C (alignment) troubles...
 
40
 
 
41
C At least the PA7100 is rumored to be able to deal with cache-misses without
 
42
C stalling instruction issue.  If this is true, and the cache is actually also
 
43
C lockup-free, we should use a deeper software pipeline, and load from S1 very
 
44
C early!  (The loads and stores to -12(sp) will surely be in the cache.)
 
45
 
 
46
ASM_START()
 
47
PROLOGUE(mpn_mul_1)
 
48
C       .callinfo       frame=64,no_calls
 
49
 
 
50
        ldo             64(%r30),%r30
 
51
        fldws,ma        4(%r25),%fr5
 
52
        stw             %r23,-16(%r30)          C move s2_limb ...
 
53
        addib,=         -1,%r24,L(just_one_limb)
 
54
         fldws          -16(%r30),%fr4          C ... into fr4
 
55
        add             %r0,%r0,%r0             C clear carry
 
56
        xmpyu           %fr4,%fr5,%fr6
 
57
        fldws,ma        4(%r25),%fr7
 
58
        fstds           %fr6,-16(%r30)
 
59
        xmpyu           %fr4,%fr7,%fr8
 
60
        ldw             -12(%r30),%r19          C least significant limb in product
 
61
        ldw             -16(%r30),%r28
 
62
 
 
63
        fstds           %fr8,-16(%r30)
 
64
        addib,=         -1,%r24,L(end)
 
65
         ldw            -12(%r30),%r1
 
66
 
 
67
C Main loop
 
68
        .label  L(loop)
 
69
        fldws,ma        4(%r25),%fr5
 
70
        stws,ma         %r19,4(%r26)
 
71
        addc            %r28,%r1,%r19
 
72
        xmpyu           %fr4,%fr5,%fr6
 
73
        ldw             -16(%r30),%r28
 
74
        fstds           %fr6,-16(%r30)
 
75
        addib,<>        -1,%r24,L(loop)
 
76
         ldw            -12(%r30),%r1
 
77
 
 
78
        .label  L(end)
 
79
        stws,ma         %r19,4(%r26)
 
80
        addc            %r28,%r1,%r19
 
81
        ldw             -16(%r30),%r28
 
82
        stws,ma         %r19,4(%r26)
 
83
        addc            %r0,%r28,%r28
 
84
        bv              0(%r2)
 
85
         ldo            -64(%r30),%r30
 
86
 
 
87
        .label  L(just_one_limb)
 
88
        xmpyu           %fr4,%fr5,%fr6
 
89
        fstds           %fr6,-16(%r30)
 
90
        ldw             -16(%r30),%r28
 
91
        ldo             -64(%r30),%r30
 
92
        bv              0(%r2)
 
93
         fstws          %fr6R,0(%r26)
 
94
EPILOGUE()