aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/sparc/sparc64
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-02-10 12:51:24 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-02-23 14:18:18 -0300
commita61933fe27dff18f274b39f46dde7e739696d4cb (patch)
tree784fe0126badb70d36a09772bceee7167e9e7eeb /sysdeps/sparc/sparc64
parentc0d215f162049e7ab8e86e9d2d76c87e41a55ebd (diff)
downloadglibc-a61933fe27dff18f274b39f46dde7e739696d4cb.zip
glibc-a61933fe27dff18f274b39f46dde7e739696d4cb.tar.gz
glibc-a61933fe27dff18f274b39f46dde7e739696d4cb.tar.bz2
sparc: Remove bzero optimization
The symbol is not present in current POSIX specification and compiler already generates memset call.
Diffstat (limited to 'sysdeps/sparc/sparc64')
-rw-r--r--sysdeps/sparc/sparc64/bzero.c1
-rw-r--r--sysdeps/sparc/sparc64/memset.S30
-rw-r--r--sysdeps/sparc/sparc64/multiarch/bzero.c33
-rw-r--r--sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c9
-rw-r--r--sysdeps/sparc/sparc64/multiarch/ifunc-memset.h2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-niagara1.S5
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-niagara4.S6
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-niagara7.S7
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-ultra1.S1
9 files changed, 15 insertions, 79 deletions
diff --git a/sysdeps/sparc/sparc64/bzero.c b/sysdeps/sparc/sparc64/bzero.c
deleted file mode 100644
index 37f0f6f..0000000
--- a/sysdeps/sparc/sparc64/bzero.c
+++ /dev/null
@@ -1 +0,0 @@
-/* bzero is in memset.S */
diff --git a/sysdeps/sparc/sparc64/memset.S b/sysdeps/sparc/sparc64/memset.S
index a7f8361..33ecbc9 100644
--- a/sysdeps/sparc/sparc64/memset.S
+++ b/sysdeps/sparc/sparc64/memset.S
@@ -31,6 +31,16 @@
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
@@ -174,22 +184,7 @@ ENTRY(memset)
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
@@ -307,6 +302,5 @@ ENTRY(__bzero)
stb %g0, [%o0 - 1]
0: retl
mov %o5, %o0
-END(__bzero)
-
-weak_alias (__bzero, bzero)
+END(memset)
+libc_hidden_builtin_def (memset)
diff --git a/sysdeps/sparc/sparc64/multiarch/bzero.c b/sysdeps/sparc/sparc64/multiarch/bzero.c
deleted file mode 100644
index 409d66a..0000000
--- a/sysdeps/sparc/sparc64/multiarch/bzero.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* 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
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
index 05926e6..9be12f9 100644
--- a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
@@ -61,15 +61,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__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)
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
index 56893b6..0a2f16b 100644
--- a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
@@ -1,4 +1,4 @@
-/* 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.
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
index 13432ef..7865691 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
@@ -45,9 +45,6 @@ ENTRY(__memset_niagara1)
sllx %o2, 32, %g1
ba,pt %XCC, 1f
or %g1, %o2, %o2
-END(__memset_niagara1)
-
-ENTRY(__bzero_niagara1)
clr %o2
1:
# ifndef USE_BRP
@@ -171,6 +168,6 @@ ENTRY(__bzero_niagara1)
90:
retl
mov %o3, %o0
-END(__bzero_niagara1)
+END(__memset_niagara1)
#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
index 1ccf24e..d6fbd83 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
@@ -39,10 +39,6 @@ ENTRY(__memset_niagara4)
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
@@ -118,6 +114,6 @@ ENTRY(__bzero_niagara4)
bne,pt %icc, 1b
add %o0, 0x30, %o0
ba,a,pt %icc, .Lpostloop
-END(__bzero_niagara4)
+END(__memset_niagara4)
#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S
index 491b203..6fcbf56 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S
@@ -99,13 +99,6 @@
.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 */
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
index e0d3424..3c3add7 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
@@ -25,6 +25,5 @@
# define weak_alias(x, y)
# define memset __memset_ultra1
-# define __bzero __bzero_ultra1
# include <sysdeps/sparc/sparc64/memset.S>
#endif