Replace FSF snail mail address with URLs.
[glibc.git] / sysdeps / sparc / sparc64 / multiarch / memset.S
blobbf2eb637e6123724dc95f5049f386c74eb4c78ef
1 /* Multiple versions of memset and bzero
2    Copyright (C) 2010, 2011 Free Software Foundation, Inc.
3    Contributed by David S. Miller (davem@davemloft.net)
4    This file is part of the GNU C Library.
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, see
18    <http://www.gnu.org/licenses/>.  */
20 #include <sysdep.h>
21 #include <rtld-global-offsets.h>
23 #if !defined NOT_IN_libc
24         .text
25 ENTRY(memset)
26         .type   memset, @gnu_indirect_function
27 # ifdef SHARED
28         mov     %o7, %o5
29         sethi   %hi(_GLOBAL_OFFSET_TABLE_-4), %o3
30         call    1f
31          or     %o3, %lo(_GLOBAL_OFFSET_TABLE_+4), %o3
32 1:      add     %o7, %o3, %o3
33         mov     %o5, %o7
34 # endif
35         andcc   %o0, HWCAP_SPARC_BLKINIT, %g0
36         be      9f
37          nop
38 # ifdef SHARED
39         sethi   %gdop_hix22(__memset_niagara1), %o1
40         xor     %o1, %gdop_lox10(__memset_niagara1), %o1
41 # else
42         set     __memset_niagara1, %o1
43 # endif
44         ba      10f
45          nop
47 # ifdef SHARED
48         sethi   %gdop_hix22(__memset_ultra1), %o1
49         xor     %o1, %gdop_lox10(__memset_ultra1), %o1
50 # else
51         set     __memset_ultra1, %o1
52 # endif
53 10:
54 # ifdef SHARED
55         add     %o3, %o1, %o1
56 # endif
57         retl
58          mov    %o1, %o0
59 END(memset)
61 ENTRY(__bzero)
62         .type   bzero, @gnu_indirect_function
63 # ifdef SHARED
64         mov     %o7, %o5
65         sethi   %hi(_GLOBAL_OFFSET_TABLE_-4), %o3
66         call    1f
67          or     %o3, %lo(_GLOBAL_OFFSET_TABLE_+4), %o3
68 1:      add     %o7, %o3, %o3
69         mov     %o5, %o7
70 # endif
71         andcc   %o0, HWCAP_SPARC_BLKINIT, %g0
72         be      9f
73          nop
74 # ifdef SHARED
75         sethi   %gdop_hix22(__bzero_niagara1), %o1
76         xor     %o1, %gdop_lox10(__bzero_niagara1), %o1
77 # else
78         set     __bzero_niagara1, %o1
79 # endif
80         ba      10f
81          nop
83 # ifdef SHARED
84         sethi   %gdop_hix22(__bzero_ultra1), %o1
85         xor     %o1, %gdop_lox10(__bzero_ultra1), %o1
86 # else
87         set     __bzero_ultra1, %o1
88 # endif
89 10:
90 # ifdef SHARED
91         add     %o3, %o1, %o1
92 # endif
93         retl
94          mov    %o1, %o0
95 END(__bzero)
97 weak_alias (__bzero, bzero)
99 # undef weak_alias
100 # define weak_alias(a, b)
102 # undef libc_hidden_builtin_def
103 /* IFUNC doesn't work with the hidden functions in a shared library.  */
104 # define libc_hidden_builtin_def(name) \
105         .globl __GI_memset; __GI_memset = __memset_ultra1
107 #define memset __memset_ultra1
108 #define __bzero __bzero_ultra1
110 #endif
112 #include "../memset.S"