2010-02-15 19:17:50 +00:00
|
|
|
/* strcmp with SSE4.2
|
2021-01-02 19:32:25 +00:00
|
|
|
Copyright (C) 2010-2021 Free Software Foundation, Inc.
|
2010-02-15 19:17:50 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
|
|
|
<https://www.gnu.org/licenses/>. */
|
2010-02-15 19:17:50 +00:00
|
|
|
|
2014-11-24 09:33:45 +00:00
|
|
|
#if IS_IN (libc)
|
2010-02-15 19:17:50 +00:00
|
|
|
|
|
|
|
#include <sysdep.h>
|
|
|
|
#include "asm-syntax.h"
|
|
|
|
|
|
|
|
#define CFI_PUSH(REG) \
|
|
|
|
cfi_adjust_cfa_offset (4); \
|
|
|
|
cfi_rel_offset (REG, 0)
|
|
|
|
|
|
|
|
#define CFI_POP(REG) \
|
|
|
|
cfi_adjust_cfa_offset (-4); \
|
|
|
|
cfi_restore (REG)
|
|
|
|
|
|
|
|
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
|
|
|
|
#define POP(REG) popl REG; CFI_POP (REG)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#ifdef USE_AS_STRNCMP
|
2010-02-15 19:17:50 +00:00
|
|
|
# ifndef STRCMP
|
2011-11-14 23:24:35 +00:00
|
|
|
# define STRCMP __strncmp_sse4_2
|
2010-02-15 19:17:50 +00:00
|
|
|
# endif
|
2011-11-14 23:24:35 +00:00
|
|
|
# define STR1 8
|
2010-02-15 19:17:50 +00:00
|
|
|
# define STR2 STR1+4
|
2011-11-14 23:24:35 +00:00
|
|
|
# define CNT STR2+4
|
|
|
|
# define RETURN POP (REM); ret; .p2align 4; CFI_PUSH (REM)
|
|
|
|
# define REM %ebp
|
|
|
|
#elif defined USE_AS_STRCASECMP_L
|
|
|
|
# include "locale-defines.h"
|
2010-02-15 19:17:50 +00:00
|
|
|
# ifndef STRCMP
|
2011-11-14 23:24:35 +00:00
|
|
|
# define STRCMP __strcasecmp_l_sse4_2
|
2010-02-15 19:17:50 +00:00
|
|
|
# endif
|
2011-11-16 08:36:15 +00:00
|
|
|
# ifdef PIC
|
|
|
|
# define STR1 12
|
|
|
|
# else
|
|
|
|
# define STR1 8
|
|
|
|
# endif
|
2011-11-14 23:24:35 +00:00
|
|
|
# define STR2 STR1+4
|
2013-08-21 17:48:48 +00:00
|
|
|
# define LOCALE 12 /* Loaded before the adjustment. */
|
2011-11-14 23:24:35 +00:00
|
|
|
# ifdef PIC
|
|
|
|
# define RETURN POP (%edi); POP (%ebx); ret; \
|
|
|
|
.p2align 4; CFI_PUSH (%ebx); CFI_PUSH (%edi)
|
|
|
|
# else
|
|
|
|
# define RETURN POP (%edi); ret; .p2align 4; CFI_PUSH (%edi)
|
|
|
|
# endif
|
|
|
|
# define NONASCII __strcasecmp_nonascii
|
|
|
|
#elif defined USE_AS_STRNCASECMP_L
|
|
|
|
# include "locale-defines.h"
|
|
|
|
# ifndef STRCMP
|
|
|
|
# define STRCMP __strncasecmp_l_sse4_2
|
|
|
|
# endif
|
2011-11-16 08:36:15 +00:00
|
|
|
# ifdef PIC
|
|
|
|
# define STR1 16
|
|
|
|
# else
|
|
|
|
# define STR1 12
|
|
|
|
# endif
|
2010-02-15 19:17:50 +00:00
|
|
|
# define STR2 STR1+4
|
|
|
|
# define CNT STR2+4
|
2013-08-21 17:48:48 +00:00
|
|
|
# define LOCALE 16 /* Loaded before the adjustment. */
|
2011-11-14 23:24:35 +00:00
|
|
|
# ifdef PIC
|
|
|
|
# define RETURN POP (%edi); POP (REM); POP (%ebx); ret; \
|
|
|
|
.p2align 4; \
|
|
|
|
CFI_PUSH (%ebx); CFI_PUSH (REM); CFI_PUSH (%edi)
|
|
|
|
# else
|
|
|
|
# define RETURN POP (%edi); POP (REM); ret; \
|
|
|
|
.p2align 4; CFI_PUSH (REM); CFI_PUSH (%edi)
|
|
|
|
# endif
|
|
|
|
# define REM %ebp
|
|
|
|
# define NONASCII __strncasecmp_nonascii
|
|
|
|
#else
|
|
|
|
# ifndef STRCMP
|
|
|
|
# define STRCMP __strcmp_sse4_2
|
|
|
|
# endif
|
|
|
|
# define STR1 4
|
|
|
|
# define STR2 STR1+4
|
|
|
|
# define RETURN ret; .p2align 4
|
2010-02-15 19:17:50 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
.section .text.sse4.2,"ax",@progbits
|
2011-11-14 23:24:35 +00:00
|
|
|
|
|
|
|
#ifdef USE_AS_STRCASECMP_L
|
|
|
|
ENTRY (__strcasecmp_sse4_2)
|
|
|
|
# ifdef PIC
|
|
|
|
PUSH (%ebx)
|
2012-02-03 23:22:53 +00:00
|
|
|
LOAD_PIC_REG(bx)
|
2011-11-14 23:24:35 +00:00
|
|
|
movl __libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
|
2011-11-16 08:36:15 +00:00
|
|
|
movl %gs:(%eax), %eax
|
2011-11-14 23:24:35 +00:00
|
|
|
# else
|
2011-11-16 08:36:15 +00:00
|
|
|
movl %gs:__libc_tsd_LOCALE@NTPOFF, %eax
|
2011-11-14 23:24:35 +00:00
|
|
|
# endif
|
|
|
|
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
|
|
|
|
movl LOCALE_T___LOCALES+LC_CTYPE*4(%eax), %eax
|
|
|
|
# else
|
|
|
|
movl (%eax), %eax
|
|
|
|
# endif
|
|
|
|
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
|
2013-07-29 12:58:41 +00:00
|
|
|
# ifdef PIC
|
|
|
|
je L(ascii)
|
|
|
|
POP (%ebx)
|
|
|
|
jmp __strcasecmp_nonascii
|
|
|
|
# else
|
2011-11-14 23:24:35 +00:00
|
|
|
jne __strcasecmp_nonascii
|
|
|
|
jmp L(ascii)
|
2013-07-29 12:58:41 +00:00
|
|
|
# endif
|
2011-11-14 23:24:35 +00:00
|
|
|
END (__strcasecmp_sse4_2)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_AS_STRNCASECMP_L
|
|
|
|
ENTRY (__strncasecmp_sse4_2)
|
|
|
|
# ifdef PIC
|
|
|
|
PUSH (%ebx)
|
2012-02-03 23:22:53 +00:00
|
|
|
LOAD_PIC_REG(bx)
|
2011-11-14 23:24:35 +00:00
|
|
|
movl __libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
|
2011-11-16 08:36:15 +00:00
|
|
|
movl %gs:(%eax), %eax
|
2011-11-14 23:24:35 +00:00
|
|
|
# else
|
2011-11-16 08:36:15 +00:00
|
|
|
movl %gs:__libc_tsd_LOCALE@NTPOFF, %eax
|
2011-11-14 23:24:35 +00:00
|
|
|
# endif
|
|
|
|
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
|
|
|
|
movl LOCALE_T___LOCALES+LC_CTYPE*4(%eax), %eax
|
|
|
|
# else
|
|
|
|
movl (%eax), %eax
|
|
|
|
# endif
|
|
|
|
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
|
2013-07-29 12:58:41 +00:00
|
|
|
# ifdef PIC
|
|
|
|
je L(ascii)
|
|
|
|
POP (%ebx)
|
|
|
|
jmp __strncasecmp_nonascii
|
|
|
|
# else
|
2011-11-14 23:24:35 +00:00
|
|
|
jne __strncasecmp_nonascii
|
|
|
|
jmp L(ascii)
|
2013-07-29 12:58:41 +00:00
|
|
|
# endif
|
2011-11-14 23:24:35 +00:00
|
|
|
END (__strncasecmp_sse4_2)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ENTRY (STRCMP)
|
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movl LOCALE(%esp), %eax
|
|
|
|
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
|
|
|
|
movl LOCALE_T___LOCALES+LC_CTYPE*4(%eax), %eax
|
|
|
|
# else
|
|
|
|
movl (%eax), %eax
|
|
|
|
# endif
|
|
|
|
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
|
|
|
|
jne NONASCII
|
|
|
|
|
|
|
|
# ifdef PIC
|
|
|
|
PUSH (%ebx)
|
2012-02-03 23:22:53 +00:00
|
|
|
LOAD_PIC_REG(bx)
|
2011-11-14 23:24:35 +00:00
|
|
|
# endif
|
|
|
|
L(ascii):
|
|
|
|
.section .rodata.cst16,"aM",@progbits,16
|
|
|
|
.align 16
|
|
|
|
.Lbelowupper:
|
|
|
|
.quad 0x4040404040404040
|
|
|
|
.quad 0x4040404040404040
|
|
|
|
.Ltopupper:
|
|
|
|
.quad 0x5b5b5b5b5b5b5b5b
|
|
|
|
.quad 0x5b5b5b5b5b5b5b5b
|
|
|
|
.Ltouppermask:
|
|
|
|
.quad 0x2020202020202020
|
|
|
|
.quad 0x2020202020202020
|
|
|
|
.previous
|
|
|
|
|
|
|
|
# ifdef PIC
|
|
|
|
# define UCLOW_reg .Lbelowupper@GOTOFF(%ebx)
|
|
|
|
# define UCHIGH_reg .Ltopupper@GOTOFF(%ebx)
|
|
|
|
# define LCQWORD_reg .Ltouppermask@GOTOFF(%ebx)
|
|
|
|
# else
|
|
|
|
# define UCLOW_reg .Lbelowupper
|
|
|
|
# define UCHIGH_reg .Ltopupper
|
|
|
|
# define LCQWORD_reg .Ltouppermask
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
PUSH (REM)
|
|
|
|
#endif
|
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
PUSH (%edi)
|
2010-02-15 19:17:50 +00:00
|
|
|
#endif
|
|
|
|
mov STR1(%esp), %edx
|
|
|
|
mov STR2(%esp), %eax
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
movl CNT(%esp), REM
|
|
|
|
test REM, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
mov %dx, %cx
|
|
|
|
and $0xfff, %cx
|
|
|
|
cmp $0xff0, %cx
|
|
|
|
ja L(first4bytes)
|
|
|
|
movdqu (%edx), %xmm2
|
|
|
|
mov %eax, %ecx
|
|
|
|
and $0xfff, %ecx
|
|
|
|
cmp $0xff0, %ecx
|
|
|
|
ja L(first4bytes)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
# define TOLOWER(reg1, reg2) \
|
|
|
|
movdqa reg1, %xmm3; \
|
|
|
|
movdqa UCHIGH_reg, %xmm4; \
|
|
|
|
movdqa reg2, %xmm5; \
|
|
|
|
movdqa UCHIGH_reg, %xmm6; \
|
|
|
|
pcmpgtb UCLOW_reg, %xmm3; \
|
|
|
|
pcmpgtb reg1, %xmm4; \
|
|
|
|
pcmpgtb UCLOW_reg, %xmm5; \
|
|
|
|
pcmpgtb reg2, %xmm6; \
|
|
|
|
pand %xmm4, %xmm3; \
|
|
|
|
pand %xmm6, %xmm5; \
|
|
|
|
pand LCQWORD_reg, %xmm3; \
|
|
|
|
pand LCQWORD_reg, %xmm5; \
|
|
|
|
por %xmm3, reg1; \
|
|
|
|
por %xmm5, reg2
|
|
|
|
|
|
|
|
movdqu (%eax), %xmm1
|
|
|
|
TOLOWER (%xmm2, %xmm1)
|
|
|
|
movd %xmm2, %ecx
|
|
|
|
movd %xmm1, %edi
|
|
|
|
movdqa %xmm2, %xmm3
|
|
|
|
movdqa %xmm1, %xmm4
|
|
|
|
cmpl %edi, %ecx
|
|
|
|
#else
|
|
|
|
# define TOLOWER(reg1, reg)
|
|
|
|
|
2010-02-15 19:17:50 +00:00
|
|
|
movd %xmm2, %ecx
|
|
|
|
cmp (%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(less4bytes)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
|
2010-02-15 19:17:50 +00:00
|
|
|
movdqu (%eax), %xmm1
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
pxor %xmm2, %xmm1
|
|
|
|
pxor %xmm0, %xmm0
|
|
|
|
ptest %xmm1, %xmm0
|
|
|
|
jnc L(less16bytes)
|
|
|
|
pcmpeqb %xmm0, %xmm2
|
|
|
|
ptest %xmm2, %xmm0
|
|
|
|
jnc L(less16bytes)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
sub $16, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
jbe L(eq)
|
|
|
|
#endif
|
|
|
|
add $16, %edx
|
|
|
|
add $16, %eax
|
|
|
|
L(first4bytes):
|
|
|
|
movzbl (%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl (%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, (%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $1, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
movzbl 1(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 1(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 1(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $2, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 2(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 2(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 2(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $3, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 3(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 3(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 3(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $4, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 4(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 4(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 4(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $5, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 5(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 5(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 5(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $6, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 6(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 6(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 6(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $7, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 7(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 7(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 7(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
sub $8, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
add $8, %eax
|
|
|
|
add $8, %edx
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
|
2010-02-15 19:17:50 +00:00
|
|
|
PUSH (%edi)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
PUSH (%esi)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
2010-02-15 21:04:54 +00:00
|
|
|
cfi_remember_state
|
2010-02-27 03:54:50 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
mov %edx, %edi
|
|
|
|
mov %eax, %esi
|
|
|
|
xorl %eax, %eax
|
|
|
|
L(check_offset):
|
2011-11-14 23:24:35 +00:00
|
|
|
movl %edi, %edx
|
2010-02-15 19:17:50 +00:00
|
|
|
movl %esi, %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
andl $0xfff, %edx
|
2010-02-15 19:17:50 +00:00
|
|
|
andl $0xfff, %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
cmpl %edx, %ecx
|
|
|
|
cmovl %edx, %ecx
|
2010-02-15 19:17:50 +00:00
|
|
|
lea -0xff0(%ecx), %edx
|
|
|
|
sub %edx, %edi
|
|
|
|
sub %edx, %esi
|
|
|
|
testl %edx, %edx
|
|
|
|
jg L(crosspage)
|
|
|
|
L(loop):
|
|
|
|
movdqu (%esi,%edx), %xmm2
|
|
|
|
movdqu (%edi,%edx), %xmm1
|
2011-11-14 23:24:35 +00:00
|
|
|
TOLOWER (%xmm2, %xmm1)
|
2010-02-15 19:17:50 +00:00
|
|
|
pcmpistri $0x1a, %xmm2, %xmm1
|
|
|
|
jbe L(end)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
sub $16, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
jbe L(more16byteseq)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
add $16, %edx
|
|
|
|
jle L(loop)
|
|
|
|
L(crosspage):
|
|
|
|
movzbl (%edi,%edx), %eax
|
2011-11-14 23:24:35 +00:00
|
|
|
movzbl (%esi,%edx), %ecx
|
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%eax,4), %eax
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%eax,4), %eax
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
subl %ecx, %eax
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(ret)
|
2011-11-14 23:24:35 +00:00
|
|
|
testl %ecx, %ecx
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(ret)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
sub $1, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
jbe L(more16byteseq)
|
|
|
|
#endif
|
|
|
|
inc %edx
|
|
|
|
cmp $15, %edx
|
|
|
|
jle L(crosspage)
|
2010-04-15 14:49:30 +00:00
|
|
|
add %edx, %edi
|
|
|
|
add %edx, %esi
|
2010-02-15 19:17:50 +00:00
|
|
|
jmp L(check_offset)
|
|
|
|
|
2010-02-18 06:27:41 +00:00
|
|
|
.p2align 4
|
2010-02-15 19:17:50 +00:00
|
|
|
L(end):
|
|
|
|
jnc L(ret)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
sub %ecx, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
jbe L(more16byteseq)
|
|
|
|
#endif
|
2011-11-14 23:24:35 +00:00
|
|
|
lea (%ecx,%edx), %ecx
|
|
|
|
movzbl (%edi,%ecx), %eax
|
|
|
|
movzbl (%esi,%ecx), %ecx
|
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%eax,4), %eax
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%eax,4), %eax
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
# endif
|
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
subl %ecx, %eax
|
|
|
|
L(ret):
|
|
|
|
POP (%esi)
|
|
|
|
POP (%edi)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
POP (REM)
|
|
|
|
#endif
|
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
# ifdef PIC
|
2010-02-15 19:17:50 +00:00
|
|
|
POP (%ebx)
|
2011-11-14 23:24:35 +00:00
|
|
|
# endif
|
2010-02-15 19:17:50 +00:00
|
|
|
#endif
|
|
|
|
ret
|
|
|
|
|
2010-02-18 06:27:41 +00:00
|
|
|
.p2align 4
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
2010-02-27 03:54:50 +00:00
|
|
|
cfi_restore_state
|
2010-02-15 19:17:50 +00:00
|
|
|
L(more16byteseq):
|
|
|
|
POP (%esi)
|
2011-11-14 23:24:35 +00:00
|
|
|
# ifdef USE_AS_STRNCMP
|
2010-02-15 19:17:50 +00:00
|
|
|
POP (%edi)
|
2011-11-14 23:24:35 +00:00
|
|
|
# endif
|
2010-02-15 19:17:50 +00:00
|
|
|
#endif
|
|
|
|
L(eq):
|
|
|
|
xorl %eax, %eax
|
2010-02-18 06:27:41 +00:00
|
|
|
RETURN
|
2010-02-15 21:04:54 +00:00
|
|
|
|
2010-02-15 19:17:50 +00:00
|
|
|
L(neq):
|
|
|
|
mov $1, %eax
|
|
|
|
ja L(neq_bigger)
|
|
|
|
neg %eax
|
|
|
|
L(neq_bigger):
|
2010-02-18 06:27:41 +00:00
|
|
|
RETURN
|
|
|
|
|
2010-02-15 19:17:50 +00:00
|
|
|
L(less16bytes):
|
|
|
|
add $0xfefefeff, %ecx
|
|
|
|
jnc L(less4bytes)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movd %xmm3, %edi
|
|
|
|
xor %edi, %ecx
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
xor (%edx), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
or $0xfefefeff, %ecx
|
|
|
|
add $1, %ecx
|
|
|
|
jnz L(less4bytes)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $4, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
jbe L(eq)
|
|
|
|
#endif
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
psrldq $4, %xmm3
|
|
|
|
psrldq $4, %xmm4
|
|
|
|
movd %xmm3, %ecx
|
|
|
|
movd %xmm4, %edi
|
|
|
|
cmp %edi, %ecx
|
|
|
|
mov %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
mov 4(%edx), %ecx
|
|
|
|
cmp 4(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(more4bytes)
|
|
|
|
add $0xfefefeff, %ecx
|
|
|
|
jnc L(more4bytes)
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
xor %edi, %ecx
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
xor 4(%edx), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
or $0xfefefeff, %ecx
|
|
|
|
add $1, %ecx
|
|
|
|
jnz L(more4bytes)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
sub $8, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
jbe L(eq)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
add $8, %edx
|
|
|
|
add $8, %eax
|
|
|
|
L(less4bytes):
|
|
|
|
|
|
|
|
movzbl (%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl (%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, (%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $1, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 1(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 1(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 1(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $2, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
movzbl 2(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 2(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 2(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $3, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 3(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 3(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 3(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
|
|
|
L(more4bytes):
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $4, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 4(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 4(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 4(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $5, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 5(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 5(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 5(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $6, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 6(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 6(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 6(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
|
|
|
cmpl $0, %ecx
|
|
|
|
je L(eq)
|
|
|
|
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
|
|
|
|
cmp $7, REM
|
2010-02-15 19:17:50 +00:00
|
|
|
je L(eq)
|
|
|
|
#endif
|
|
|
|
movzbl 7(%eax), %ecx
|
2011-11-14 23:24:35 +00:00
|
|
|
#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
|
|
|
|
movzbl 7(%edx), %edi
|
|
|
|
# ifdef PIC
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower@GOTOFF+128*4(%ebx,%edi,4), %edi
|
|
|
|
# else
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%ecx,4), %ecx
|
|
|
|
movl _nl_C_LC_CTYPE_tolower+128*4(,%edi,4), %edi
|
|
|
|
# endif
|
|
|
|
cmpl %ecx, %edi
|
|
|
|
#else
|
2010-02-15 19:17:50 +00:00
|
|
|
cmpb %cl, 7(%edx)
|
2011-11-14 23:24:35 +00:00
|
|
|
#endif
|
2010-02-15 19:17:50 +00:00
|
|
|
jne L(neq)
|
2010-02-15 21:04:54 +00:00
|
|
|
jmp L(eq)
|
2010-02-15 19:17:50 +00:00
|
|
|
|
|
|
|
END (STRCMP)
|
|
|
|
|
|
|
|
#endif
|