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