blob: 48edd89705be6dad541e061a6580315c6b08a3d8 [file] [log] [blame]
Anton Korobeynikovb047b042012-01-30 10:21:23 +00001//===-- 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
Renato Golin2931b212016-07-13 14:01:15 +000015 .syntax unified
Saleem Abdulrasool310874a2014-05-12 15:23:37 +000016 .p2align 2
Anton Korobeynikovb047b042012-01-30 10:21:23 +000017DEFINE_COMPILERRT_FUNCTION(__aeabi_memset)
18 mov r3, r1
19 mov r1, r2
20 mov r2, r3
21 b memset
Joerg Sonnenberger171e9cf2014-01-24 14:33:42 +000022END_COMPILERRT_FUNCTION(__aeabi_memset)
Anton Korobeynikovb047b042012-01-30 10:21:23 +000023
24DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset4, __aeabi_memset)
25DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset8, __aeabi_memset)
Joerg Sonnenberger171e9cf2014-01-24 14:33:42 +000026
Anton Korobeynikovb047b042012-01-30 10:21:23 +000027DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr)
28 mov r2, r1
29 mov r1, #0
30 b memset
Joerg Sonnenberger171e9cf2014-01-24 14:33:42 +000031END_COMPILERRT_FUNCTION(__aeabi_memclr)
Anton Korobeynikovb047b042012-01-30 10:21:23 +000032
33DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr4, __aeabi_memclr)
34DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr8, __aeabi_memclr)
35
Saleem Abdulrasool590e85b2016-06-22 22:09:42 +000036NO_EXEC_STACK_DIRECTIVE
37