]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/sparc/sparc64/align-cpy.S
Merge commit 'origin/davem/sparc'
[thirdparty/glibc.git] / sysdeps / sparc / sparc64 / align-cpy.S
1 /* Aligned copy routines specified by Sparc V9 ABI.
2 For 64-bit sparc.
3 Copyright (C) 2010 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
5 Contributed by David S. Miller (davem@davemloft.net)
6
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA. */
21
22 #include <sysdep.h>
23
24 .text
25 .align 8
26 ENTRY(__align_cpy_8)
27 10: cmp %o0, %o1
28 be,pn %xcc, 9f
29 mov %o0, %o3
30 subcc %o2, 0x08, %o2
31 be,pn %xcc, 8f
32 1: ldx [%o1 + 0x00], %o5
33 ldx [%o1 + 0x08], %o4
34 subcc %o2, 0x10, %o2
35 add %o1, 0x10, %o1
36 stx %o5, [%o3 + 0x00]
37 stx %o4, [%o3 + 0x08]
38 bg,pt %xcc, 1b
39 add %o3, 0x10, %o3
40 bne,pn %xcc, 9f
41 nop
42 ldx [%o1 + 0x00], %o5
43 8: stx %o5, [%o3 + 0x00]
44 9: retl
45 nop
46 END(__align_cpy_8)
47
48 .align 8
49 ENTRY(__align_cpy_4)
50 20: cmp %o0, %o1
51 be,pn %xcc, 9f
52 mov %o0, %o3
53 subcc %o2, 0x04, %o2
54 be,pn %xcc, 8f
55 1: lduw [%o1 + 0x00], %o5
56 lduw [%o1 + 0x04], %o4
57 subcc %o2, 0x08, %o2
58 add %o1, 0x08, %o1
59 stw %o5, [%o3 + 0x00]
60 stw %o4, [%o3 + 0x04]
61 bg,pt %xcc, 1b
62 add %o3, 0x08, %o3
63 bne,pn %xcc, 9f
64 nop
65 lduw [%o1 + 0x00], %o5
66 8: stw %o5, [%o3 + 0x00]
67 9: retl
68 nop
69 END(__align_cpy_4)
70
71 .align 8
72 ENTRY(__align_cpy_2)
73 or %o0, %o1, %o3
74 or %o2, %o3, %o3
75 andcc %o3, 0x7, %g0
76 be,pt %xcc, 10b
77 andcc %o3, 0x3, %g0
78 be,pt %xcc, 20b
79 mov %o7, %g1
80 call HIDDEN_JUMPTARGET(memcpy)
81 mov %o7, %g1
82 END(__align_cpy_2)
83
84 weak_alias (__align_cpy_8, __align_cpy_16)
85 weak_alias (__align_cpy_2, __align_cpy_1)