2010-08-25 19:13:08 +00:00
|
|
|
/* Multiple versions of memmove.
|
2012-10-10 14:49:12 +00:00
|
|
|
All versions must be listed in ifunc-impl-list.c.
|
2015-01-02 16:28:19 +00:00
|
|
|
Copyright (C) 2010-2015 Free Software Foundation, Inc.
|
2010-08-25 19:13:08 +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
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2010-08-25 19:13:08 +00:00
|
|
|
|
2014-11-24 09:33:45 +00:00
|
|
|
#if IS_IN (libc)
|
2012-08-15 18:26:02 +00:00
|
|
|
# define MEMMOVE __memmove_sse2
|
|
|
|
# ifdef SHARED
|
|
|
|
# undef libc_hidden_builtin_def
|
|
|
|
# define libc_hidden_builtin_def(name) \
|
2010-06-30 15:26:11 +00:00
|
|
|
__hidden_ver1 (__memmove_sse2, __GI_memmove, __memmove_sse2);
|
2012-08-15 18:26:02 +00:00
|
|
|
# endif
|
2010-06-30 15:26:11 +00:00
|
|
|
|
2012-08-09 23:04:37 +00:00
|
|
|
/* Redefine memmove so that the compiler won't complain about the type
|
|
|
|
mismatch with the IFUNC selector in strong_alias, below. */
|
2012-08-15 18:26:02 +00:00
|
|
|
# undef memmove
|
|
|
|
# define memmove __redirect_memmove
|
|
|
|
# include <string.h>
|
|
|
|
# undef memmove
|
|
|
|
|
|
|
|
extern __typeof (__redirect_memmove) __memmove_sse2 attribute_hidden;
|
|
|
|
extern __typeof (__redirect_memmove) __memmove_ssse3 attribute_hidden;
|
|
|
|
extern __typeof (__redirect_memmove) __memmove_ssse3_back attribute_hidden;
|
2014-07-14 04:02:52 +00:00
|
|
|
extern __typeof (__redirect_memmove) __memmove_avx_unaligned attribute_hidden;
|
|
|
|
|
2012-08-09 23:04:37 +00:00
|
|
|
#endif
|
2010-08-25 19:13:08 +00:00
|
|
|
|
2010-06-30 15:26:11 +00:00
|
|
|
#include "string/memmove.c"
|
|
|
|
|
2014-11-24 09:33:45 +00:00
|
|
|
#if IS_IN (libc)
|
2012-08-15 18:26:02 +00:00
|
|
|
# include <shlib-compat.h>
|
|
|
|
# include "init-arch.h"
|
2012-08-09 23:04:37 +00:00
|
|
|
|
|
|
|
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
|
|
|
|
ifunc symbol properly. */
|
|
|
|
extern __typeof (__redirect_memmove) __libc_memmove;
|
|
|
|
libc_ifunc (__libc_memmove,
|
2015-08-13 10:38:47 +00:00
|
|
|
HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
|
2014-07-14 04:02:52 +00:00
|
|
|
? __memmove_avx_unaligned
|
2015-08-13 10:38:47 +00:00
|
|
|
: (HAS_CPU_FEATURE (SSSE3)
|
|
|
|
? (HAS_ARCH_FEATURE (Fast_Copy_Backward)
|
2014-07-14 04:02:52 +00:00
|
|
|
? __memmove_ssse3_back : __memmove_ssse3)
|
|
|
|
: __memmove_sse2));
|
2012-08-09 23:04:37 +00:00
|
|
|
|
|
|
|
strong_alias (__libc_memmove, memmove)
|
2011-04-01 23:38:21 +00:00
|
|
|
|
2012-08-15 18:26:02 +00:00
|
|
|
# if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
|
2011-04-01 23:38:21 +00:00
|
|
|
compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
|
2012-08-15 18:26:02 +00:00
|
|
|
# endif
|
2010-06-30 15:26:11 +00:00
|
|
|
#endif
|