• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    EXTERN  __aeabi_uldivmod
17
18    INCLUDE AsmMacroExport.inc
19
20;
21;UINT32
22;EFIAPI
23;__aeabi_uidivmode (
24;  IN UINT32  Dividen
25;  IN UINT32  Divisor
26;  );
27;
28
29 RVCT_ASM_EXPORT __aeabi_ldivmod
30    PUSH     {r4,lr}
31    ASRS     r4,r1,#1
32    EOR      r4,r4,r3,LSR #1
33    BPL      L_Test1
34    RSBS     r0,r0,#0
35    RSC      r1,r1,#0
36L_Test1
37    TST      r3,r3
38    BPL      L_Test2
39    RSBS     r2,r2,#0
40    RSC      r3,r3,#0
41L_Test2
42    BL       __aeabi_uldivmod  ;
43    TST      r4,#0x40000000
44    BEQ      L_Test3
45    RSBS     r0,r0,#0
46    RSC      r1,r1,#0
47L_Test3
48    TST      r4,#0x80000000
49    BEQ      L_Exit
50    RSBS     r2,r2,#0
51    RSC      r3,r3,#0
52L_Exit
53    POP      {r4,pc}
54
55    END
56
57
58