]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S
ARM Packages: Removed trailing spaces
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / ldivmod.S
CommitLineData
3402aac7 1//------------------------------------------------------------------------------\r
1e57a462 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 .text\r
17 .align 2\r
18 GCC_ASM_EXPORT(__aeabi_ldivmod)\r
19\r
20//\r
3402aac7 21// A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}},\r
1e57a462 22// the quotient in {r0, r1}, and the remainder in {r2, r3}.\r
23//\r
24//__value_in_regs lldiv_t\r
25//EFIAPI\r
26//__aeabi_ldivmod (\r
27// IN UINT64 Dividen\r
28// IN UINT64 Divisor\r
29// )//\r
30//\r
31\r
32ASM_PFX(__aeabi_ldivmod):\r
33 push {r4,lr}\r
34 asrs r4,r1,#1\r
35 eor r4,r4,r3,LSR #1\r
36 bpl L_Test1\r
37 rsbs r0,r0,#0\r
38 rsc r1,r1,#0\r
39L_Test1:\r
40 tst r3,r3\r
41 bpl L_Test2\r
42 rsbs r2,r2,#0\r
43 rsc r3,r3,#0\r
44L_Test2:\r
3402aac7 45 bl ASM_PFX(__aeabi_uldivmod)\r
1e57a462 46 tst r4,#0x40000000\r
47 beq L_Test3\r
48 rsbs r0,r0,#0\r
49 rsc r1,r1,#0\r
50L_Test3:\r
51 tst r4,#0x80000000\r
52 beq L_Exit\r
53 rsbs r2,r2,#0\r
54 rsc r3,r3,#0\r
55L_Exit:\r
56 pop {r4,pc}\r
3402aac7 57\r
1e57a462 58\r
59\r