]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/arm/armv7/multiarch/memcpy.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / arm / armv7 / multiarch / memcpy.S
1 /* Multiple versions of memcpy
2 All versions must be listed in ifunc-impl-list.c.
3 Copyright (C) 2013-2015 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
5
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.
10
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.
15
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/>. */
19
20 /* Thumb requires excess IT instructions here. */
21 #define NO_THUMB
22 #include <sysdep.h>
23 #include <rtld-global-offsets.h>
24
25 #if IS_IN (libc)
26 /* Under __ARM_NEON__, memcpy_neon.S defines the name memcpy. */
27 # ifndef __ARM_NEON__
28 .text
29 ENTRY(memcpy)
30 .type memcpy, %gnu_indirect_function
31 # ifdef __SOFTFP__
32 ldr r1, .Lmemcpy_arm
33 tst r0, #HWCAP_ARM_VFP
34 ldrne r1, .Lmemcpy_vfp
35 # else
36 ldr r1, .Lmemcpy_vfp
37 # endif
38 tst r0, #HWCAP_ARM_NEON
39 ldrne r1, .Lmemcpy_neon
40 1:
41 add r0, r1, pc
42 DO_RET(lr)
43
44 # ifdef __SOFTFP__
45 .Lmemcpy_arm:
46 .long C_SYMBOL_NAME(__memcpy_arm) - 1b - PC_OFS
47 # endif
48 .Lmemcpy_neon:
49 .long C_SYMBOL_NAME(__memcpy_neon) - 1b - PC_OFS
50 .Lmemcpy_vfp:
51 .long C_SYMBOL_NAME(__memcpy_vfp) - 1b - PC_OFS
52
53 END(memcpy)
54
55 libc_hidden_builtin_def (memcpy)
56 #endif /* Not __ARM_NEON__. */
57
58 /* These versions of memcpy are defined not to clobber any VFP or NEON
59 registers so they must always call the ARM variant of the memcpy code. */
60 strong_alias (__memcpy_arm, __aeabi_memcpy)
61 strong_alias (__memcpy_arm, __aeabi_memcpy4)
62 strong_alias (__memcpy_arm, __aeabi_memcpy8)
63 libc_hidden_def (__memcpy_arm)
64
65 #undef libc_hidden_builtin_def
66 #define libc_hidden_builtin_def(name)
67 #undef weak_alias
68 #define weak_alias(x, y)
69 #undef libc_hidden_def
70 #define libc_hidden_def(name)
71
72 #define memcpy __memcpy_arm
73
74 #endif
75
76 #include "memcpy_impl.S"