]> git.proxmox.com Git - rustc.git/blame - src/libcompiler_builtins/compiler-rt/lib/builtins/arm/aeabi_memset.S
New upstream version 1.25.0+dfsg1
[rustc.git] / src / libcompiler_builtins / compiler-rt / lib / builtins / arm / aeabi_memset.S
CommitLineData
1a4d82fc
JJ
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
5bcae85e 15 .syntax unified
92a42be0 16 .p2align 2
1a4d82fc
JJ
17DEFINE_COMPILERRT_FUNCTION(__aeabi_memset)
18 mov r3, r1
19 mov r1, r2
20 mov r2, r3
2c00a5a8
XL
21#ifdef USE_THUMB_1
22 push {r7, lr}
23 bl memset
24 pop {r7, pc}
25#else
1a4d82fc 26 b memset
2c00a5a8 27#endif
1a4d82fc
JJ
28END_COMPILERRT_FUNCTION(__aeabi_memset)
29
30DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset4, __aeabi_memset)
31DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset8, __aeabi_memset)
32
2c00a5a8 33 .p2align 2
1a4d82fc
JJ
34DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr)
35 mov r2, r1
2c00a5a8
XL
36 movs r1, #0
37#ifdef USE_THUMB_1
38 push {r7, lr}
39 bl memset
40 pop {r7, pc}
41#else
1a4d82fc 42 b memset
2c00a5a8 43#endif
1a4d82fc
JJ
44END_COMPILERRT_FUNCTION(__aeabi_memclr)
45
46DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr4, __aeabi_memclr)
47DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr8, __aeabi_memclr)
48
3157f602
XL
49NO_EXEC_STACK_DIRECTIVE
50