]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
903d1b1a877c949622cbe90bef8e42306d0e49a3
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / udivsi3.S
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 \s\s.text
16 \s\s.align 2
17 \s\sGCC_ASM_EXPORT(__udivsi3)
18
19 ASM_PFX(__udivsi3):
20 \s\scmp\s\sr1, #0
21 \s\scmpne\s\sr0, #0
22 \s\sstmfd\s\ssp!, {r4, r5, r7, lr}
23 \s\sadd\s\sr7, sp, #8
24 \s\sbeq\s\sL2
25 \s\sclz\s\sr2, r1
26 \s\sclz\s\sr3, r0
27 \s\srsb\s\sr3, r3, r2
28 \s\scmp\s\sr3, #31
29 \s\sbhi\s\sL2
30 \s\sldmeqfd\s\ssp!, {r4, r5, r7, pc}
31 \s\sadd\s\sr5, r3, #1
32 \s\srsb\s\sr3, r3, #31
33 \s\smov\s\slr, #0
34 \s\smov\s\sr2, r0, asl r3
35 \s\smov\s\sip, r0, lsr r5
36 \s\smov\s\sr4, lr
37 \s\sb\s\sL8
38 L9:
39 \s\smov\s\sr0, r2, lsr #31
40 \s\sorr\s\sip, r0, ip, asl #1
41 \s\sorr\s\sr2, r3, lr
42 \s\srsb\s\sr3, ip, r1
43 \s\ssub\s\sr3, r3, #1
44 \s\sand\s\sr0, r1, r3, asr #31
45 \s\smov\s\slr, r3, lsr #31
46 \s\srsb\s\sip, r0, ip
47 \s\sadd\s\sr4, r4, #1
48 L8:
49 \s\scmp\s\sr4, r5
50 \s\smov\s\sr3, r2, asl #1
51 \s\sbne\s\sL9
52 \s\sorr\s\sr0, r3, lr
53 \s\sldmfd\s\ssp!, {r4, r5, r7, pc}
54 L2:
55 \s\smov\s\sr0, #0
56 \s\sldmfd\s\ssp!, {r4, r5, r7, pc}
57