Reorganisation of the source tree
[ghc-hetmet.git] / rts / gmp / mpn / sparc64 / copyi.asm
1 ! SPARC v9 __gmpn_copy -- Copy a limb vector.
2
3 ! Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4
5 ! This file is part of the GNU MP Library.
6
7 ! The GNU MP Library is free software; you can redistribute it and/or modify
8 ! it under the terms of the GNU Lesser General Public License as published by
9 ! the Free Software Foundation; either version 2.1 of the License, or (at your
10 ! option) any later version.
11
12 ! The GNU MP Library is distributed in the hope that it will be useful, but
13 ! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ! or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15 ! License for more details.
16
17 ! You should have received a copy of the GNU Lesser General Public License
18 ! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
19 ! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 ! MA 02111-1307, USA.
21
22
23 ! INPUT PARAMETERS
24 ! rptr  %o0
25 ! sptr  %o1
26 ! n     %o2
27
28 include(`../config.m4')
29
30 ASM_START()
31         .register       %g2,#scratch
32         .register       %g3,#scratch
33 PROLOGUE(mpn_copyi)
34         add     %o2,-8,%o2
35         brlz,pn %o2,L(skip)
36         nop
37         b,a     L(loop1)
38         nop
39
40         ALIGN(16)
41 L(loop1):
42         ldx     [%o1+0],%g1
43         ldx     [%o1+8],%g2
44         ldx     [%o1+16],%g3
45         ldx     [%o1+24],%g4
46         ldx     [%o1+32],%g5
47         ldx     [%o1+40],%o3
48         ldx     [%o1+48],%o4
49         ldx     [%o1+56],%o5
50         add     %o1,64,%o1
51         stx     %g1,[%o0+0]
52         stx     %g2,[%o0+8]
53         stx     %g3,[%o0+16]
54         stx     %g4,[%o0+24]
55         stx     %g5,[%o0+32]
56         stx     %o3,[%o0+40]
57         stx     %o4,[%o0+48]
58         stx     %o5,[%o0+56]
59         add     %o2,-8,%o2
60         brgez,pt        %o2,L(loop1)
61         add     %o0,64,%o0
62
63 L(skip):
64         add     %o2,8,%o2
65         brz,pt  %o2,L(end)
66         nop
67
68 L(loop2):
69         ldx     [%o1],%g1
70         add     %o1,8,%o1
71         add     %o2,-1,%o2
72         stx     %g1,[%o0]
73         add     %o0,8,%o0
74         brgz,pt %o2,L(loop2)
75         nop
76
77 L(end): retl
78         nop
79 EPILOGUE(mpn_copyi)