aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorPhilippe Bergheaud <felix@linux.vnet.ibm.com>2014-04-29 19:12:01 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-30 01:26:18 -0400
commit00f554fadebb96877ad449758dc90303a9826afe (patch)
tree77a9ff9bfbb32f75a18a7f3032ad7d3d55944c48 /arch/powerpc/include
parent48ce3b7cc66b31cd8ae1b8155a82426308f71491 (diff)
powerpc: memcpy optimization for 64bit LE
Unaligned stores take alignment exceptions on POWER7 running in little-endian. This is a dumb little-endian base memcpy that prevents unaligned stores. Once booted the feature fixup code switches over to the VMX copy loops (which are already endian safe). The question is what we do before that switch over. The base 64bit memcpy takes alignment exceptions on POWER7 so we can't use it as is. Fixing the causes of alignment exception would slow it down, because we'd need to ensure all loads and stores are aligned either through rotate tricks or bytewise loads and stores. Either would be bad for all other 64bit platforms. [ I simplified the loop a bit - Anton ] Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/string.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h
index 0dffad6bcc84..e40010abcaf1 100644
--- a/arch/powerpc/include/asm/string.h
+++ b/arch/powerpc/include/asm/string.h
@@ -10,9 +10,7 @@
10#define __HAVE_ARCH_STRNCMP 10#define __HAVE_ARCH_STRNCMP
11#define __HAVE_ARCH_STRCAT 11#define __HAVE_ARCH_STRCAT
12#define __HAVE_ARCH_MEMSET 12#define __HAVE_ARCH_MEMSET
13#ifdef __BIG_ENDIAN__
14#define __HAVE_ARCH_MEMCPY 13#define __HAVE_ARCH_MEMCPY
15#endif
16#define __HAVE_ARCH_MEMMOVE 14#define __HAVE_ARCH_MEMMOVE
17#define __HAVE_ARCH_MEMCMP 15#define __HAVE_ARCH_MEMCMP
18#define __HAVE_ARCH_MEMCHR 16#define __HAVE_ARCH_MEMCHR
@@ -24,9 +22,7 @@ extern int strcmp(const char *,const char *);
24extern int strncmp(const char *, const char *, __kernel_size_t); 22extern int strncmp(const char *, const char *, __kernel_size_t);
25extern char * strcat(char *, const char *); 23extern char * strcat(char *, const char *);
26extern void * memset(void *,int,__kernel_size_t); 24extern void * memset(void *,int,__kernel_size_t);
27#ifdef __BIG_ENDIAN__
28extern void * memcpy(void *,const void *,__kernel_size_t); 25extern void * memcpy(void *,const void *,__kernel_size_t);
29#endif
30extern void * memmove(void *,const void *,__kernel_size_t); 26extern void * memmove(void *,const void *,__kernel_size_t);
31extern int memcmp(const void *,const void *,__kernel_size_t); 27extern int memcmp(const void *,const void *,__kernel_size_t);
32extern void * memchr(const void *,int,__kernel_size_t); 28extern void * memchr(const void *,int,__kernel_size_t);