+++ /dev/null
-/* bzero is in memset.S */
.text
.align 4
-ENTRY(__bzero)
- b 1f
- mov %g0, %g3
-
-3: cmp %o2, 3
- be 2f
- stb %g3, [%o0]
-
- cmp %o2, 2
- be 2f
- stb %g3, [%o0 + 0x01]
-
- stb %g3, [%o0 + 0x02]
-2: sub %o2, 4, %o2
- add %o1, %o2, %o1
- b 4f
- sub %o0, %o2, %o0
-END(__bzero)
-
ENTRY(memset)
and %o1, 0xff, %g3
sll %g3, 8, %g2
mov %o0, %g1
andcc %o0, 3, %o2
- bne 3b
+ bne 3f
4: andcc %o0, 4, %g0
be 2f
stb %g3, [%o0 + 6]
0: retl
nop
+
+3: cmp %o2, 3
+ be 2f
+ stb %g3, [%o0]
+
+ cmp %o2, 2
+ be 2f
+ stb %g3, [%o0 + 0x01]
+
+ stb %g3, [%o0 + 0x02]
+2: sub %o2, 4, %o2
+ add %o1, %o2, %o1
+ b 4b
+ sub %o0, %o2, %o0
END(memset)
libc_hidden_builtin_def (memset)
-
-weak_alias (__bzero, bzero)
+++ /dev/null
-/* bzero is in memset.S */
+++ /dev/null
-#include <sysdeps/sparc/sparc64/multiarch/bzero.c>
# define weak_alias(x, y)
# define memset __memset_ultra1
-# define __bzero __bzero_ultra1
# include <sysdeps/sparc/sparc32/sparcv9/memset.S>
#endif
+++ /dev/null
-/* bzero is in memset.S */
stx source, [base - offset - 0x08]; \
stx source, [base - offset - 0x00];
+#define ZERO_BLOCKS(base, offset, source) \
+ stx source, [base - offset - 0x38]; \
+ stx source, [base - offset - 0x30]; \
+ stx source, [base - offset - 0x28]; \
+ stx source, [base - offset - 0x20]; \
+ stx source, [base - offset - 0x18]; \
+ stx source, [base - offset - 0x10]; \
+ stx source, [base - offset - 0x08]; \
+ stx source, [base - offset - 0x00];
+
/* Well, memset is a lot easier to get right than bcopy... */
.text
.align 32
nop
ba,pt %xcc, 18b
ldd [%o0], %f0
-END(memset)
-libc_hidden_builtin_def (memset)
-#define ZERO_BLOCKS(base, offset, source) \
- stx source, [base - offset - 0x38]; \
- stx source, [base - offset - 0x30]; \
- stx source, [base - offset - 0x28]; \
- stx source, [base - offset - 0x20]; \
- stx source, [base - offset - 0x18]; \
- stx source, [base - offset - 0x10]; \
- stx source, [base - offset - 0x08]; \
- stx source, [base - offset - 0x00];
-
- .text
- .align 32
-ENTRY(__bzero)
#ifndef USE_BPR
srl %o1, 0, %o1
#endif
stb %g0, [%o0 - 1]
0: retl
mov %o5, %o0
-END(__bzero)
-
-weak_alias (__bzero, bzero)
+END(memset)
+libc_hidden_builtin_def (memset)
+++ /dev/null
-/* Multiple versions of bzero. SPARC64/Linux version.
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#if IS_IN (libc)
-# define bzero __redirect_bzero
-# include <string.h>
-# undef bzero
-
-# include <sparc-ifunc.h>
-
-# define SYMBOL_NAME bzero
-# include "ifunc-memset.h"
-
-sparc_libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR)
-weak_alias (__bzero, bzero)
-
-#endif
__mempcpy_ultra3)
IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ultra1));
- IFUNC_IMPL (i, name, bzero,
- IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_ADP,
- __bzero_niagara7)
- IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_CRYPTO,
- __bzero_niagara4)
- IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_BLKINIT,
- __bzero_niagara1)
- IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ultra1));
-
IFUNC_IMPL (i, name, memset,
IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_ADP,
__memset_niagara7)
-/* Common definition for memset/bzero implementation.
+/* Common definition for memset implementation.
All versions must be listed in ifunc-impl-list.c.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of the GNU C Library.
sllx %o2, 32, %g1
ba,pt %XCC, 1f
or %g1, %o2, %o2
-END(__memset_niagara1)
-
-ENTRY(__bzero_niagara1)
clr %o2
1:
# ifndef USE_BRP
90:
retl
mov %o3, %o0
-END(__bzero_niagara1)
+END(__memset_niagara1)
#endif
sllx %o2, 32, %g1
ba,pt %icc, 1f
or %g1, %o2, %o4
-END(__memset_niagara4)
-
- .align 32
-ENTRY(__bzero_niagara4)
clr %o4
1: cmp %o1, 16
ble %icc, .Ltiny
bne,pt %icc, 1b
add %o0, 0x30, %o0
ba,a,pt %icc, .Lpostloop
-END(__bzero_niagara4)
+END(__memset_niagara4)
#endif
.text
.align 32
-ENTRY(__bzero_niagara7)
- /* bzero (dst, size) */
- mov %o1, %o2
- mov 0, %o1
- /* fall through into memset code */
-END(__bzero_niagara7)
-
ENTRY(__memset_niagara7)
/* memset (src, c, size) */
mov %o0, %o5 /* copy sp1 before using it */
# define weak_alias(x, y)
# define memset __memset_ultra1
-# define __bzero __bzero_ultra1
# include <sysdeps/sparc/sparc64/memset.S>
#endif