summaryrefslogtreecommitdiff
path: root/thumb2divmod.s
diff options
context:
space:
mode:
Diffstat (limited to 'thumb2divmod.s')
-rw-r--r--thumb2divmod.s24
1 files changed, 9 insertions, 15 deletions
diff --git a/thumb2divmod.s b/thumb2divmod.s
index 8aeabb4..ee01f75 100644
--- a/thumb2divmod.s
+++ b/thumb2divmod.s
@@ -7,6 +7,7 @@
.globl divide
.thumb_func
+ .align
divide:
eor r12,r3,r4
cmp r4,#0
@@ -47,8 +48,7 @@ divide:
cmp r12,#0
it lt
neglt r4,r4
- ldr lr,[sp],#4
- mov pc,lr
+ ldr pc,[sp],#4
.thumb_func
divide_large_result:
@@ -64,17 +64,15 @@ divide_large_result:
cmp r12,#0
it lt
neglt r4,r4
- ldr lr,[sp],#4
- mov pc,lr
+ ldr pc,[sp],#4
divide_result_0:
mov r4,#0
- ldr lr,[sp],#4
- mov pc,lr
+ ldr pc,[sp],#4
.thumb_func
-divide_by_small_number:
.align
+divide_by_small_number:
mov r1,r4,lsl #3
add r1,r1,pc
ldrb r4,[r1,#(div_mod_table+1)-(divide_by_small_number+8)]
@@ -87,8 +85,7 @@ divide_by_small_number:
cmp r12,#0
it lt
neglt r4,r4
- ldr lr,[sp],#4
- mov pc,lr
+ ldr pc,[sp],#4
.globl modulo
.thumb_func
@@ -129,8 +126,7 @@ modulo:
cmp r12,#0
it lt
neglt r4,r4
- ldr lr,[sp],#4
- mov pc,lr
+ ldr pc,[sp],#4
.thumb_func
modulo_large_divide_result:
@@ -150,8 +146,7 @@ modulo_divide_result_0:
cmp r12,#0
it lt
neglt r4,r4
- ldr lr,[sp],#4
- mov pc,lr
+ ldr pc,[sp],#4
.thumb_func
modulo_of_small_number_:
@@ -174,8 +169,7 @@ modulo_from_quotient:
cmp r12,#0
it ge
negge r4,r4
- ldr lr,[sp],#4
- mov pc,lr
+ ldr pc,[sp],#4
div_mod_table:
.long 0,0