]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/compiler-rt/lib/arm/aeabi_idivmod.S
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / compiler-rt / lib / arm / aeabi_idivmod.S
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         .align 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 }