Commit 7725a57a authored by Deepak Saxena's avatar Deepak Saxena Committed by Russell King

[ARM PATCH] 1537/1: big-endian support for do_div64

Patch from Deepak Saxena
parent 32538906
#include <linux/linkage.h>
#ifndef __ARMEB__
ql .req r0 @ quotient low
qh .req r1 @ quotient high
dl .req r3 @ divisor low
dh .req r2 @ divisor high
onl .req r0 @ original dividend low
onh .req r1 @ original dividend high
nl .req r4 @ dividend low
nh .req r5 @ dividend high
res .req r4 @ result
#else
ql .req r1
qh .req r0
onl .req r1
onh .req r0
nl .req r5
nh .req r4
res .req r5
#endif
dl .req r3 @ divisor low
dh .req r2 @ divsor high
ENTRY(do_div64)
stmfd sp!, {r4, r5, lr}
mov nl, r0
movs nh, r1 @ if high bits are zero
mov nl, onl
movs nh, onh @ if high bits are zero
movne lr, #33
moveq lr, #1 @ only divide low bits
moveq nh, r0
moveq nh, onl
1: cmp nh, dh
bls 2f
add lr, lr, #1
movs dh, dh, lsl #1 @ left justify divisor
movs dh, dh, lsl #1 @ left justify disor
bpl 1b
2: movs nh, r1
2: movs nh, onh
moveq dl, dh
moveq dh, #0
movne dl, #0
......@@ -38,5 +53,5 @@ ENTRY(do_div64)
subs lr, lr, #1
bne 3b
mov r2, nl
mov r2, res
ldmfd sp!, {r4, r5, pc}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment