mirror of git://sourceware.org/git/glibc.git
x86: Rename generic functions with unique postfix for clarity
No functions are changed. It just renames generic implementations from '{func}_sse2' to '{func}_generic'. This is just because the postfix "_sse2" was overloaded and was used for files that had hand-optimized sse2 assembly implementations and files that just redirected back to the generic implementation. Full xcheck passed on x86_64.
This commit is contained in:
parent
8da9f346cb
commit
c22eb807b0
|
@ -43,7 +43,7 @@ sysdep_routines += \
|
||||||
stpcpy-sse2-unaligned \
|
stpcpy-sse2-unaligned \
|
||||||
stpncpy-avx2 \
|
stpncpy-avx2 \
|
||||||
stpncpy-avx2-rtm \
|
stpncpy-avx2-rtm \
|
||||||
stpncpy-c \
|
stpncpy-generic \
|
||||||
stpncpy-evex \
|
stpncpy-evex \
|
||||||
stpncpy-sse2-unaligned \
|
stpncpy-sse2-unaligned \
|
||||||
strcasecmp_l-avx2 \
|
strcasecmp_l-avx2 \
|
||||||
|
@ -76,8 +76,8 @@ sysdep_routines += \
|
||||||
strcpy-evex \
|
strcpy-evex \
|
||||||
strcpy-sse2 \
|
strcpy-sse2 \
|
||||||
strcpy-sse2-unaligned \
|
strcpy-sse2-unaligned \
|
||||||
strcspn-c \
|
strcspn-generic \
|
||||||
strcspn-sse2 \
|
strcspn-sse4 \
|
||||||
strlen-avx2 \
|
strlen-avx2 \
|
||||||
strlen-avx2-rtm \
|
strlen-avx2-rtm \
|
||||||
strlen-evex \
|
strlen-evex \
|
||||||
|
@ -90,7 +90,7 @@ sysdep_routines += \
|
||||||
strncase_l-sse4_2 \
|
strncase_l-sse4_2 \
|
||||||
strncat-avx2 \
|
strncat-avx2 \
|
||||||
strncat-avx2-rtm \
|
strncat-avx2-rtm \
|
||||||
strncat-c \
|
strncat-generic \
|
||||||
strncat-evex \
|
strncat-evex \
|
||||||
strncat-sse2-unaligned \
|
strncat-sse2-unaligned \
|
||||||
strncmp-avx2 \
|
strncmp-avx2 \
|
||||||
|
@ -100,7 +100,7 @@ sysdep_routines += \
|
||||||
strncmp-sse4_2 \
|
strncmp-sse4_2 \
|
||||||
strncpy-avx2 \
|
strncpy-avx2 \
|
||||||
strncpy-avx2-rtm \
|
strncpy-avx2-rtm \
|
||||||
strncpy-c \
|
strncpy-generic \
|
||||||
strncpy-evex \
|
strncpy-evex \
|
||||||
strncpy-sse2-unaligned \
|
strncpy-sse2-unaligned \
|
||||||
strnlen-avx2 \
|
strnlen-avx2 \
|
||||||
|
@ -108,22 +108,23 @@ sysdep_routines += \
|
||||||
strnlen-evex \
|
strnlen-evex \
|
||||||
strnlen-evex512 \
|
strnlen-evex512 \
|
||||||
strnlen-sse2 \
|
strnlen-sse2 \
|
||||||
strpbrk-c \
|
strpbrk-generic \
|
||||||
strpbrk-sse2 \
|
strpbrk-sse4 \
|
||||||
strrchr-avx2 \
|
strrchr-avx2 \
|
||||||
strrchr-avx2-rtm \
|
strrchr-avx2-rtm \
|
||||||
strrchr-evex \
|
strrchr-evex \
|
||||||
strrchr-sse2 \
|
strrchr-sse2 \
|
||||||
strspn-c \
|
strspn-generic \
|
||||||
strspn-sse2 \
|
strspn-sse4 \
|
||||||
strstr-avx512 \
|
strstr-avx512 \
|
||||||
strstr-sse2-unaligned \
|
strstr-sse2-unaligned \
|
||||||
varshift \
|
varshift \
|
||||||
# sysdep_routines
|
# sysdep_routines
|
||||||
CFLAGS-varshift.c += -msse4
|
|
||||||
CFLAGS-strcspn-c.c += -msse4
|
CFLAGS-strcspn-sse4.c += -msse4
|
||||||
CFLAGS-strpbrk-c.c += -msse4
|
CFLAGS-strpbrk-sse4.c += -msse4
|
||||||
CFLAGS-strspn-c.c += -msse4
|
CFLAGS-strspn-sse4.c += -msse4
|
||||||
|
|
||||||
CFLAGS-strstr-avx512.c += -mavx512f -mavx512vl -mavx512dq -mavx512bw -mbmi -mbmi2 -O3
|
CFLAGS-strstr-avx512.c += -mavx512f -mavx512vl -mavx512dq -mavx512bw -mbmi -mbmi2 -O3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -137,7 +138,7 @@ sysdep_routines += \
|
||||||
wcscmp-avx2-rtm \
|
wcscmp-avx2-rtm \
|
||||||
wcscmp-evex \
|
wcscmp-evex \
|
||||||
wcscmp-sse2 \
|
wcscmp-sse2 \
|
||||||
wcscpy-c \
|
wcscpy-generic \
|
||||||
wcscpy-ssse3 \
|
wcscpy-ssse3 \
|
||||||
wcslen-avx2 \
|
wcslen-avx2 \
|
||||||
wcslen-avx2-rtm \
|
wcslen-avx2-rtm \
|
||||||
|
@ -147,11 +148,11 @@ sysdep_routines += \
|
||||||
wcslen-sse4_1 \
|
wcslen-sse4_1 \
|
||||||
wcsncmp-avx2 \
|
wcsncmp-avx2 \
|
||||||
wcsncmp-avx2-rtm \
|
wcsncmp-avx2-rtm \
|
||||||
|
wcsncmp-generic \
|
||||||
wcsncmp-evex \
|
wcsncmp-evex \
|
||||||
wcsncmp-sse2 \
|
|
||||||
wcsnlen-avx2 \
|
wcsnlen-avx2 \
|
||||||
wcsnlen-avx2-rtm \
|
wcsnlen-avx2-rtm \
|
||||||
wcsnlen-c \
|
wcsnlen-generic \
|
||||||
wcsnlen-evex \
|
wcsnlen-evex \
|
||||||
wcsnlen-evex512 \
|
wcsnlen-evex512 \
|
||||||
wcsnlen-sse4_1 \
|
wcsnlen-sse4_1 \
|
||||||
|
|
|
@ -19,7 +19,11 @@
|
||||||
|
|
||||||
#include <init-arch.h>
|
#include <init-arch.h>
|
||||||
|
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
|
#ifndef GENERIC
|
||||||
|
# define GENERIC sse2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (GENERIC) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_rtm) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_rtm) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (evex) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (evex) attribute_hidden;
|
||||||
|
@ -44,5 +48,5 @@ IFUNC_SELECTOR (void)
|
||||||
return OPTIMIZE (avx2);
|
return OPTIMIZE (avx2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return OPTIMIZE (sse2);
|
return OPTIMIZE (GENERIC);
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,7 +367,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||||
__stpncpy_evex)
|
__stpncpy_evex)
|
||||||
IFUNC_IMPL_ADD (array, i, stpncpy, 1,
|
IFUNC_IMPL_ADD (array, i, stpncpy, 1,
|
||||||
__stpncpy_sse2_unaligned)
|
__stpncpy_sse2_unaligned)
|
||||||
IFUNC_IMPL_ADD (array, i, stpncpy, 1, __stpncpy_sse2))
|
IFUNC_IMPL_ADD (array, i, stpncpy, 1, __stpncpy_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/stpcpy.c. */
|
/* Support sysdeps/x86_64/multiarch/stpcpy.c. */
|
||||||
IFUNC_IMPL (i, name, stpcpy,
|
IFUNC_IMPL (i, name, stpcpy,
|
||||||
|
@ -526,7 +526,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||||
IFUNC_IMPL (i, name, strcspn,
|
IFUNC_IMPL (i, name, strcspn,
|
||||||
IFUNC_IMPL_ADD (array, i, strcspn, CPU_FEATURE_USABLE (SSE4_2),
|
IFUNC_IMPL_ADD (array, i, strcspn, CPU_FEATURE_USABLE (SSE4_2),
|
||||||
__strcspn_sse42)
|
__strcspn_sse42)
|
||||||
IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_sse2))
|
IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/strncase_l.c. */
|
/* Support sysdeps/x86_64/multiarch/strncase_l.c. */
|
||||||
IFUNC_IMPL (i, name, strncasecmp,
|
IFUNC_IMPL (i, name, strncasecmp,
|
||||||
|
@ -580,7 +580,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||||
__strncat_evex)
|
__strncat_evex)
|
||||||
IFUNC_IMPL_ADD (array, i, strncat, 1,
|
IFUNC_IMPL_ADD (array, i, strncat, 1,
|
||||||
__strncat_sse2_unaligned)
|
__strncat_sse2_unaligned)
|
||||||
IFUNC_IMPL_ADD (array, i, strncat, 1, __strncat_sse2))
|
IFUNC_IMPL_ADD (array, i, strncat, 1, __strncat_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/strncpy.c. */
|
/* Support sysdeps/x86_64/multiarch/strncpy.c. */
|
||||||
IFUNC_IMPL (i, name, strncpy,
|
IFUNC_IMPL (i, name, strncpy,
|
||||||
|
@ -596,20 +596,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||||
__strncpy_evex)
|
__strncpy_evex)
|
||||||
IFUNC_IMPL_ADD (array, i, strncpy, 1,
|
IFUNC_IMPL_ADD (array, i, strncpy, 1,
|
||||||
__strncpy_sse2_unaligned)
|
__strncpy_sse2_unaligned)
|
||||||
IFUNC_IMPL_ADD (array, i, strncpy, 1, __strncpy_sse2))
|
IFUNC_IMPL_ADD (array, i, strncpy, 1, __strncpy_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/strpbrk.c. */
|
/* Support sysdeps/x86_64/multiarch/strpbrk.c. */
|
||||||
IFUNC_IMPL (i, name, strpbrk,
|
IFUNC_IMPL (i, name, strpbrk,
|
||||||
IFUNC_IMPL_ADD (array, i, strpbrk, CPU_FEATURE_USABLE (SSE4_2),
|
IFUNC_IMPL_ADD (array, i, strpbrk, CPU_FEATURE_USABLE (SSE4_2),
|
||||||
__strpbrk_sse42)
|
__strpbrk_sse42)
|
||||||
IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_sse2))
|
IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_generic))
|
||||||
|
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/strspn.c. */
|
/* Support sysdeps/x86_64/multiarch/strspn.c. */
|
||||||
IFUNC_IMPL (i, name, strspn,
|
IFUNC_IMPL (i, name, strspn,
|
||||||
IFUNC_IMPL_ADD (array, i, strspn, CPU_FEATURE_USABLE (SSE4_2),
|
IFUNC_IMPL_ADD (array, i, strspn, CPU_FEATURE_USABLE (SSE4_2),
|
||||||
__strspn_sse42)
|
__strspn_sse42)
|
||||||
IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_sse2))
|
IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/strstr.c. */
|
/* Support sysdeps/x86_64/multiarch/strstr.c. */
|
||||||
IFUNC_IMPL (i, name, strstr,
|
IFUNC_IMPL (i, name, strstr,
|
||||||
|
@ -686,13 +686,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||||
&& CPU_FEATURE_USABLE (AVX512BW)
|
&& CPU_FEATURE_USABLE (AVX512BW)
|
||||||
&& CPU_FEATURE_USABLE (BMI2)),
|
&& CPU_FEATURE_USABLE (BMI2)),
|
||||||
__wcsncmp_evex)
|
__wcsncmp_evex)
|
||||||
IFUNC_IMPL_ADD (array, i, wcsncmp, 1, __wcsncmp_sse2))
|
IFUNC_IMPL_ADD (array, i, wcsncmp, 1, __wcsncmp_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/wcscpy.c. */
|
/* Support sysdeps/x86_64/multiarch/wcscpy.c. */
|
||||||
IFUNC_IMPL (i, name, wcscpy,
|
IFUNC_IMPL (i, name, wcscpy,
|
||||||
IFUNC_IMPL_ADD (array, i, wcscpy, CPU_FEATURE_USABLE (SSSE3),
|
IFUNC_IMPL_ADD (array, i, wcscpy, CPU_FEATURE_USABLE (SSSE3),
|
||||||
__wcscpy_ssse3)
|
__wcscpy_ssse3)
|
||||||
IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_sse2))
|
IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/wcslen.c. */
|
/* Support sysdeps/x86_64/multiarch/wcslen.c. */
|
||||||
IFUNC_IMPL (i, name, wcslen,
|
IFUNC_IMPL (i, name, wcslen,
|
||||||
|
@ -744,7 +744,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||||
IFUNC_IMPL_ADD (array, i, wcsnlen,
|
IFUNC_IMPL_ADD (array, i, wcsnlen,
|
||||||
CPU_FEATURE_USABLE (SSE4_1),
|
CPU_FEATURE_USABLE (SSE4_1),
|
||||||
__wcsnlen_sse4_1)
|
__wcsnlen_sse4_1)
|
||||||
IFUNC_IMPL_ADD (array, i, wcsnlen, 1, __wcsnlen_sse2))
|
IFUNC_IMPL_ADD (array, i, wcsnlen, 1, __wcsnlen_generic))
|
||||||
|
|
||||||
/* Support sysdeps/x86_64/multiarch/wmemchr.c. */
|
/* Support sysdeps/x86_64/multiarch/wmemchr.c. */
|
||||||
IFUNC_IMPL (i, name, wmemchr,
|
IFUNC_IMPL (i, name, wmemchr,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <init-arch.h>
|
#include <init-arch.h>
|
||||||
|
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (generic) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden;
|
||||||
|
|
||||||
static inline void *
|
static inline void *
|
||||||
|
@ -30,5 +30,5 @@ IFUNC_SELECTOR (void)
|
||||||
if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2))
|
if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2))
|
||||||
return OPTIMIZE (sse42);
|
return OPTIMIZE (sse42);
|
||||||
|
|
||||||
return OPTIMIZE (sse2);
|
return OPTIMIZE (generic);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,11 @@
|
||||||
|
|
||||||
#include <init-arch.h>
|
#include <init-arch.h>
|
||||||
|
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
|
#ifndef GENERIC
|
||||||
|
# define GENERIC sse2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (GENERIC) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned)
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned)
|
||||||
attribute_hidden;
|
attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
|
||||||
|
@ -49,5 +53,5 @@ IFUNC_SELECTOR (void)
|
||||||
if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Load))
|
if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Load))
|
||||||
return OPTIMIZE (sse2_unaligned);
|
return OPTIMIZE (sse2_unaligned);
|
||||||
|
|
||||||
return OPTIMIZE (sse2);
|
return OPTIMIZE (GENERIC);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,11 @@
|
||||||
|
|
||||||
#include <init-arch.h>
|
#include <init-arch.h>
|
||||||
|
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
|
#ifndef GENERIC
|
||||||
|
# define GENERIC sse2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (GENERIC) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_1) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_1) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_rtm) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_rtm) attribute_hidden;
|
||||||
|
@ -48,5 +52,5 @@ IFUNC_SELECTOR (void)
|
||||||
if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_1))
|
if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_1))
|
||||||
return OPTIMIZE (sse4_1);
|
return OPTIMIZE (sse4_1);
|
||||||
|
|
||||||
return OPTIMIZE (sse2);
|
return OPTIMIZE (GENERIC);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#define STPNCPY __stpncpy_sse2
|
|
||||||
#undef weak_alias
|
|
||||||
#define weak_alias(ignored1, ignored2)
|
|
||||||
#undef libc_hidden_def
|
|
||||||
#define libc_hidden_def(stpncpy)
|
|
||||||
|
|
||||||
#include <string/stpncpy.c>
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/* stpncpy.
|
||||||
|
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||||
|
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
|
||||||
|
License along with the GNU C Library; if not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
#define STPNCPY __stpncpy_generic
|
||||||
|
#undef weak_alias
|
||||||
|
#define weak_alias(ignored1, ignored2)
|
||||||
|
#undef libc_hidden_def
|
||||||
|
#define libc_hidden_def(stpncpy)
|
||||||
|
|
||||||
|
#include <string/stpncpy.c>
|
|
@ -25,6 +25,7 @@
|
||||||
# undef stpncpy
|
# undef stpncpy
|
||||||
# undef __stpncpy
|
# undef __stpncpy
|
||||||
|
|
||||||
|
# define GENERIC generic
|
||||||
# define SYMBOL_NAME stpncpy
|
# define SYMBOL_NAME stpncpy
|
||||||
# include "ifunc-strcpy.h"
|
# include "ifunc-strcpy.h"
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#if IS_IN (libc)
|
#if IS_IN (libc)
|
||||||
|
|
||||||
# include <sysdep.h>
|
# include <sysdep.h>
|
||||||
# define STRCSPN __strcspn_sse2
|
# define STRCSPN __strcspn_generic
|
||||||
|
|
||||||
# undef libc_hidden_builtin_def
|
# undef libc_hidden_builtin_def
|
||||||
# define libc_hidden_builtin_def(STRCSPN)
|
# define libc_hidden_builtin_def(STRCSPN)
|
|
@ -52,8 +52,8 @@
|
||||||
when either CFlag or ZFlag is 1. If CFlag == 1, ECX has the offset
|
when either CFlag or ZFlag is 1. If CFlag == 1, ECX has the offset
|
||||||
X for case 1. */
|
X for case 1. */
|
||||||
|
|
||||||
#ifndef STRCSPN_SSE2
|
#ifndef STRCSPN_GENERIC
|
||||||
# define STRCSPN_SSE2 __strcspn_sse2
|
# define STRCSPN_GENERIC __strcspn_generic
|
||||||
# define STRCSPN_SSE42 __strcspn_sse42
|
# define STRCSPN_SSE42 __strcspn_sse42
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ char *
|
||||||
#else
|
#else
|
||||||
size_t
|
size_t
|
||||||
#endif
|
#endif
|
||||||
STRCSPN_SSE2 (const char *, const char *) attribute_hidden;
|
STRCSPN_GENERIC (const char *, const char *) attribute_hidden;
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_AS_STRPBRK
|
#ifdef USE_AS_STRPBRK
|
||||||
|
@ -119,7 +119,7 @@ STRCSPN_SSE42 (const char *s, const char *a)
|
||||||
/* There is no NULL terminator. Don't use SSE4.2 if the length
|
/* There is no NULL terminator. Don't use SSE4.2 if the length
|
||||||
of A > 16. */
|
of A > 16. */
|
||||||
if (a[16] != 0)
|
if (a[16] != 0)
|
||||||
return STRCSPN_SSE2 (s, a);
|
return STRCSPN_GENERIC (s, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
aligned = s;
|
aligned = s;
|
|
@ -1,2 +0,0 @@
|
||||||
#define STRNCAT __strncat_sse2
|
|
||||||
#include <string/strncat.c>
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
/* strncat.
|
||||||
|
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||||
|
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
|
||||||
|
License along with the GNU C Library; if not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
#define STRNCAT __strncat_generic
|
||||||
|
#include <string/strncat.c>
|
|
@ -24,6 +24,7 @@
|
||||||
# undef strncat
|
# undef strncat
|
||||||
|
|
||||||
# define SYMBOL_NAME strncat
|
# define SYMBOL_NAME strncat
|
||||||
|
# define GENERIC generic
|
||||||
# include "ifunc-strcpy.h"
|
# include "ifunc-strcpy.h"
|
||||||
|
|
||||||
libc_ifunc_redirected (__redirect_strncat, strncat, IFUNC_SELECTOR ());
|
libc_ifunc_redirected (__redirect_strncat, strncat, IFUNC_SELECTOR ());
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#define STRNCPY __strncpy_sse2
|
|
||||||
#undef libc_hidden_builtin_def
|
|
||||||
#define libc_hidden_builtin_def(strncpy)
|
|
||||||
|
|
||||||
#include <string/strncpy.c>
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/* strncpy.
|
||||||
|
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||||
|
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
|
||||||
|
License along with the GNU C Library; if not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
#define STRNCPY __strncpy_generic
|
||||||
|
#undef libc_hidden_builtin_def
|
||||||
|
#define libc_hidden_builtin_def(strncpy)
|
||||||
|
|
||||||
|
#include <string/strncpy.c>
|
|
@ -24,6 +24,7 @@
|
||||||
# undef strncpy
|
# undef strncpy
|
||||||
|
|
||||||
# define SYMBOL_NAME strncpy
|
# define SYMBOL_NAME strncpy
|
||||||
|
# define GENERIC generic
|
||||||
# include "ifunc-strcpy.h"
|
# include "ifunc-strcpy.h"
|
||||||
|
|
||||||
libc_ifunc_redirected (__redirect_strncpy, strncpy, IFUNC_SELECTOR ());
|
libc_ifunc_redirected (__redirect_strncpy, strncpy, IFUNC_SELECTOR ());
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#if IS_IN (libc)
|
#if IS_IN (libc)
|
||||||
|
|
||||||
# include <sysdep.h>
|
# include <sysdep.h>
|
||||||
# define STRPBRK __strpbrk_sse2
|
# define STRPBRK __strpbrk_generic
|
||||||
|
|
||||||
# undef libc_hidden_builtin_def
|
# undef libc_hidden_builtin_def
|
||||||
# define libc_hidden_builtin_def(STRPBRK)
|
# define libc_hidden_builtin_def(STRPBRK)
|
|
@ -17,6 +17,6 @@
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#define USE_AS_STRPBRK
|
#define USE_AS_STRPBRK
|
||||||
#define STRCSPN_SSE2 __strpbrk_sse2
|
#define STRCSPN_GENERIC __strpbrk_generic
|
||||||
#define STRCSPN_SSE42 __strpbrk_sse42
|
#define STRCSPN_SSE42 __strpbrk_sse42
|
||||||
#include "strcspn-c.c"
|
#include "strcspn-sse4.c"
|
|
@ -19,7 +19,7 @@
|
||||||
#if IS_IN (libc)
|
#if IS_IN (libc)
|
||||||
|
|
||||||
# include <sysdep.h>
|
# include <sysdep.h>
|
||||||
# define STRSPN __strspn_sse2
|
# define STRSPN __strspn_generic
|
||||||
|
|
||||||
# undef libc_hidden_builtin_def
|
# undef libc_hidden_builtin_def
|
||||||
# define libc_hidden_builtin_def(STRSPN)
|
# define libc_hidden_builtin_def(STRSPN)
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
We exit from the loop for case 1. */
|
We exit from the loop for case 1. */
|
||||||
|
|
||||||
extern size_t __strspn_sse2 (const char *, const char *) attribute_hidden;
|
extern size_t __strspn_generic (const char *, const char *) attribute_hidden;
|
||||||
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
@ -98,7 +98,7 @@ __strspn_sse42 (const char *s, const char *a)
|
||||||
/* There is no NULL terminator. Don't use SSE4.2 if the length
|
/* There is no NULL terminator. Don't use SSE4.2 if the length
|
||||||
of A > 16. */
|
of A > 16. */
|
||||||
if (a[16] != 0)
|
if (a[16] != 0)
|
||||||
return __strspn_sse2 (s, a);
|
return __strspn_generic (s, a);
|
||||||
}
|
}
|
||||||
aligned = s;
|
aligned = s;
|
||||||
offset = (unsigned int) ((size_t) s & 15);
|
offset = (unsigned int) ((size_t) s & 15);
|
|
@ -1,5 +0,0 @@
|
||||||
#if IS_IN (libc)
|
|
||||||
# define WCSCPY __wcscpy_sse2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <wcsmbs/wcscpy.c>
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/* wcscpy.
|
||||||
|
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||||
|
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
|
||||||
|
License along with the GNU C Library; if not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
#if IS_IN (libc)
|
||||||
|
# define WCSCPY __wcscpy_generic
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wcsmbs/wcscpy.c>
|
|
@ -26,7 +26,7 @@
|
||||||
# define SYMBOL_NAME wcscpy
|
# define SYMBOL_NAME wcscpy
|
||||||
# include <init-arch.h>
|
# include <init-arch.h>
|
||||||
|
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (generic) attribute_hidden;
|
||||||
extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
|
extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
|
||||||
|
|
||||||
static inline void *
|
static inline void *
|
||||||
|
@ -37,7 +37,7 @@ IFUNC_SELECTOR (void)
|
||||||
if (CPU_FEATURE_USABLE_P (cpu_features, SSSE3))
|
if (CPU_FEATURE_USABLE_P (cpu_features, SSSE3))
|
||||||
return OPTIMIZE (ssse3);
|
return OPTIMIZE (ssse3);
|
||||||
|
|
||||||
return OPTIMIZE (sse2);
|
return OPTIMIZE (generic);
|
||||||
}
|
}
|
||||||
|
|
||||||
libc_ifunc_redirected (__redirect_wcscpy, __wcscpy, IFUNC_SELECTOR ());
|
libc_ifunc_redirected (__redirect_wcscpy, __wcscpy, IFUNC_SELECTOR ());
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* wcsncmp optimized with SSE2.
|
/* wcsncmp.
|
||||||
Copyright (C) 2018-2022 Free Software Foundation, Inc.
|
Copyright (C) 2018-2022 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
@ -16,5 +16,5 @@
|
||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#define WCSNCMP __wcsncmp_sse2
|
#define WCSNCMP __wcsncmp_generic
|
||||||
#include <wcsmbs/wcsncmp.c>
|
#include <wcsmbs/wcsncmp.c>
|
|
@ -24,6 +24,8 @@
|
||||||
# undef wcsncmp
|
# undef wcsncmp
|
||||||
# undef __wcsncmp
|
# undef __wcsncmp
|
||||||
|
|
||||||
|
# define GENERIC generic
|
||||||
|
|
||||||
# define SYMBOL_NAME wcsncmp
|
# define SYMBOL_NAME wcsncmp
|
||||||
# include "ifunc-avx2.h"
|
# include "ifunc-avx2.h"
|
||||||
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
#if IS_IN (libc)
|
|
||||||
# include <wchar.h>
|
|
||||||
|
|
||||||
# define WCSNLEN __wcsnlen_sse2
|
|
||||||
|
|
||||||
extern __typeof (wcsnlen) __wcsnlen_sse2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wcsmbs/wcsnlen.c"
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/* wcsnlen.
|
||||||
|
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||||
|
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
|
||||||
|
License along with the GNU C Library; if not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
#if IS_IN (libc)
|
||||||
|
# include <wchar.h>
|
||||||
|
|
||||||
|
# define WCSNLEN __wcsnlen_generic
|
||||||
|
|
||||||
|
extern __typeof (wcsnlen) __wcsnlen_generic;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wcsmbs/wcsnlen.c"
|
|
@ -24,6 +24,7 @@
|
||||||
# undef __wcsnlen
|
# undef __wcsnlen
|
||||||
|
|
||||||
# define SYMBOL_NAME wcsnlen
|
# define SYMBOL_NAME wcsnlen
|
||||||
|
# define GENERIC generic
|
||||||
# include "ifunc-wcslen.h"
|
# include "ifunc-wcslen.h"
|
||||||
|
|
||||||
libc_ifunc_redirected (__redirect_wcsnlen, __wcsnlen, IFUNC_SELECTOR ());
|
libc_ifunc_redirected (__redirect_wcsnlen, __wcsnlen, IFUNC_SELECTOR ());
|
||||||
|
|
Loading…
Reference in New Issue