parisc: Add assembly implementations for strlen, strcpy, strncpy and strcat
Helge Deller
maintainerPATCH 1/1 parisc: Add assembly implementations for strlen, strcpy, strncpy and strcat
Add performance-optimized versions of the strlen, strcpy, strncpy and strcat string functions.
arch/parisc/include/asm/string.h +12 -0
@@ -8,4 +8,16 @@ extern void * memset(void *, int, size_t);#define __HAVE_ARCH_MEMCPYvoid *memcpy (void * dest,const void *src,size_t count); +#define __HAVE_ARCH_STRLEN +extern size_t strlen (const char *s); + +#define __HAVE_ARCH_STRCPY +extern char *strcpy (char *dest,const char *src); + +#define __HAVE_ARCH_STRNCPY +extern char *strncpy (char *dest,const char *src,size_t count); + +#define __HAVE_ARCH_STRCAT +extern char *strcat (char *dest,const char *src); +#endif
arch/parisc/kernel/parisc_ksyms.c +4 -0
@@ -30,6 +30,10 @@#include <linux/string.h> EXPORT_SYMBOL (memset); +EXPORT_SYMBOL (strlen); +EXPORT_SYMBOL (strcpy); +EXPORT_SYMBOL (strncpy); +EXPORT_SYMBOL (strcat);#include <linux/atomic.h> EXPORT_SYMBOL (__xchg8);
arch/parisc/lib/Makefile +1 -1
@@ -3,6 +3,6 @@ # lib-y := lusercopy.o bitops.o checksum.o io.o memset.o memcpy.o \ - ucmpdi2.o delay.o + ucmpdi2.o delay.o string.o obj-y := iomap.o
arch/parisc/lib/string.S new file +107 -0
107 lines not on this page · raw message
Hi,
Quoted 5 lines · Helge Deller
Add performance-optimized versions of the strlen, strcpy, strncpy and strcat string functions.
Signed-off-by Helge Deller <[email protected]>
I did a quick test on my C3750 with latest git plus this patch and found no obvious Problems.
Quoted 3 lines · Helge Deller
Add performance-optimized versions of the strlen, strcpy, strncpy and strcat string functions.
Can you say anything else about them? E.g., are you using some feature that the compiler isn't able to generate? Do you have performance data?
Except for strlen, they look like straightforward translations of the simple C implementations.
Helge Deller
maintainerQuoted 6 lines · Matt Turner
Quoted 3 lines · Helge Deller
Add performance-optimized versions of the strlen, strcpy, strncpy and strcat string functions.
Can you say anything else about them?
No.
Quoted 2 lines
E.g., are you using some feature that the compiler isn't able to generate?
Some assembler instructions are used which the compiler doesn't use by default for such use cases.
Quoted 1 line
Do you have performance data?
Not yet.
Maybe someone wants to do that?
Quoted 2 lines
Except for strlen, they look like straightforward translations of the simple C implementations.
The code is much smaller than what the compiler generates and the layout of the bytes-stores are targetted the behaviour of the parisc 64bit CPUs.
Helge
Quoted 23 lines · Helge Deller
Quoted 6 lines · Matt Turner
Quoted 3 lines · Helge Deller
Add performance-optimized versions of the strlen, strcpy, strncpy and strcat string functions.
Can you say anything else about them?
No.
Quoted 2 lines
E.g., are you using some feature that the compiler isn't able to generate?
Some assembler instructions are used which the compiler doesn't use by default for such use cases.
Quoted 1 line
Do you have performance data?
Not yet.
Maybe someone wants to do that?
Quoted 6 lines
Quoted 2 lines
Except for strlen, they look like straightforward translations of the simple C implementations.
The code is much smaller than what the compiler generates and the layout of the bytes-stores are targetted the behaviour of the parisc 64bit CPUs.
So is that the rationale? I'm not sure how anyone can offer review if they don't know what you're trying to accomplish.