Update copyright notices with scripts/update-copyrights.
[glibc.git] / sysdeps / x86_64 / multiarch / strcasestr-nonascii.c
blob85b7b35753ca6993d41874a6bdc131b414dc6e57
1 /* strstr with SSE4.2 intrinsics
2 Copyright (C) 2010-2013 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #include <ctype.h>
20 #include <xmmintrin.h>
23 /* Similar to __m128i_strloadu. Convert to lower case for none-POSIX/C
24 locale. */
25 static inline __m128i
26 __m128i_strloadu_tolower (const unsigned char *p)
28 union
30 char b[16];
31 __m128i x;
32 } u;
34 for (int i = 0; i < 16; ++i)
35 if (p[i] == 0)
37 u.b[i] = 0;
38 break;
40 else
41 u.b[i] = tolower (p[i]);
43 return u.x;
47 #define STRCASESTR_NONASCII
48 #define USE_AS_STRCASESTR
49 #define STRSTR_SSE42 __strcasestr_sse42_nonascii
50 #include "strstr.c"