Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 1 | //===-- 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 | .p2align 2 |
| 20 | DEFINE_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 } |
| 28 | END_COMPILERRT_FUNCTION(__aeabi_idivmod) |
Pirama Arumuga Nainar | c58a436 | 2016-09-19 23:00:23 -0700 | [diff] [blame] | 29 | |
| 30 | NO_EXEC_STACK_DIRECTIVE |
| 31 | |