]>
Commit | Line | Data |
---|---|---|
dbcaf07c DM |
1 | /* Aligned copy routines specified by Sparc V9 ABI. |
2 | For 64-bit sparc. | |
688903eb | 3 | Copyright (C) 2010-2018 Free Software Foundation, Inc. |
dbcaf07c DM |
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 | |
59ba27a6 PE |
18 | License along with the GNU C Library; if not, see |
19 | <http://www.gnu.org/licenses/>. */ | |
dbcaf07c DM |
20 | |
21 | #include <sysdep.h> | |
22 | ||
23 | .text | |
24 | .align 8 | |
25 | ENTRY(__align_cpy_8) | |
26 | 10: cmp %o0, %o1 | |
27 | be,pn %xcc, 9f | |
28 | mov %o0, %o3 | |
29 | subcc %o2, 0x08, %o2 | |
30 | be,pn %xcc, 8f | |
31 | 1: ldx [%o1 + 0x00], %o5 | |
32 | ldx [%o1 + 0x08], %o4 | |
33 | subcc %o2, 0x10, %o2 | |
34 | add %o1, 0x10, %o1 | |
35 | stx %o5, [%o3 + 0x00] | |
36 | stx %o4, [%o3 + 0x08] | |
37 | bg,pt %xcc, 1b | |
38 | add %o3, 0x10, %o3 | |
39 | bne,pn %xcc, 9f | |
40 | nop | |
41 | ldx [%o1 + 0x00], %o5 | |
42 | 8: stx %o5, [%o3 + 0x00] | |
43 | 9: retl | |
44 | nop | |
45 | END(__align_cpy_8) | |
46 | ||
47 | .align 8 | |
48 | ENTRY(__align_cpy_4) | |
49 | 20: cmp %o0, %o1 | |
50 | be,pn %xcc, 9f | |
51 | mov %o0, %o3 | |
52 | subcc %o2, 0x04, %o2 | |
53 | be,pn %xcc, 8f | |
54 | 1: lduw [%o1 + 0x00], %o5 | |
55 | lduw [%o1 + 0x04], %o4 | |
56 | subcc %o2, 0x08, %o2 | |
57 | add %o1, 0x08, %o1 | |
58 | stw %o5, [%o3 + 0x00] | |
59 | stw %o4, [%o3 + 0x04] | |
60 | bg,pt %xcc, 1b | |
61 | add %o3, 0x08, %o3 | |
62 | bne,pn %xcc, 9f | |
63 | nop | |
64 | lduw [%o1 + 0x00], %o5 | |
65 | 8: stw %o5, [%o3 + 0x00] | |
66 | 9: retl | |
67 | nop | |
68 | END(__align_cpy_4) | |
69 | ||
70 | .align 8 | |
71 | ENTRY(__align_cpy_2) | |
72 | or %o0, %o1, %o3 | |
73 | or %o2, %o3, %o3 | |
74 | andcc %o3, 0x7, %g0 | |
75 | be,pt %xcc, 10b | |
76 | andcc %o3, 0x3, %g0 | |
77 | be,pt %xcc, 20b | |
78 | mov %o7, %g1 | |
79 | call HIDDEN_JUMPTARGET(memcpy) | |
80 | mov %o7, %g1 | |
81 | END(__align_cpy_2) | |
82 | ||
83 | weak_alias (__align_cpy_8, __align_cpy_16) | |
84 | weak_alias (__align_cpy_2, __align_cpy_1) |