blob: 197c459eb3811dc4758c7d85b2f33ed7cfdde2b0 [file] [log] [blame]
Anton Korobeynikoveb2ecd02012-01-30 10:21:51 +00001//===-- aeabi_ldivmod.S - EABI ldivmod 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 { int64_t quot, int64_t rem}
13// __aeabi_ldivmod(int64_t numerator, int64_t denominator) {
14// int64_t rem, quot;
15// quot = __divmoddi4(numerator, denominator, &rem);
16// return {quot, rem};
17// }
18
19 .syntax unified
20 .align 2
21DEFINE_COMPILERRT_FUNCTION(__aeabi_ldivmod)
22 push {r11, lr}
23 sub sp, sp, #16
24 add r12, sp, #8
25 str r12, [sp]
26 bl SYMBOL_NAME(__divmoddi4)
27 ldr r2, [sp, #8]
28 ldr r3, [sp, #12]
29 add sp, sp, #16
30 pop {r11, pc}