1 //===-- aeabi_uidivmod.S - EABI uidivmod implementation -------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "../assembly.h"
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};
19 #if defined(__MINGW32__)
20 #define __aeabi_uidivmod __rt_udiv
25 #if defined(USE_THUMB_PROLOGUE)
29 #if defined(USE_THUMB_PROLOGUE)
30 DEFINE_COMPILERRT_THUMB_FUNCTION(__aeabi_uidivmod)
32 DEFINE_COMPILERRT_FUNCTION(__aeabi_uidivmod)
34 #if __ARM_ARCH_ISA_THUMB == 1
36 bcc LOCAL_LABEL(case_denom_larger)
38 bl SYMBOL_NAME(__aeabi_uidiv)
40 muls r2, r0, r2 // r2 = quot * denom
43 LOCAL_LABEL(case_denom_larger):
51 #if defined(__MINGW32__)
56 bl SYMBOL_NAME(__udivmodsi4)
61 END_COMPILERRT_FUNCTION(__aeabi_uidivmod)
63 NO_EXEC_STACK_DIRECTIVE