diff options
author | Liubov Dmitrieva <liubov.dmitrieva@gmail.com> | 2011-10-15 11:10:08 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-15 11:10:08 -0400 |
commit | be13f7bff66e1850f9057dd813d6e7be022d9516 (patch) | |
tree | d918a146db9072ad120f0010481c53d9b450c9a5 /sysdeps/x86_64/multiarch/memcmp.S | |
parent | 556a2007974ed39a68c87a8b5181f8057ecd0d6f (diff) | |
download | glibc-be13f7bff66e1850f9057dd813d6e7be022d9516.tar.gz glibc-be13f7bff66e1850f9057dd813d6e7be022d9516.tar.xz glibc-be13f7bff66e1850f9057dd813d6e7be022d9516.zip |
Optimized memcmp and wmemcmp for x86-64 and x86-32
Diffstat (limited to 'sysdeps/x86_64/multiarch/memcmp.S')
-rw-r--r-- | sysdeps/x86_64/multiarch/memcmp.S | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sysdeps/x86_64/multiarch/memcmp.S b/sysdeps/x86_64/multiarch/memcmp.S index 301ab287f5..8bf8f3a417 100644 --- a/sysdeps/x86_64/multiarch/memcmp.S +++ b/sysdeps/x86_64/multiarch/memcmp.S @@ -1,5 +1,5 @@ /* Multiple versions of memcmp - Copyright (C) 2010 Free Software Foundation, Inc. + Copyright (C) 2010, 2011 Free Software Foundation, Inc. Contributed by Intel Corporation. This file is part of the GNU C Library. @@ -29,11 +29,20 @@ ENTRY(memcmp) cmpl $0, KIND_OFFSET+__cpu_features(%rip) jne 1f call __init_cpu_features -1: leaq __memcmp_sse2(%rip), %rax - testl $bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip) - jz 2f + +1: testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + jnz 2f + leaq __memcmp_sse2(%rip), %rax + ret + +2: testl $bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip) + jz 3f leaq __memcmp_sse4_1(%rip), %rax -2: ret + ret + +3: leaq __memcmp_ssse3(%rip), %rax + ret + END(memcmp) # undef ENTRY |