Update copyright notices with scripts/update-copyrights
[glibc.git] / ports / sysdeps / arm / armv7 / multiarch / memcpy.S
blobc4f4e80fb07fbc1295c779bb21d159ff2b9489e5
1 /* Multiple versions of memcpy
2    All versions must be listed in ifunc-impl-list.c.
3    Copyright (C) 2013-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 /* Thumb requires excess IT instructions here.  */
21 #define NO_THUMB
22 #include <sysdep.h>
23 #include <rtld-global-offsets.h>
25 #ifndef NOT_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
41         add     r0, r1, pc
42         DO_RET(lr)
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
53 END(memcpy)
55 libc_hidden_builtin_def (memcpy)
56 #endif  /* Not __ARM_NEON__.  */
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)
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)
72 #define memcpy __memcpy_arm
74 #endif
76 #include "memcpy_impl.S"