summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2015-01-09 16:04:26 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2015-01-13 14:35:40 -0500
commitd3b00f468bec441596877a685a19f43dee88657f (patch)
tree2de8d805a29789d272de4eb416019aa68017e61d /sysdeps/powerpc/powerpc64/multiarch/strncmp.c
parent72607db038df1a1a7987af814aad8d2ed466c45c (diff)
powerpc: Optimized strncmp for POWER8/PPC64
This patch adds an optimized POWER8 strncmp. The implementation focus on speeding up unaligned cases follwing the ideas of power8 strcmp. The algorithm first check the initial 16 bytes, then align the first function source and uses unaligned loads on second argument only. Aditional checks for page boundaries are done for unaligned cases (where sources alignment are different).
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strncmp.c')
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
index eb02aac378..9b6a6595ad 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -25,13 +25,16 @@
extern __typeof (strncmp) __strncmp_ppc attribute_hidden;
extern __typeof (strncmp) __strncmp_power4 attribute_hidden;
extern __typeof (strncmp) __strncmp_power7 attribute_hidden;
+extern __typeof (strncmp) __strncmp_power8 attribute_hidden;
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
libc_ifunc (strncmp,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strncmp_power7 :
- (hwcap & PPC_FEATURE_POWER4)
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncmp_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncmp_power7 :
+ (hwcap & PPC_FEATURE_POWER4)
? __strncmp_power4
: __strncmp_ppc);
#endif