]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/i386/i686/multiarch/memmove.S
725a421eab5b2ad670f9329b68356e49fb91de27
[thirdparty/glibc.git] / sysdeps / i386 / i686 / multiarch / memmove.S
1 /* Multiple versions of memmove
2 All versions must be listed in ifunc-impl-list.c.
3 Copyright (C) 2010-2016 Free Software Foundation, Inc.
4 Contributed by Intel Corporation.
5 This file is part of the GNU C Library.
6
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, see
19 <http://www.gnu.org/licenses/>. */
20
21 #include <sysdep.h>
22 #include <init-arch.h>
23
24 /* Define multiple versions only for the definition in lib. */
25 #if IS_IN (libc)
26 .text
27 ENTRY(memmove)
28 .type memmove, @gnu_indirect_function
29 LOAD_GOT_AND_RTLD_GLOBAL_RO
30 LOAD_FUNC_GOT_EAX (__memmove_ia32)
31 HAS_CPU_FEATURE (SSE2)
32 jz 2f
33 LOAD_FUNC_GOT_EAX (__memmove_sse2_unaligned)
34 HAS_ARCH_FEATURE (Fast_Unaligned_Load)
35 jnz 2f
36 HAS_CPU_FEATURE (SSSE3)
37 jz 2f
38 LOAD_FUNC_GOT_EAX (__memmove_ssse3)
39 HAS_ARCH_FEATURE (Fast_Rep_String)
40 jz 2f
41 LOAD_FUNC_GOT_EAX (__memmove_ssse3_rep)
42 2: ret
43 END(memmove)
44
45 # ifdef SHARED
46 # undef ENTRY
47 # define ENTRY(name) \
48 .type __memmove_ia32, @function; \
49 .p2align 4; \
50 .globl __memmove_ia32; \
51 .hidden __memmove_ia32; \
52 __memmove_ia32: cfi_startproc; \
53 CALL_MCOUNT
54 # else
55 # undef ENTRY
56 # define ENTRY(name) \
57 .type __memmove_ia32, @function; \
58 .globl __memmove_ia32; \
59 .p2align 4; \
60 __memmove_ia32: cfi_startproc; \
61 CALL_MCOUNT
62 # endif
63
64 # undef END
65 # define END(name) \
66 cfi_endproc; .size __memmove_ia32, .-__memmove_ia32
67
68 # undef ENTRY_CHK
69 # define ENTRY_CHK(name) \
70 .type __memmove_chk_ia32, @function; \
71 .globl __memmove_chk_ia32; \
72 .p2align 4; \
73 __memmove_chk_ia32: cfi_startproc; \
74 CALL_MCOUNT
75 # undef END_CHK
76 # define END_CHK(name) \
77 cfi_endproc; .size __memmove_chk_ia32, .-__memmove_chk_ia32
78
79 # ifdef SHARED
80 # undef libc_hidden_builtin_def
81 /* IFUNC doesn't work with the hidden functions in shared library since
82 they will be called without setting up EBX needed for PLT which is
83 used by IFUNC. */
84 # define libc_hidden_builtin_def(name) \
85 .globl __GI_memmove; __GI_memmove = __memmove_ia32
86 # endif
87 #endif
88
89 #include "../memmove.S"