blob: 62a2113cc2ba86a23de296129f091c84d010b8f3 [file] [log] [blame]
Anton Korobeynikov28037ce2012-01-30 10:21:51 +00001//===-- aeabi_uldivmod.S - EABI uldivmod 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 { uint64_t quot, uint64_t rem}
13// __aeabi_uldivmod(uint64_t numerator, uint64_t denominator) {
14// uint64_t rem, quot;
15// quot = __udivmoddi4(numerator, denominator, &rem);
16// return {quot, rem};
17// }
18
19 .syntax unified
20 .align 2
21DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod)
22 push {r11, lr}
23 sub sp, sp, #16
24 add r12, sp, #8
25 str r12, [sp]
26 bl SYMBOL_NAME(__udivmoddi4)
27 ldr r2, [sp, #8]
28 ldr r3, [sp, #12]
29 add sp, sp, #16
Joerg Sonnenberger171e9cf2014-01-24 14:33:42 +000030 pop {r11, pc}
31END_COMPILERRT_FUNCTION(__aeabi_uldivmod)