]>
Commit | Line | Data |
---|---|---|
3af48cbd | 1 | /* Multiple versions of mempcpy |
b090e8ea | 2 | All versions must be listed in ifunc-impl-list.c. |
f7a9f785 | 3 | Copyright (C) 2010-2016 Free Software Foundation, Inc. |
3af48cbd L |
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 | |
59ba27a6 PE |
18 | License along with the GNU C Library; if not, see |
19 | <http://www.gnu.org/licenses/>. */ | |
3af48cbd L |
20 | |
21 | #include <sysdep.h> | |
22 | #include <init-arch.h> | |
23 | ||
24 | /* Define multiple versions only for the definition in lib and for | |
25 | DSO. In static binaries we need mempcpy before the initialization | |
26 | happened. */ | |
4f41c682 | 27 | #if defined SHARED && IS_IN (libc) |
3af48cbd L |
28 | .text |
29 | ENTRY(__mempcpy) | |
30 | .type __mempcpy, @gnu_indirect_function | |
1aee37a2 L |
31 | LOAD_GOT_AND_RTLD_GLOBAL_RO |
32 | LOAD_FUNC_GOT_EAX (__mempcpy_ia32) | |
33 | HAS_CPU_FEATURE (SSE2) | |
8b4416d8 | 34 | jz 2f |
1aee37a2 L |
35 | LOAD_FUNC_GOT_EAX (__mempcpy_sse2_unaligned) |
36 | HAS_ARCH_FEATURE (Fast_Unaligned_Load) | |
8b4416d8 | 37 | jnz 2f |
1aee37a2 | 38 | HAS_CPU_FEATURE (SSSE3) |
3af48cbd | 39 | jz 2f |
1aee37a2 L |
40 | LOAD_FUNC_GOT_EAX (__mempcpy_ssse3) |
41 | HAS_CPU_FEATURE (Fast_Rep_String) | |
3af48cbd | 42 | jz 2f |
1aee37a2 L |
43 | LOAD_FUNC_GOT_EAX (__mempcpy_ssse3_rep) |
44 | 2: ret | |
3af48cbd L |
45 | END(__mempcpy) |
46 | ||
47 | # undef ENTRY | |
48 | # define ENTRY(name) \ | |
49 | .type __mempcpy_ia32, @function; \ | |
50 | .p2align 4; \ | |
b090e8ea L |
51 | .globl __mempcpy_ia32; \ |
52 | .hidden __mempcpy_ia32; \ | |
3af48cbd L |
53 | __mempcpy_ia32: cfi_startproc; \ |
54 | CALL_MCOUNT | |
55 | # undef END | |
56 | # define END(name) \ | |
57 | cfi_endproc; .size __mempcpy_ia32, .-__mempcpy_ia32 | |
58 | ||
59 | # undef ENTRY_CHK | |
60 | # define ENTRY_CHK(name) \ | |
61 | .type __mempcpy_chk_ia32, @function; \ | |
62 | .globl __mempcpy_chk_ia32; \ | |
63 | .p2align 4; \ | |
64 | __mempcpy_chk_ia32: cfi_startproc; \ | |
65 | CALL_MCOUNT | |
66 | # undef END_CHK | |
67 | # define END_CHK(name) \ | |
68 | cfi_endproc; .size __mempcpy_chk_ia32, .-__mempcpy_chk_ia32 | |
69 | ||
70 | # undef libc_hidden_def | |
71 | # undef libc_hidden_builtin_def | |
72 | /* IFUNC doesn't work with the hidden functions in shared library since | |
73 | they will be called without setting up EBX needed for PLT which is | |
74 | used by IFUNC. */ | |
75 | # define libc_hidden_def(name) \ | |
76 | .globl __GI_mempcpy; __GI_mempcpy = __mempcpy_ia32 | |
77 | # define libc_hidden_builtin_def(name) \ | |
78 | .globl __GI___mempcpy; __GI___mempcpy = __mempcpy_ia32 | |
79 | #endif | |
80 | ||
81 | #include "../mempcpy.S" |