about summary refs log tree commit diff
path: root/sysdeps/i386/i686/multiarch/strcmp-sse4.S
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-11-16 09:36:15 +0100
committerAndreas Schwab <schwab@redhat.com>2011-11-16 11:48:10 +0100
commit5583a0862cf94f71cbcde91c4043a20af65facca (patch)
treea65c1c861d8905d334a2f11fc9909e28cc269845 /sysdeps/i386/i686/multiarch/strcmp-sse4.S
parentd62a8200e1523a19c722eab97f54e34079fc3d0e (diff)
downloadglibc-5583a0862cf94f71cbcde91c4043a20af65facca.tar.gz
glibc-5583a0862cf94f71cbcde91c4043a20af65facca.tar.xz
glibc-5583a0862cf94f71cbcde91c4043a20af65facca.zip
Fix SSSE3/SSE4.2 strcasecmp[_l]/strncasecmp[_l] for non-PIC and -mno-tls-direct-seg-refs
Diffstat (limited to 'sysdeps/i386/i686/multiarch/strcmp-sse4.S')
-rw-r--r--sysdeps/i386/i686/multiarch/strcmp-sse4.S40
1 files changed, 34 insertions, 6 deletions
diff --git a/sysdeps/i386/i686/multiarch/strcmp-sse4.S b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
index 1df63e3156..c9e0317b60 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
@@ -48,7 +48,11 @@
 # ifndef STRCMP
 #  define STRCMP	__strcasecmp_l_sse4_2
 # endif
-# define STR1		12
+# ifdef PIC
+#  define STR1		12
+# else
+#  define STR1		8
+# endif
 # define STR2		STR1+4
 # define LOCALE		12	/* Loaded before the adjustement.  */
 # ifdef PIC
@@ -63,7 +67,11 @@
 # ifndef STRCMP
 #  define STRCMP	__strncasecmp_l_sse4_2
 # endif
-# define STR1		16
+# ifdef PIC
+#  define STR1		16
+# else
+#  define STR1		12
+# endif
 # define STR2		STR1+4
 # define CNT		STR2+4
 # define LOCALE		16	/* Loaded before the adjustement.  */
@@ -95,10 +103,20 @@ ENTRY (__strcasecmp_sse4_2)
 	call	__i686.get_pc_thunk.bx
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	movl	__libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
+#  ifdef NO_TLS_DIRECT_SEG_REFS
+	addl	%gs:0, %eax
+	movl	(%eax), %eax
+#  else
+	movl	%gs:(%eax), %eax
+#  endif
 # else
-	movl	__libc_tsd_LOCALE@NTPOFF, %eax
+#  ifdef NO_TLS_DIRECT_SEG_REFS
+	movl	%gs:0, %eax
+	movl	__libc_tsd_LOCALE@NTPOFF(%eax), %eax
+#  else
+	movl	%gs:__libc_tsd_LOCALE@NTPOFF, %eax
+#  endif
 # endif
-	movl	%gs:(%eax), %eax
 # if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
 	movl	LOCALE_T___LOCALES+LC_CTYPE*4(%eax), %eax
 # else
@@ -117,10 +135,20 @@ ENTRY (__strncasecmp_sse4_2)
 	call	__i686.get_pc_thunk.bx
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	movl	__libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
+#  ifdef NO_TLS_DIRECT_SEG_REFS
+	addl	%gs:0, %eax
+	movl	(%eax), %eax
+#  else
+	movl	%gs:(%eax), %eax
+#  endif
 # else
-	movl	__libc_tsd_LOCALE@NTPOFF, %eax
+#  ifdef NO_TLS_DIRECT_SEG_REFS
+	movl	%gs:0, %eax
+	movl	__libc_tsd_LOCALE@NTPOFF(%eax), %eax
+#  else
+	movl	%gs:__libc_tsd_LOCALE@NTPOFF, %eax
+#  endif
 # endif
-	movl	%gs:(%eax), %eax
 # if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
 	movl	LOCALE_T___LOCALES+LC_CTYPE*4(%eax), %eax
 # else