]>
Commit | Line | Data |
---|---|---|
2ef2b01e A |
1 | #------------------------------------------------------------------------------ |
2 | # | |
d6ebcab7 | 3 | # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> |
2ef2b01e | 4 | # |
d6ebcab7 | 5 | # This program and the accompanying materials |
2ef2b01e A |
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 | .text | |
16 | .align 2 | |
4e471bfd | 17 | .globl ASM_PFX(__udivsi3) |
63ca7402 | 18 | INTERWORK_FUNC(__udivsi3) |
4e471bfd | 19 | |
20 | ASM_PFX(__udivsi3): | |
2ef2b01e A |
21 | cmp r1, #0 |
22 | cmpne r0, #0 | |
23 | stmfd sp!, {r4, r5, r7, lr} | |
24 | add r7, sp, #8 | |
25 | beq L2 | |
26 | clz r2, r1 | |
27 | clz r3, r0 | |
28 | rsb r3, r3, r2 | |
29 | cmp r3, #31 | |
30 | bhi L2 | |
31 | ldmeqfd sp!, {r4, r5, r7, pc} | |
32 | add r5, r3, #1 | |
33 | rsb r3, r3, #31 | |
34 | mov lr, #0 | |
35 | mov r2, r0, asl r3 | |
36 | mov ip, r0, lsr r5 | |
37 | mov r4, lr | |
38 | b L8 | |
39 | L9: | |
40 | mov r0, r2, lsr #31 | |
41 | orr ip, r0, ip, asl #1 | |
42 | orr r2, r3, lr | |
43 | rsb r3, ip, r1 | |
44 | sub r3, r3, #1 | |
45 | and r0, r1, r3, asr #31 | |
46 | mov lr, r3, lsr #31 | |
47 | rsb ip, r0, ip | |
48 | add r4, r4, #1 | |
49 | L8: | |
50 | cmp r4, r5 | |
51 | mov r3, r2, asl #1 | |
52 | bne L9 | |
53 | orr r0, r3, lr | |
54 | ldmfd sp!, {r4, r5, r7, pc} | |
55 | L2: | |
56 | mov r0, #0 | |
57 | ldmfd sp!, {r4, r5, r7, pc} | |
4e471bfd | 58 |