blob: e1e12d97aa00135cf06d7dc18f8edf845f5117d5 [file] [log] [blame]
Anton Korobeynikov28037ce2012-01-30 10:21:51 +00001//===-- aeabi_uidivmod.S - EABI uidivmod 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 { unsigned quot, unsigned rem}
13// __aeabi_uidivmod(unsigned numerator, unsigned denominator) {
14// unsigned rem, quot;
15// quot = __udivmodsi4(numerator, denominator, &rem);
16// return {quot, rem};
17// }
18
19 .syntax unified
Saleem Abdulrasool310874a2014-05-12 15:23:37 +000020 .p2align 2
Anton Korobeynikov28037ce2012-01-30 10:21:51 +000021DEFINE_COMPILERRT_FUNCTION(__aeabi_uidivmod)
22 push { lr }
23 sub sp, sp, #4
24 mov r2, sp
25 bl SYMBOL_NAME(__udivmodsi4)
26 ldr r1, [sp]
27 add sp, sp, #4
28 pop { pc }
Joerg Sonnenberger171e9cf2014-01-24 14:33:42 +000029END_COMPILERRT_FUNCTION(__aeabi_uidivmod)
Saleem Abdulrasool590e85b2016-06-22 22:09:42 +000030
31NO_EXEC_STACK_DIRECTIVE
32