Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / x86_64 / multiarch / memmove.c
blobba86e7bbb1cf50c85938f2cac5e4d0d17536e848
1 /* Multiple versions of memmove.
2 All versions must be listed in ifunc-impl-list.c.
3 Copyright (C) 2010-2014 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 #ifndef NOT_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 #endif
40 #include "string/memmove.c"
42 #ifndef NOT_IN_libc
43 # include <shlib-compat.h>
44 # include "init-arch.h"
46 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
47 ifunc symbol properly. */
48 extern __typeof (__redirect_memmove) __libc_memmove;
49 libc_ifunc (__libc_memmove,
50 HAS_SSSE3
51 ? (HAS_FAST_COPY_BACKWARD
52 ? __memmove_ssse3_back : __memmove_ssse3)
53 : __memmove_sse2)
55 strong_alias (__libc_memmove, memmove)
57 # if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
58 compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
59 # endif
60 #endif