blob: 2fcad862f73a2eef793ad3c450eb8f1610e10513 [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001//===-- aeabi_idivmod.S - EABI idivmod 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// struct { int quot, int rem} __aeabi_idivmod(int numerator, int denominator) {
13// int rem, quot;
14// quot = __divmodsi4(numerator, denominator, &rem);
15// return {quot, rem};
16// }
17
18 .syntax unified
19 .p2align 2
20DEFINE_COMPILERRT_FUNCTION(__aeabi_idivmod)
21 push { lr }
22 sub sp, sp, #4
23 mov r2, sp
24 bl SYMBOL_NAME(__divmodsi4)
25 ldr r1, [sp]
26 add sp, sp, #4
27 pop { pc }
28END_COMPILERRT_FUNCTION(__aeabi_idivmod)
Pirama Arumuga Nainarc58a4362016-09-19 23:00:23 -070029
30NO_EXEC_STACK_DIRECTIVE
31