about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2015-01-07 07:18:30 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2015-01-13 11:28:58 -0500
commit8bedcb5f03c62bf6001396dafdd82fbd4da7c2db (patch)
tree436c29346cd848224d7adee415d8e78cc4409915 /sysdeps/powerpc/powerpc64/multiarch/strcmp.c
parentf06a4faf8a2b4d046eb40e94b47948cc47d79902 (diff)
downloadglibc-8bedcb5f03c62bf6001396dafdd82fbd4da7c2db.tar.gz
glibc-8bedcb5f03c62bf6001396dafdd82fbd4da7c2db.tar.xz
glibc-8bedcb5f03c62bf6001396dafdd82fbd4da7c2db.zip
powerpc: Optimized strcmp for POWER8/PPC64
This patch adds an optimized POWER8 strcmp using unaligned accesses.
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
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strcmp.c')
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
index 9b2922f644..b45ba1f54d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
@@ -23,9 +23,12 @@
 
 extern __typeof (strcmp) __strcmp_ppc attribute_hidden;
 extern __typeof (strcmp) __strcmp_power7 attribute_hidden;
+extern __typeof (strcmp) __strcmp_power8 attribute_hidden;
 
 libc_ifunc (strcmp,
-            (hwcap & PPC_FEATURE_HAS_VSX)
-            ? __strcmp_power7
+            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+              ? __strcmp_power8 :
+              (hwcap & PPC_FEATURE_HAS_VSX)
+              ? __strcmp_power7
             : __strcmp_ppc);
 #endif