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/>. */
21 #include <rtld-global-offsets.h>
23 #if !defined NOT_IN_libc
26 .type memset, @gnu_indirect_function
29 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o3
31 or %o3, %lo(_GLOBAL_OFFSET_TABLE_+4), %o3
35 andcc %o0, HWCAP_SPARC_BLKINIT, %g0
39 sethi %gdop_hix22(__memset_niagara1), %o1
40 xor %o1, %gdop_lox10(__memset_niagara1), %o1
42 set __memset_niagara1, %o1
48 sethi %gdop_hix22(__memset_ultra1), %o1
49 xor %o1, %gdop_lox10(__memset_ultra1), %o1
51 set __memset_ultra1, %o1
62 .type bzero, @gnu_indirect_function
65 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o3
67 or %o3, %lo(_GLOBAL_OFFSET_TABLE_+4), %o3
71 andcc %o0, HWCAP_SPARC_BLKINIT, %g0
75 sethi %gdop_hix22(__bzero_niagara1), %o1
76 xor %o1, %gdop_lox10(__bzero_niagara1), %o1
78 set __bzero_niagara1, %o1
84 sethi %gdop_hix22(__bzero_ultra1), %o1
85 xor %o1, %gdop_lox10(__bzero_ultra1), %o1
87 set __bzero_ultra1, %o1
97 weak_alias (__bzero, bzero)
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
112 #include "../memset.S"