repo.or.cz
/
AROS.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
revert between 56095 -> 55830 in arch
[AROS.git]
/
arch
/
arm-all
/
arm-aeabi
/
idivmod.S
blob
273ecab12ba08d2cdefd5f474f310ba944b1d5a3
1
.text
2
.align 2
3
.globl __aeabi_idiv
4
.globl __aeabi_idivmod
5
__aeabi_idiv:
6
subs r2, r1, #0
7
bxeq lr /* div/0 !*/
8
9
eor ip, r1, r0
10
11
rsbmi r2, r2, #0
12
13
movs r1, r0
14
15
rsbmi r1, r1, #0
16
17
cmp r2, r0
18
movhi r1, r0
19
movhi r0, #0
20
bxhi lr
21
22
clz r3, r1
23
clz r0, r2
24
rsb r0, r3, r0
25
mov r3, #1
26
mov r2, r2, asl r0
27
mov r3, r3, asl r0
28
mov r0, #0
29
1:
30
cmp r1, r2
31
rsbcs r1, r2, r1
32
orrcs r0, r0, r3
33
movs r3, r3, lsr #1
34
mov r2, r2, lsr #1
35
bne 1b
36
37
cmp ip, #0
38
rsbmi r0, r0, #0
39
40
bx lr
41
42
__aeabi_idivmod: stmfd sp!,{r0, r1, ip, lr}
43
bl __aeabi_idiv
44
ldmfd sp!,{r1, r2, ip, lr}
45
mul r3, r0, r2
46
sub r1, r1, r3
47
bx lr
48