blob: 0237f2221d7bec1c3998c2a73d1ebec06ddf8da5 [file] [log] [blame]
Anton Korobeynikoveb2ecd02012-01-30 10:21:51 +00001//===-- 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 .align 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 }