summaryrefslogtreecommitdiff
path: root/thumb2divmod.s
diff options
context:
space:
mode:
Diffstat (limited to 'thumb2divmod.s')
-rw-r--r--thumb2divmod.s24
1 files changed, 18 insertions, 6 deletions
diff --git a/thumb2divmod.s b/thumb2divmod.s
index 3343db6..ec35a2b 100644
--- a/thumb2divmod.s
+++ b/thumb2divmod.s
@@ -48,7 +48,9 @@ divide:
cmp r12,#0
it lt
neglt r4,r4
- ldr pc,[sp],#4
+ ldr lr,[sp],#4
+ orr lr,lr,#1
+ mov pc,lr
.thumb_func
divide_large_result:
@@ -64,11 +66,15 @@ divide_large_result:
cmp r12,#0
it lt
neglt r4,r4
- ldr pc,[sp],#4
+ ldr lr,[sp],#4
+ orr lr,lr,#1
+ mov pc,lr
divide_result_0:
mov r4,#0
- ldr pc,[sp],#4
+ ldr lr,[sp],#4
+ orr lr,lr,#1
+ mov pc,lr
.thumb_func
divide_by_small_number:
@@ -84,7 +90,9 @@ divide_by_small_number:
cmp r12,#0
it lt
neglt r4,r4
- ldr pc,[sp],#4
+ ldr lr,[sp],#4
+ orr lr,lr,#1
+ mov pc,lr
.globl modulo
.thumb_func
@@ -138,7 +146,9 @@ modulo_divide_result_0:
cmp r12,#0
it lt
neglt r4,r4
- ldr pc,[sp],#4
+ ldr lr,[sp],#4
+ orr lr,lr,#1
+ mov pc,lr
.thumb_func
modulo_of_small_number:
@@ -159,7 +169,9 @@ modulo_from_quotient:
cmp r12,#0
it lt
neglt r4,r4
- ldr pc,[sp],#4
+ ldr lr,[sp],#4
+ orr lr,lr,#1
+ mov pc,lr
.thumb_func
div_mod_table: