summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-11-10 12:10:22 +0000
committerCamil Staps2016-11-10 12:10:22 +0000
commit7768f479c42fd6a5f042008223a507faa3b870e8 (patch)
tree5d1056e7ca5640e7203311881db83556243bbee2
parentFix some more #9 -> #7 instances (diff)
Cleanup thumb2divmod.s
-rw-r--r--thumb2divmod.s18
1 files changed, 5 insertions, 13 deletions
diff --git a/thumb2divmod.s b/thumb2divmod.s
index ee01f75..4a28c13 100644
--- a/thumb2divmod.s
+++ b/thumb2divmod.s
@@ -90,7 +90,6 @@ divide_by_small_number:
.globl modulo
.thumb_func
modulo:
- eor r12,r3,r4
cmp r4,#0
it lt
neglt r4,r4
@@ -122,6 +121,7 @@ modulo:
movcs r3,r1
.endr
+modulo_divide_result_0:
mov r4,r3
cmp r12,#0
it lt
@@ -141,22 +141,14 @@ modulo_large_divide_result:
vmov r2,s15
b modulo_from_quotient
-modulo_divide_result_0:
- mov r4,r3
- cmp r12,#0
- it lt
- neglt r4,r4
- ldr pc,[sp],#4
-
.thumb_func
-modulo_of_small_number_:
.align
modulo_of_small_number:
- add r1,pc,#2
+ add r1,pc,#4
add r1,r1,r4,lsl #3
- ldrb r0,[r1,#(div_mod_table+1)-(modulo_of_small_number_+8)]
- ldr r2,[r1,#(div_mod_table+4)-(modulo_of_small_number_+8)]
- ldrb r1,[r1,#div_mod_table-(modulo_of_small_number_+8)]
+ ldrb r0,[r1,#(div_mod_table+1)-(modulo_of_small_number+8)]
+ ldr r2,[r1,#(div_mod_table+4)-(modulo_of_small_number+8)]
+ ldrb r1,[r1,#div_mod_table-(modulo_of_small_number+8)]
adds r14,r3,r0
it cc
umullcc r0,r2,r14,r2