Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / x86_64 / multiarch / memmove.c
blobd93bfd05c0b1125c4bcf442250c46f4e010dd193
1 /* Multiple versions of memmove.
2 All versions must be listed in ifunc-impl-list.c.
3 Copyright (C) 2010-2015 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 #if IS_IN (libc)
21 # define MEMMOVE __memmove_sse2
22 # ifdef SHARED
23 # undef libc_hidden_builtin_def
24 # define libc_hidden_builtin_def(name) \
25 __hidden_ver1 (__memmove_sse2, __GI_memmove, __memmove_sse2);
26 # endif
28 /* Redefine memmove so that the compiler won't complain about the type
29 mismatch with the IFUNC selector in strong_alias, below. */
30 # undef memmove
31 # define memmove __redirect_memmove
32 # include <string.h>
33 # undef memmove
35 extern __typeof (__redirect_memmove) __memmove_sse2 attribute_hidden;
36 extern __typeof (__redirect_memmove) __memmove_ssse3 attribute_hidden;
37 extern __typeof (__redirect_memmove) __memmove_ssse3_back attribute_hidden;
38 extern __typeof (__redirect_memmove) __memmove_avx_unaligned attribute_hidden;
40 #endif
42 #include "string/memmove.c"
44 #if IS_IN (libc)
45 # include <shlib-compat.h>
46 # include "init-arch.h"
48 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
49 ifunc symbol properly. */
50 extern __typeof (__redirect_memmove) __libc_memmove;
51 libc_ifunc (__libc_memmove,
52 HAS_AVX
53 ? __memmove_avx_unaligned
54 : (HAS_SSSE3
55 ? (HAS_FAST_COPY_BACKWARD
56 ? __memmove_ssse3_back : __memmove_ssse3)
57 : __memmove_sse2));
59 strong_alias (__libc_memmove, memmove)
61 # if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
62 compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
63 # endif
64 #endif