]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | //===-- 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 | ||
7cac9316 XL |
19 | #if defined(__MINGW32__) |
20 | #define __aeabi_uldivmod __rt_udiv64 | |
21 | #endif | |
22 | ||
1a4d82fc | 23 | .syntax unified |
92a42be0 | 24 | .p2align 2 |
1a4d82fc | 25 | DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod) |
2c00a5a8 | 26 | push {r6, lr} |
1a4d82fc | 27 | sub sp, sp, #16 |
2c00a5a8 XL |
28 | add r6, sp, #8 |
29 | str r6, [sp] | |
7cac9316 | 30 | #if defined(__MINGW32__) |
2c00a5a8 XL |
31 | movs r6, r0 |
32 | movs r0, r2 | |
33 | movs r2, r6 | |
34 | movs r6, r1 | |
35 | movs r1, r3 | |
36 | movs r3, r6 | |
7cac9316 | 37 | #endif |
1a4d82fc JJ |
38 | bl SYMBOL_NAME(__udivmoddi4) |
39 | ldr r2, [sp, #8] | |
40 | ldr r3, [sp, #12] | |
41 | add sp, sp, #16 | |
2c00a5a8 | 42 | pop {r6, pc} |
1a4d82fc | 43 | END_COMPILERRT_FUNCTION(__aeabi_uldivmod) |
3157f602 XL |
44 | |
45 | NO_EXEC_STACK_DIRECTIVE | |
46 |