forked from OSchip/llvm-project
parent
1653610449
commit
bdadd87c4d
|
@ -42,12 +42,12 @@ DEFINE_COMPILERRT_FUNCTION(__udivmodsi4)
|
||||||
tst b, b // detect divide-by-zero
|
tst b, b // detect divide-by-zero
|
||||||
clz r3, b
|
clz r3, b
|
||||||
mov q, #0
|
mov q, #0
|
||||||
beq L_return // return 0 if b is zero.
|
beq LOCAL_LABEL(return) // return 0 if b is zero.
|
||||||
mov one, #1
|
mov one, #1
|
||||||
subs i, r3, r4
|
subs i, r3, r4
|
||||||
blt L_return // return 0 if MSB(a) < MSB(b)
|
blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b)
|
||||||
|
|
||||||
L_mainLoop:
|
LOCAL_LABEL(mainLoop):
|
||||||
// This loop basically implements the following:
|
// This loop basically implements the following:
|
||||||
//
|
//
|
||||||
// do {
|
// do {
|
||||||
|
@ -65,7 +65,7 @@ L_mainLoop:
|
||||||
orrhs q, q,one, lsl i
|
orrhs q, q,one, lsl i
|
||||||
movhs a, r
|
movhs a, r
|
||||||
subsne i, i, #1
|
subsne i, i, #1
|
||||||
bhi L_mainLoop
|
bhi LOCAL_LABEL(mainLoop)
|
||||||
|
|
||||||
// Do the final test subtraction and update of quotient (i == 0), as it is
|
// Do the final test subtraction and update of quotient (i == 0), as it is
|
||||||
// not performed in the main loop.
|
// not performed in the main loop.
|
||||||
|
@ -73,7 +73,7 @@ L_mainLoop:
|
||||||
orrhs q, #1
|
orrhs q, #1
|
||||||
movhs a, r
|
movhs a, r
|
||||||
|
|
||||||
L_return:
|
LOCAL_LABEL(return):
|
||||||
// Store the remainder, and move the quotient to r0, then return.
|
// Store the remainder, and move the quotient to r0, then return.
|
||||||
str a, [r2]
|
str a, [r2]
|
||||||
mov r0, q
|
mov r0, q
|
||||||
|
|
|
@ -42,12 +42,12 @@ DEFINE_COMPILERRT_FUNCTION(__udivsi3)
|
||||||
tst b, b // detect divide-by-zero
|
tst b, b // detect divide-by-zero
|
||||||
clz r3, b
|
clz r3, b
|
||||||
mov q, #0
|
mov q, #0
|
||||||
beq L_return // return 0 if b is zero.
|
beq LOCAL_LABEL(return) // return 0 if b is zero.
|
||||||
mov one, #1
|
mov one, #1
|
||||||
subs i, r3, r2
|
subs i, r3, r2
|
||||||
blt L_return // return 0 if MSB(a) < MSB(b)
|
blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b)
|
||||||
|
|
||||||
L_mainLoop:
|
LOCAL_LABEL(mainLoop):
|
||||||
// This loop basically implements the following:
|
// This loop basically implements the following:
|
||||||
//
|
//
|
||||||
// do {
|
// do {
|
||||||
|
@ -65,14 +65,14 @@ L_mainLoop:
|
||||||
orrhs q, q,one, lsl i
|
orrhs q, q,one, lsl i
|
||||||
movhs a, r
|
movhs a, r
|
||||||
subsne i, i, #1
|
subsne i, i, #1
|
||||||
bhi L_mainLoop
|
bhi LOCAL_LABEL(mainLoop)
|
||||||
|
|
||||||
// Do the final test subtraction and update of quotient (i == 0), as it is
|
// Do the final test subtraction and update of quotient (i == 0), as it is
|
||||||
// not performed in the main loop.
|
// not performed in the main loop.
|
||||||
subs r, a, b
|
subs r, a, b
|
||||||
orrhs q, #1
|
orrhs q, #1
|
||||||
|
|
||||||
L_return:
|
LOCAL_LABEL(return):
|
||||||
// Move the quotient to r0 and return.
|
// Move the quotient to r0 and return.
|
||||||
mov r0, q
|
mov r0, q
|
||||||
CLEAR_FRAME_AND_RETURN
|
CLEAR_FRAME_AND_RETURN
|
||||||
|
|
|
@ -33,7 +33,7 @@ DEFINE_COMPILERRT_FUNCTION(__umodsi3)
|
||||||
subs i, r3, r2
|
subs i, r3, r2
|
||||||
bxlt lr // return a if MSB(a) < MSB(b)
|
bxlt lr // return a if MSB(a) < MSB(b)
|
||||||
|
|
||||||
L_mainLoop:
|
LOCAL_LABEL(mainLoop):
|
||||||
// This loop basically implements the following:
|
// This loop basically implements the following:
|
||||||
//
|
//
|
||||||
// do {
|
// do {
|
||||||
|
@ -49,7 +49,7 @@ L_mainLoop:
|
||||||
subs r, a, b, lsl i
|
subs r, a, b, lsl i
|
||||||
movhs a, r
|
movhs a, r
|
||||||
subsne i, i, #1
|
subsne i, i, #1
|
||||||
bhi L_mainLoop
|
bhi LOCAL_LABEL(mainLoop)
|
||||||
|
|
||||||
// Do the final test subtraction and update of remainder (i == 0), as it is
|
// Do the final test subtraction and update of remainder (i == 0), as it is
|
||||||
// not performed in the main loop.
|
// not performed in the main loop.
|
||||||
|
|
Loading…
Reference in New Issue