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

« back to all changes in this revision

Viewing changes to src/gmp/mpn/powerpc64/copyd.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-64 mpn_copyd
 
2
 
 
3
dnl  Copyright 2004, 2005 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
 
9
dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
 
10
dnl  your 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
 
19
dnl  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
20
dnl  Boston, MA 02110-1301, USA.
 
21
 
 
22
include(`../config.m4')
 
23
 
 
24
C               cycles/limb
 
25
C POWER3/PPC630:     1
 
26
C POWER4/PPC970:     1
 
27
 
 
28
C INPUT PARAMETERS
 
29
C rp    r3
 
30
C up    r4
 
31
C n     r5
 
32
 
 
33
ASM_START()
 
34
PROLOGUE(mpn_copyd)
 
35
        rldic.  r0, r5, 3, 59   C r0 = (r5 & 3) << 3; cr0 = (n == 4t)?
 
36
        cmpldi  cr6, r0, 16     C cr6 = (n cmp 4t + 2)?
 
37
 
 
38
ifdef(`HAVE_ABI_mode32',
 
39
`       rldic   r6, r5, 3, 32', C byte count corresponding to n
 
40
`       rldicr  r6, r5, 3, 60') C byte count corresponding to n
 
41
 
 
42
        addi    r5, r5, 4       C compute...
 
43
ifdef(`HAVE_ABI_mode32',
 
44
`       rldicl  r5, r5, 62,34', C ...branch count
 
45
`       rldicl  r5, r5, 62, 2') C ...branch count
 
46
        mtctr   r5
 
47
 
 
48
        add     r4, r4, r6
 
49
        add     r3, r3, r6
 
50
        sub     r4, r4, r0      C offset up
 
51
        sub     r3, r3, r0      C offset rp
 
52
 
 
53
        beq     cr0, L(L00)
 
54
        blt     cr6, L(L01)
 
55
        beq     cr6, L(L10)
 
56
        b       L(L11)
 
57
 
 
58
        ALIGN(16)
 
59
L(oop): ld      r6, 24(r4)
 
60
        std     r6, 24(r3)
 
61
L(L11): ld      r6, 16(r4)
 
62
        std     r6, 16(r3)
 
63
L(L10): ld      r6, 8(r4)
 
64
        std     r6, 8(r3)
 
65
L(L01): ld      r6, 0(r4)
 
66
        std     r6, 0(r3)
 
67
L(L00): addi    r4, r4, -32
 
68
        addi    r3, r3, -32
 
69
        bdnz    L(oop)
 
70
 
 
71
        blr
 
72
EPILOGUE()