Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / sparc / sparc64 / multiarch / memset.S
blob96c75e0d06a315a7599138731990bd76dcd46cd8
1 /* Multiple versions of memset and bzero
2    All versions must be listed in ifunc-impl-list.c.
3    Copyright (C) 2010-2014 Free Software Foundation, Inc.
4    Contributed by David S. Miller (davem@davemloft.net)
5    This file is part of the GNU C Library.
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.
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.
17    You should have received a copy of the GNU Lesser General Public
18    License along with the GNU C Library; if not, see
19    <http://www.gnu.org/licenses/>.  */
21 #include <sysdep.h>
23 #if !defined NOT_IN_libc
24         .text
25 ENTRY(memset)
26         .type   memset, @gnu_indirect_function
27 # ifdef SHARED
28         SETUP_PIC_REG_LEAF(o3, o5)
29 # endif
30         set     HWCAP_SPARC_CRYPTO, %o1
31         andcc   %o0, %o1, %g0
32         be      1f
33          andcc  %o0, HWCAP_SPARC_BLKINIT, %g0
34 # ifdef SHARED
35         sethi   %gdop_hix22(__memset_niagara4), %o1
36         xor     %o1, %gdop_lox10(__memset_niagara4), %o1
37 # else
38         set     __memset_niagara4, %o1
39 # endif
40         ba      10f
41          nop
42 1:      be      9f
43          nop
44 # ifdef SHARED
45         sethi   %gdop_hix22(__memset_niagara1), %o1
46         xor     %o1, %gdop_lox10(__memset_niagara1), %o1
47 # else
48         set     __memset_niagara1, %o1
49 # endif
50         ba      10f
51          nop
53 # ifdef SHARED
54         sethi   %gdop_hix22(__memset_ultra1), %o1
55         xor     %o1, %gdop_lox10(__memset_ultra1), %o1
56 # else
57         set     __memset_ultra1, %o1
58 # endif
59 10:
60 # ifdef SHARED
61         add     %o3, %o1, %o1
62 # endif
63         retl
64          mov    %o1, %o0
65 END(memset)
67 ENTRY(__bzero)
68         .type   bzero, @gnu_indirect_function
69 # ifdef SHARED
70         SETUP_PIC_REG_LEAF(o3, o5)
71 # endif
72         set     HWCAP_SPARC_CRYPTO, %o1
73         andcc   %o0, %o1, %g0
74         be      1f
75          andcc  %o0, HWCAP_SPARC_BLKINIT, %g0
76 # ifdef SHARED
77         sethi   %gdop_hix22(__bzero_niagara4), %o1
78         xor     %o1, %gdop_lox10(__bzero_niagara4), %o1
79 # else
80         set     __bzero_niagara4, %o1
81 # endif
82         ba      10f
83          nop
84 1:      be      9f
85          nop
86 # ifdef SHARED
87         sethi   %gdop_hix22(__bzero_niagara1), %o1
88         xor     %o1, %gdop_lox10(__bzero_niagara1), %o1
89 # else
90         set     __bzero_niagara1, %o1
91 # endif
92         ba      10f
93          nop
95 # ifdef SHARED
96         sethi   %gdop_hix22(__bzero_ultra1), %o1
97         xor     %o1, %gdop_lox10(__bzero_ultra1), %o1
98 # else
99         set     __bzero_ultra1, %o1
100 # endif
102 # ifdef SHARED
103         add     %o3, %o1, %o1
104 # endif
105         retl
106          mov    %o1, %o0
107 END(__bzero)
109 weak_alias (__bzero, bzero)
111 # undef weak_alias
112 # define weak_alias(a, b)
114 libc_hidden_builtin_def (memset)
116 #undef libc_hidden_builtin_def
117 #define libc_hidden_builtin_def(name)
119 #define memset __memset_ultra1
120 #define __bzero __bzero_ultra1
122 #endif
124 #include "../memset.S"