summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-11-12 00:48:12 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-11-12 00:48:12 +0000
commitf56e03f5754f666423a80c0d4e74a908a48e1997 (patch)
tree58862c7ce99dbc255b2b71d62334268fe6d32bb3
parentdd1be05eec6310a34647575c0d20bb5a052563c2 (diff)
Add hidden versions, hope I made it correctly. Sparc optimized string functions are not usable with current build system, each function (as long as asm) should go into an own file, the file having the name of the function
-rw-r--r--libc/string/sparc/sparc32/memchr.S4
-rw-r--r--libc/string/sparc/sparc32/memcpy.S22
-rw-r--r--libc/string/sparc/sparc32/memset.S7
-rw-r--r--libc/string/sparc/sparc32/stpcpy.S5
-rw-r--r--libc/string/sparc/sparc32/strcat.S7
-rw-r--r--libc/string/sparc/sparc32/strchr.S14
-rw-r--r--libc/string/sparc/sparc32/strcmp.S7
-rw-r--r--libc/string/sparc/sparc32/strcpy.S7
-rw-r--r--libc/string/sparc/sparc32/strlen.S7
-rw-r--r--libc/string/sparc/sparc64/memcpy.S21
-rw-r--r--libc/string/sparc/sparc64/memset.S7
-rw-r--r--libc/string/sparc/sparc64/sparcv9b/memcpy.S21
-rw-r--r--libc/string/sparc/sparc64/strcat.S7
-rw-r--r--libc/string/sparc/sparc64/strchr.S14
-rw-r--r--libc/string/sparc/sparc64/strcmp.S7
-rw-r--r--libc/string/sparc/sparc64/strcpy.S7
-rw-r--r--libc/string/sparc/sparc64/strlen.S7
17 files changed, 122 insertions, 49 deletions
diff --git a/libc/string/sparc/sparc32/memchr.S b/libc/string/sparc/sparc32/memchr.S
index c00df2427..e8f44f176 100644
--- a/libc/string/sparc/sparc32/memchr.S
+++ b/libc/string/sparc/sparc32/memchr.S
@@ -63,6 +63,9 @@
1: retl
sub %o0, 1, %o0
+.globl memchr
+.set memchr,__memchr
+.hidden __memchr
ENTRY(__memchr)
andcc %o1, 0xff, %o1
sll %o1, 8, %g6
@@ -138,7 +141,6 @@ ENTRY(__memchr)
sub %o0, 4, %o0
END(__memchr)
-weak_alias (__memchr, memchr)
#if !__BOUNDED_POINTERS__
weak_alias (__memchr, __ubp_memchr)
#endif
diff --git a/libc/string/sparc/sparc32/memcpy.S b/libc/string/sparc/sparc32/memcpy.S
index d0a80887b..b2a9b1602 100644
--- a/libc/string/sparc/sparc32/memcpy.S
+++ b/libc/string/sparc/sparc32/memcpy.S
@@ -161,12 +161,19 @@
b 3f
sub %o0, 2, %o0
-ENTRY(bcopy)
+.globl bcopy
+.set bcopy,__bcopy
+.hidden __bcopy
+ENTRY(__bcopy)
mov %o0, %o3
mov %o1, %o0
mov %o3, %o1
-END(bcopy)
-ENTRY(memmove)
+END(__bcopy)
+
+.globl memmove
+.set memmove,__memmove
+.hidden __memmove
+ENTRY(__memmove)
cmp %o0, %o1
st %o0, [%sp + 64]
bleu 9f
@@ -446,9 +453,12 @@ ENTRY(memmove)
sub %o2, 2, %o2
b 3f
add %o0, 2, %o0
-END(memmove)
+END(__memmove)
-ENTRY(memcpy) /* %o0=dst %o1=src %o2=len */
+.globl memcpy
+.set memcpy,__memcpy
+.hidden __memcpy
+ENTRY(__memcpy) /* %o0=dst %o1=src %o2=len */
sub %o0, %o1, %o4
st %o0, [%sp + 64]
9: andcc %o4, 3, %o5
@@ -963,4 +973,4 @@ ENTRY(memcpy) /* %o0=dst %o1=src %o2=len */
sub %o7, %o4, %o5
110: retl
sub %o7, %g6, %o5
-END(memcpy)
+END(__memcpy)
diff --git a/libc/string/sparc/sparc32/memset.S b/libc/string/sparc/sparc32/memset.S
index 02cebb791..ef8a5b634 100644
--- a/libc/string/sparc/sparc32/memset.S
+++ b/libc/string/sparc/sparc32/memset.S
@@ -62,7 +62,10 @@ ENTRY(__bzero)
sub %o0, %o2, %o0
END(__bzero)
-ENTRY(memset)
+.globl memset
+.set memset,__memset
+.hidden __memset
+ENTRY(__memset)
and %o1, 0xff, %g3
sll %g3, 8, %g2
or %g3, %g2, %g3
@@ -147,6 +150,6 @@ ENTRY(memset)
stb %g3, [%o0 + 6]
0: retl
nop
-END(memset)
+END(__memset)
weak_alias (__bzero, bzero)
diff --git a/libc/string/sparc/sparc32/stpcpy.S b/libc/string/sparc/sparc32/stpcpy.S
index b7e7a00f8..97a5dce0e 100644
--- a/libc/string/sparc/sparc32/stpcpy.S
+++ b/libc/string/sparc/sparc32/stpcpy.S
@@ -65,6 +65,9 @@
1: retl
add %o0, -1, %o0
+.globl stpcpy
+.set stpcpy,__stpcpy
+.hidden __stpcpy
ENTRY(__stpcpy)
andcc %o1, 3, %g0
bne 10b
@@ -157,5 +160,3 @@ ENTRY(__stpcpy)
19: retl
nop
END(__stpcpy)
-
-weak_alias (__stpcpy, stpcpy)
diff --git a/libc/string/sparc/sparc32/strcat.S b/libc/string/sparc/sparc32/strcat.S
index e4ff21d01..8efe6aebf 100644
--- a/libc/string/sparc/sparc32/strcat.S
+++ b/libc/string/sparc/sparc32/strcat.S
@@ -91,7 +91,10 @@
b 3f
sub %o0, 1, %o0
-ENTRY(strcat)
+.globl strcat
+.set strcat,__strcat
+.hidden __strcat
+ENTRY(__strcat)
mov %o0, %g2
andcc %o0, 3, %g0
bne 11b
@@ -343,4 +346,4 @@ ENTRY(strcat)
srl %o5, 16, %o4
retl
mov %g2, %o0
-END(strcat)
+END(__strcat)
diff --git a/libc/string/sparc/sparc32/strchr.S b/libc/string/sparc/sparc32/strchr.S
index f18a8abc7..450b4ffe6 100644
--- a/libc/string/sparc/sparc32/strchr.S
+++ b/libc/string/sparc/sparc32/strchr.S
@@ -67,7 +67,10 @@
1: retl
sub %o0, 1, %o0
-ENTRY(strchr)
+.globl strchr
+.set strchr,__strchr
+.hidden __strchr
+ENTRY(__strchr)
andcc %o1, 0xff, %o1
be 12f
sll %o1, 8, %o2
@@ -215,9 +218,12 @@ ENTRY(strchr)
1: or %o4, %lo(0x01010101), %o2
b 7f
ld [%o0], %g4
-END(strchr)
+END(__strchr)
-ENTRY(strrchr)
+.globl strrchr
+.set strrchr,__strrchr
+.hidden __strrchr
+ENTRY(__strrchr)
andcc %o1, 0xff, %o1
clr %o5
be 12b
@@ -274,7 +280,7 @@ ENTRY(strrchr)
ld [%o0], %g4
9: retl
mov %o5, %o0
-END(strrchr)
+END(__strrchr)
weak_alias (strchr, index)
weak_alias (strrchr, rindex)
diff --git a/libc/string/sparc/sparc32/strcmp.S b/libc/string/sparc/sparc32/strcmp.S
index d6cf9e7d3..2ae1b2ef4 100644
--- a/libc/string/sparc/sparc32/strcmp.S
+++ b/libc/string/sparc/sparc32/strcmp.S
@@ -74,7 +74,10 @@
2: retl
mov %o4, %o0
-ENTRY(strcmp)
+.globl strcmp
+.set strcmp,__strcmp
+.hidden __strcmp
+ENTRY(__strcmp)
andcc %o0, 3, %g0
bne 10b
sethi %hi(0x80808080), %g1
@@ -252,4 +255,4 @@ ENTRY(strcmp)
ld [%i0], %i4
jmpl %i7 + 8, %g0
restore %g4, %g0, %o0
-END(strcmp)
+END(__strcmp)
diff --git a/libc/string/sparc/sparc32/strcpy.S b/libc/string/sparc/sparc32/strcpy.S
index c368580ba..6dc3517b5 100644
--- a/libc/string/sparc/sparc32/strcpy.S
+++ b/libc/string/sparc/sparc32/strcpy.S
@@ -63,7 +63,10 @@
b 6f
andcc %o0, 3, %g3
-ENTRY(strcpy)
+.globl strcpy
+.set strcpy,__strcpy
+.hidden __strcpy
+ENTRY(__strcpy)
mov %o0, %g2
andcc %o1, 3, %g0
bne 1b
@@ -269,4 +272,4 @@ ENTRY(strcpy)
srl %o5, 16, %o4
retl
mov %g2, %o0
-END(strcpy)
+END(__strcpy)
diff --git a/libc/string/sparc/sparc32/strlen.S b/libc/string/sparc/sparc32/strlen.S
index cc455ac89..116700e24 100644
--- a/libc/string/sparc/sparc32/strlen.S
+++ b/libc/string/sparc/sparc32/strlen.S
@@ -63,7 +63,10 @@
3: retl
mov 2, %o0
-ENTRY(strlen)
+.globl strlen
+.set strlen,__strlen
+.hidden __strlen
+ENTRY(__strlen)
mov %o0, %o1
andcc %o0, 3, %g0
bne 10b
@@ -98,4 +101,4 @@ ENTRY(strlen)
add %o4, 1, %o4
13: retl
sub %o4, %o1, %o0
-END(strlen)
+END(__strlen)
diff --git a/libc/string/sparc/sparc64/memcpy.S b/libc/string/sparc/sparc64/memcpy.S
index 660fae6b2..47f812a1e 100644
--- a/libc/string/sparc/sparc64/memcpy.S
+++ b/libc/string/sparc/sparc64/memcpy.S
@@ -191,7 +191,10 @@
.text
.align 32
-ENTRY(bcopy)
+.globl bcopy
+.set bcopy,__bcopy
+.hidden __bcopy
+ENTRY(__bcopy)
sub %o1, %o0, %o4 /* IEU0 Group */
mov %o0, %g3 /* IEU1 */
cmp %o4, %o2 /* IEU1 Group */
@@ -205,7 +208,7 @@ ENTRY(bcopy)
add %o0, %o2, %o0 /* IEU0 */
retl
nop
-END(bcopy)
+END(__bcopy)
.align 32
200: be,pt %xcc, 201f /* CTI */
@@ -503,7 +506,10 @@ END(__align_cpy_16)
#endif
.align 32
-ENTRY(memcpy)
+.globl memcpy
+.set memcpy,__memcpy
+.hidden __memcpy
+ENTRY(__memcpy)
210:
#ifndef USE_BPR
srl %o2, 0, %o2 /* IEU1 Group */
@@ -694,7 +700,7 @@ ENTRY(memcpy)
214: wr %g0, FPRS_FEF, %fprs
retl
mov %g4, %o0
-END(memcpy)
+END(__memcpy)
.align 32
228: andcc %o2, 1, %g0 /* IEU1 Group */
@@ -719,7 +725,10 @@ END(memcpy)
nop
.align 32
-ENTRY(memmove)
+.globl memmove
+.set memmove,__memmove
+.hidden __memmove
+ENTRY(__memmove)
#ifndef USE_BPR
srl %o2, 0, %o2 /* IEU1 Group */
#endif
@@ -910,7 +919,7 @@ ENTRY(memmove)
234: wr %g0, FPRS_FEF, %fprs
retl
mov %g4, %o0
-END(memmove)
+END(__memmove)
#ifdef USE_BPR
weak_alias (memcpy, __align_cpy_1)
diff --git a/libc/string/sparc/sparc64/memset.S b/libc/string/sparc/sparc64/memset.S
index 2e23f92a8..5d2911451 100644
--- a/libc/string/sparc/sparc64/memset.S
+++ b/libc/string/sparc/sparc64/memset.S
@@ -36,7 +36,10 @@
/* Well, memset is a lot easier to get right than bcopy... */
.text
.align 32
-ENTRY(memset)
+.globl memset
+.set memset,__memset
+.hidden __memset
+ENTRY(__memset)
andcc %o1, 0xff, %o1
mov %o0, %o5
be,a,pt %icc, 50f
@@ -176,7 +179,7 @@ ENTRY(memset)
nop
ba,pt %xcc, 18b
ldd [%o0], %f0
-END(memset)
+END(__memset)
#define ZERO_BLOCKS(base, offset, source) \
stx source, [base - offset - 0x38]; \
diff --git a/libc/string/sparc/sparc64/sparcv9b/memcpy.S b/libc/string/sparc/sparc64/sparcv9b/memcpy.S
index 7f36b7c2c..91e74d438 100644
--- a/libc/string/sparc/sparc64/sparcv9b/memcpy.S
+++ b/libc/string/sparc/sparc64/sparcv9b/memcpy.S
@@ -36,7 +36,10 @@
.text
.align 32
-ENTRY(bcopy)
+.globl bcopy
+.set bcopy,__bcopy
+.hidden __bcopy
+ENTRY(__bcopy)
sub %o1, %o0, %o4
mov %o0, %g4
cmp %o4, %o2
@@ -50,7 +53,7 @@ ENTRY(bcopy)
add %o0, %o2, %o0
retl
nop
-END(bcopy)
+END(__bcopy)
/* Special/non-trivial issues of this code:
*
@@ -67,7 +70,10 @@ END(bcopy)
* of up to 2.4GB per second.
*/
.align 32
-ENTRY(memcpy)
+.globl memcpy
+.set memcpy,__memcpy
+.hidden __memcpy
+ENTRY(__memcpy)
100: /* %o0=dst, %o1=src, %o2=len */
mov %o0, %g5
@@ -328,7 +334,7 @@ small_copy_unaligned:
retl
mov %g5, %o0
-END(memcpy)
+END(__memcpy)
#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
ldx [%src - offset - 0x20], %t0; \
@@ -403,7 +409,10 @@ END(memcpy)
mov %g4, %o0
.align 32
-ENTRY(memmove)
+.globl memmove
+.set memmove,__memmove
+.hidden __memmove
+ENTRY(__memmove)
mov %o0, %g5
#ifndef USE_BPR
srl %o2, 0, %o2 /* IEU1 Group */
@@ -595,7 +604,7 @@ ENTRY(memmove)
234: wr %g0, FPRS_FEF, %fprs
retl
mov %g4, %o0
-END(memmove)
+END(__memmove)
#ifdef USE_BPR
weak_alias (memcpy, __align_cpy_1)
diff --git a/libc/string/sparc/sparc64/strcat.S b/libc/string/sparc/sparc64/strcat.S
index 21ff119c4..3b81e59e6 100644
--- a/libc/string/sparc/sparc64/strcat.S
+++ b/libc/string/sparc/sparc64/strcat.S
@@ -47,7 +47,10 @@
.text
.align 32
-ENTRY(strcat)
+.globl strcat
+.set strcat,__strcat
+.hidden __strcat
+ENTRY(__strcat)
sethi %hi(0x01010101), %g1 /* IEU0 Group */
ldub [%o0], %o3 /* Load */
or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
@@ -335,4 +338,4 @@ ENTRY(strcat)
stb %o4, [%o0 - 8] /* Store */
retl /* CTI+IEU1 Group */
mov %g6, %o0 /* IEU0 */
-END(strcat)
+END(__strcat)
diff --git a/libc/string/sparc/sparc64/strchr.S b/libc/string/sparc/sparc64/strchr.S
index 784b7fe4d..6943e8b96 100644
--- a/libc/string/sparc/sparc64/strchr.S
+++ b/libc/string/sparc/sparc64/strchr.S
@@ -47,7 +47,10 @@
.text
.align 32
-ENTRY(strchr)
+.globl strchr
+.set strchr,__strchr
+.hidden __strchr
+ENTRY(__strchr)
andcc %o1, 0xff, %o1 /* IEU1 Group */
be,pn %icc, 17f /* CTI */
sllx %o1, 8, %g3 /* IEU0 Group */
@@ -327,10 +330,13 @@ ENTRY(strchr)
lduba [%o0] ASI_PNF, %o3 /* Load */
retl /* CTI+IEU1 Group */
add %o0, -1, %o0 /* IEU0 */
-END(strchr)
+END(__strchr)
.align 32
-ENTRY(strrchr)
+.globl strrchr
+.set strrchr,__strrchr
+.hidden __strrchr
+ENTRY(__strrchr)
andcc %o1, 0xff, %o1 /* IEU1 Group */
be,pn %icc, 17b /* CTI */
clr %g4 /* IEU0 */
@@ -474,7 +480,7 @@ ENTRY(strrchr)
ba,pt %xcc, 1b /* CTI Group */
ldx [%o0], %o3 /* Load */
-END(strrchr)
+END(__strrchr)
weak_alias (strchr, index)
weak_alias (strrchr, rindex)
diff --git a/libc/string/sparc/sparc64/strcmp.S b/libc/string/sparc/sparc64/strcmp.S
index 5866778d3..a4eb36632 100644
--- a/libc/string/sparc/sparc64/strcmp.S
+++ b/libc/string/sparc/sparc64/strcmp.S
@@ -45,7 +45,10 @@
.text
.align 32
-ENTRY(strcmp)
+.globl strcmp
+.set strcmp,__strcmp
+.hidden __strcmp
+ENTRY(__strcmp)
sethi %hi(0x01010101), %g1 /* IEU0 Group */
andcc %o0, 7, %g0 /* IEU1 */
bne,pn %icc, 7f /* CTI */
@@ -275,4 +278,4 @@ ENTRY(strcmp)
ba,pt %xcc, 11b /* CTI Group */
ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
-END(strcmp)
+END(__strcmp)
diff --git a/libc/string/sparc/sparc64/strcpy.S b/libc/string/sparc/sparc64/strcpy.S
index aa5d2aee3..cc906bae7 100644
--- a/libc/string/sparc/sparc64/strcpy.S
+++ b/libc/string/sparc/sparc64/strcpy.S
@@ -45,7 +45,10 @@
.text
.align 32
-ENTRY(strcpy)
+.globl strcpy
+.set strcpy,__strcpy
+.hidden __strcpy
+ENTRY(__strcpy)
sethi %hi(0x01010101), %g1 /* IEU0 Group */
mov %o0, %g6 /* IEU1 */
or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
@@ -240,4 +243,4 @@ ENTRY(strcpy)
stb %o4, [%o0 - 8] /* Store */
retl /* CTI+IEU1 Group */
mov %g6, %o0 /* IEU0 */
-END(strcpy)
+END(__strcpy)
diff --git a/libc/string/sparc/sparc64/strlen.S b/libc/string/sparc/sparc64/strlen.S
index 5167ad5ba..9f48fe6a1 100644
--- a/libc/string/sparc/sparc64/strlen.S
+++ b/libc/string/sparc/sparc64/strlen.S
@@ -39,7 +39,10 @@
.text
.align 32
-ENTRY(strlen)
+.globl strlen
+.set strlen,__strlen
+.hidden __strlen
+ENTRY(__strlen)
sethi %hi(0x01010101), %g1 /* IEU0 Group */
ldub [%o0], %o3 /* Load */
or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
@@ -169,4 +172,4 @@ ENTRY(strlen)
add %o0, -1, %o0 /* IEU0 Group */
retl /* CTI+IEU1 Group */
sub %o0, %o1, %o0 /* IEU0 */
-END(strlen)
+END(__strlen)