From 7768f479c42fd6a5f042008223a507faa3b870e8 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 10 Nov 2016 12:10:22 +0000 Subject: Cleanup thumb2divmod.s --- thumb2divmod.s | 18 +++++------------- 1 file 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 -- cgit v1.2.3