]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
ArmPkg/CompilerIntrinsicsLib: Fixed __aeabi_uwrite8
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / ldivmod.asm
CommitLineData
2ef2b01e
A
1//------------------------------------------------------------------------------
2//
d6ebcab7 3// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
2ef2b01e 4//
d6ebcab7 5// This program and the accompanying materials
2ef2b01e
A
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
54a70131 34 BPL L_Test1
2ef2b01e
A
35 RSBS r0,r0,#0
36 RSC r1,r1,#0
54a70131 37L_Test1
2ef2b01e 38 TST r3,r3
54a70131 39 BPL L_Test2
2ef2b01e
A
40 RSBS r2,r2,#0
41 RSC r3,r3,#0
54a70131 42L_Test2
2ef2b01e
A
43 BL __aeabi_uldivmod ;
44 TST r4,#0x40000000
54a70131 45 BEQ L_Test3
2ef2b01e
A
46 RSBS r0,r0,#0
47 RSC r1,r1,#0
54a70131 48L_Test3
2ef2b01e 49 TST r4,#0x80000000
54a70131 50 BEQ L_Exit
2ef2b01e
A
51 RSBS r2,r2,#0
52 RSC r3,r3,#0
54a70131 53L_Exit
2ef2b01e
A
54 POP {r4,pc}
55
56 END
57
58