nixpkgs/pkgs/development/libraries/glibc-2.12/strncasecmp_sse42.patch

32 lines
958 B
Diff
Raw Normal View History

https://bugzilla.redhat.com/show_bug.cgi?id=651638
2010-11-09 H.J. Lu <hongjiu.lu@intel.com>
[BZ #12205]
* string/test-strncasecmp.c (check_result): New function.
(do_one_test): Use it.
(check1): New function.
(test_main): Use it.
* sysdeps/i386/i686/multiarch/strcmp.S (nibble_ashr_use_sse4_2_exit):
Support strcasecmp and strncasecmp.
diff --git a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S
index 54e5bbc..1859289 100644
--- a/sysdeps/x86_64/multiarch/strcmp.S
+++ b/sysdeps/x86_64/multiarch/strcmp.S
@@ -1809,7 +1809,13 @@ LABEL(nibble_ashr_15_use_sse4_2):
ja LABEL(loop_ashr_15_use_sse4_2)
LABEL(nibble_ashr_use_sse4_2_exit):
+# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+# else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+# endif
.p2align 4
LABEL(use_sse4_2_exit):
jnc LABEL(strcmp_exitz_sse4_2)