]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
ARM Packages: Fixed line endings
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / ldivmod.asm
1 //------------------------------------------------------------------------------
2 //
3 // Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 //
5 // This program and the accompanying materials
6 // are licensed and made available under the terms and conditions of the BSD License
7 // which accompanies this distribution. The full text of the license may be found at
8 // http://opensource.org/licenses/bsd-license.php
9 //
10 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 //
13 //------------------------------------------------------------------------------
14
15
16 EXPORT __aeabi_ldivmod
17 EXTERN __aeabi_uldivmod
18
19 AREA Math, CODE, READONLY
20
21 ;
22 ;UINT32
23 ;EFIAPI
24 ;__aeabi_uidivmode (
25 ; IN UINT32 Dividen
26 ; IN UINT32 Divisor
27 ; );
28 ;
29
30 __aeabi_ldivmod
31 PUSH {r4,lr}
32 ASRS r4,r1,#1
33 EOR r4,r4,r3,LSR #1
34 BPL L_Test1
35 RSBS r0,r0,#0
36 RSC r1,r1,#0
37 L_Test1
38 TST r3,r3
39 BPL L_Test2
40 RSBS r2,r2,#0
41 RSC r3,r3,#0
42 L_Test2
43 BL __aeabi_uldivmod ;
44 TST r4,#0x40000000
45 BEQ L_Test3
46 RSBS r0,r0,#0
47 RSC r1,r1,#0
48 L_Test3
49 TST r4,#0x80000000
50 BEQ L_Exit
51 RSBS r2,r2,#0
52 RSC r3,r3,#0
53 L_Exit
54 POP {r4,pc}
55
56 END
57
58