| Anton Korobeynikov | 28037ce | 2012-01-30 10:21:51 +0000 | [diff] [blame] | 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 | |
| 19 | .syntax unified |
| Saleem Abdulrasool | 310874a | 2014-05-12 15:23:37 +0000 | [diff] [blame] | 20 | .p2align 2 |
| Anton Korobeynikov | 28037ce | 2012-01-30 10:21:51 +0000 | [diff] [blame] | 21 | DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod) |
| 22 | push {r11, lr} |
| 23 | sub sp, sp, #16 |
| 24 | add r12, sp, #8 |
| 25 | str r12, [sp] |
| 26 | bl SYMBOL_NAME(__udivmoddi4) |
| 27 | ldr r2, [sp, #8] |
| 28 | ldr r3, [sp, #12] |
| 29 | add sp, sp, #16 |
| Joerg Sonnenberger | 171e9cf | 2014-01-24 14:33:42 +0000 | [diff] [blame] | 30 | pop {r11, pc} |
| 31 | END_COMPILERRT_FUNCTION(__aeabi_uldivmod) |
| Saleem Abdulrasool | 590e85b | 2016-06-22 22:09:42 +0000 | [diff] [blame^] | 32 | |
| 33 | NO_EXEC_STACK_DIRECTIVE |
| 34 | |