]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/builtins/arm/aeabi_memset.S
Merge clang trunk r338150 (just before the 7.0.0 branch point), and
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / builtins / arm / aeabi_memset.S
1 //===-- aeabi_memset.S - EABI memset implementation -----------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "../assembly.h"
11
12 //  void __aeabi_memset(void *dest, size_t n, int c) { memset(dest, c, n); }
13 //  void __aeabi_memclr(void *dest, size_t n) { __aeabi_memset(dest, n, 0); }
14
15         .syntax unified
16         .p2align 2
17 DEFINE_COMPILERRT_FUNCTION(__aeabi_memset)
18         mov     r3, r1
19         mov     r1, r2
20         mov     r2, r3
21 #ifdef USE_THUMB_1
22         push    {r7, lr}
23         bl      memset
24         pop     {r7, pc}
25 #else
26         b       memset
27 #endif
28 END_COMPILERRT_FUNCTION(__aeabi_memset)
29
30 DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset4, __aeabi_memset)
31 DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset8, __aeabi_memset)
32
33         .p2align 2
34 DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr)
35         mov     r2, r1
36         movs    r1, #0
37 #ifdef USE_THUMB_1
38         push    {r7, lr}
39         bl      memset
40         pop     {r7, pc}
41 #else
42         b       memset
43 #endif
44 END_COMPILERRT_FUNCTION(__aeabi_memclr)
45
46 DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr4, __aeabi_memclr)
47 DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr8, __aeabi_memclr)
48
49 NO_EXEC_STACK_DIRECTIVE
50