/* strcmp with SSE4.2
- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* We use 0x1a:
.section .text.SECTION,"ax",@progbits
.align 16
.type STRCMP_SSE42, @function
+ .globl STRCMP_SSE42
+ .hidden STRCMP_SSE42
#ifdef USE_AS_STRCASECMP_L
ENTRY (GLABEL(__strcasecmp))
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rdx
+ mov %fs:(%rax),%RDX_LP
// XXX 5 byte should be before the function
/* 5-byte NOP. */
#ifdef USE_AS_STRNCASECMP_L
ENTRY (GLABEL(__strncasecmp))
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rcx
+ mov %fs:(%rax),%RCX_LP
// XXX 5 byte should be before the function
/* 5-byte NOP. */
/* We have to fall back on the C implementation for locales
with encodings not matching ASCII for single bytes. */
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rdx), %rax
+ mov LOCALE_T___LOCALES+LC_CTYPE*LP_SIZE(%rdx), %RAX_LP
# else
- movq (%rdx), %rax
+ mov (%rdx), %RAX_LP
# endif
- testl $0, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
+ testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
jne __strcasecmp_l_nonascii
#endif
#ifdef USE_AS_STRNCASECMP_L
/* We have to fall back on the C implementation for locales
with encodings not matching ASCII for single bytes. */
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rcx), %rax
+ mov LOCALE_T___LOCALES+LC_CTYPE*LP_SIZE(%rcx), %RAX_LP
# else
- movq (%rcx), %rax
+ mov (%rcx), %RAX_LP
# endif
- testl $0, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
+ testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
jne __strncasecmp_l_nonascii
#endif
jnz LABEL(less16bytes)/* If not, find different value or null char */
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
sub $16, %r11
- jbe LABEL(strcmp_exitz)/* finish comparision */
+ jbe LABEL(strcmp_exitz)/* finish comparison */
#endif
add $16, %rsi /* prepare to search next 16 bytes */
add $16, %rdi /* prepare to search next 16 bytes */