]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm
Working on having a single stack for all modes. This code currently has an issue...
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / ldivmod.asm
CommitLineData
2ef2b01e
A
1//------------------------------------------------------------------------------
2//
3// Copyright (c) 2008-2009 Apple Inc. All rights reserved.
4//
5// All rights reserved. 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 {pc} + 0xc ; 0x18
35 RSBS r0,r0,#0
36 RSC r1,r1,#0
37 TST r3,r3
38 BPL {pc} + 0xc ; 0x28
39 RSBS r2,r2,#0
40 RSC r3,r3,#0
41 BL __aeabi_uldivmod ;
42 TST r4,#0x40000000
43 BEQ {pc} + 0xc ; 0x3c
44 RSBS r0,r0,#0
45 RSC r1,r1,#0
46 TST r4,#0x80000000
47 BEQ {pc} + 0xc ; 0x4c
48 RSBS r2,r2,#0
49 RSC r3,r3,#0
50 POP {r4,pc}
51
52 END
53
54