Skip to content

Commit 3ece166

Browse files
antonblanchardmpe
authored andcommitted
powerpc: Remove assembly versions of strcpy, strcat, strlen and strcmp
A number of our assembly implementations of string functions do not align their hot loops. I was going to align them manually, but I realised that they are are almost instruction for instruction identical to what gcc produces, with the advantage that gcc does align them. In light of that, let's just remove the assembly versions. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent d96f234 commit 3ece166

3 files changed

Lines changed: 0 additions & 49 deletions

File tree

‎arch/powerpc/include/asm/string.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33

44
#ifdef __KERNEL__
55

6-
#define __HAVE_ARCH_STRCPY
76
#define __HAVE_ARCH_STRNCPY
8-
#define __HAVE_ARCH_STRLEN
9-
#define __HAVE_ARCH_STRCMP
107
#define __HAVE_ARCH_STRNCMP
11-
#define __HAVE_ARCH_STRCAT
128
#define __HAVE_ARCH_MEMSET
139
#define __HAVE_ARCH_MEMCPY
1410
#define __HAVE_ARCH_MEMMOVE

‎arch/powerpc/lib/ppc_ksyms.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ EXPORT_SYMBOL(memmove);
99
EXPORT_SYMBOL(memcmp);
1010
EXPORT_SYMBOL(memchr);
1111

12-
EXPORT_SYMBOL(strcpy);
1312
EXPORT_SYMBOL(strncpy);
14-
EXPORT_SYMBOL(strcat);
15-
EXPORT_SYMBOL(strlen);
16-
EXPORT_SYMBOL(strcmp);
1713
EXPORT_SYMBOL(strncmp);
1814

1915
#ifndef CONFIG_GENERIC_CSUM

‎arch/powerpc/lib/string.S‎

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@
1616
PPC_LONG_ALIGN
1717
.text
1818

19-
_GLOBAL(strcpy)
20-
addi r5,r3,-1
21-
addi r4,r4,-1
22-
1: lbzu r0,1(r4)
23-
cmpwi 0,r0,0
24-
stbu r0,1(r5)
25-
bne 1b
26-
blr
27-
2819
/* This clears out any unused part of the destination buffer,
2920
just as the libc version does. -- paulus */
3021
_GLOBAL(strncpy)
@@ -45,30 +36,6 @@ _GLOBAL(strncpy)
4536
bdnz 2b
4637
blr
4738

48-
_GLOBAL(strcat)
49-
addi r5,r3,-1
50-
addi r4,r4,-1
51-
1: lbzu r0,1(r5)
52-
cmpwi 0,r0,0
53-
bne 1b
54-
addi r5,r5,-1
55-
1: lbzu r0,1(r4)
56-
cmpwi 0,r0,0
57-
stbu r0,1(r5)
58-
bne 1b
59-
blr
60-
61-
_GLOBAL(strcmp)
62-
addi r5,r3,-1
63-
addi r4,r4,-1
64-
1: lbzu r3,1(r5)
65-
cmpwi 1,r3,0
66-
lbzu r0,1(r4)
67-
subf. r3,r0,r3
68-
beqlr 1
69-
beq 1b
70-
blr
71-
7239
_GLOBAL(strncmp)
7340
PPC_LCMPI 0,r5,0
7441
beq- 2f
@@ -85,14 +52,6 @@ _GLOBAL(strncmp)
8552
2: li r3,0
8653
blr
8754

88-
_GLOBAL(strlen)
89-
addi r4,r3,-1
90-
1: lbzu r0,1(r4)
91-
cmpwi 0,r0,0
92-
bne 1b
93-
subf r3,r3,r4
94-
blr
95-
9655
#ifdef CONFIG_PPC32
9756
_GLOBAL(memcmp)
9857
PPC_LCMPI 0,r5,0

0 commit comments

Comments
 (0)