bigint division begin debugged

This commit is contained in:
hyunghwan.chung 2019-04-08 04:14:37 +00:00
parent 96f3ebae4b
commit c153b2d1ac
2 changed files with 2 additions and 2 deletions

View File

@ -384,6 +384,7 @@ extend MyObject
[ self testBigintDiv: 16rfffffffe0000000080000000 divisor: 16r0000ffff0000000080000000 count: 12345 ], [ self testBigintDiv: 16rfffffffe0000000080000000 divisor: 16r0000ffff0000000080000000 count: 12345 ],
[ self testBigintDiv: 16rfffffffffffffffe divisor: 16rffffffff count: 2000 ], [ self testBigintDiv: 16rfffffffffffffffe divisor: 16rffffffff count: 2000 ],
[ self testBigintDiv: 68651967526299315528548877601614136727014 divisor: 1729382256910270380 count: 1 ], [ self testBigintDiv: 68651967526299315528548877601614136727014 divisor: 1729382256910270380 count: 1 ],
[ self testBigintDiv: 43943618413704592900396132847030223073729048496 divisor: 1135814937804493543741046072006331 count: 1 ],
## ========================= ## =========================

View File

@ -1833,8 +1833,7 @@ static void divide_unsigned_array2 (moo_t* moo, const moo_liw_t* x, moo_oow_t xs
/* TODO: optimize it with ASM - no seperate / and % */ /* TODO: optimize it with ASM - no seperate / and % */
quo = dw / y1; quo = dw / y1;
rem = dw % y1; rem = dw % y1;
/*rem = dw - (quo * y1);*/ #if 1
#if 0
adjust_quotient: adjust_quotient:
if (quo > MOO_TYPE_MAX(moo_liw_t) || (quo * y2) > ((rem << MOO_LIW_BITS) + q[i - 2])) if (quo > MOO_TYPE_MAX(moo_liw_t) || (quo * y2) > ((rem << MOO_LIW_BITS) + q[i - 2]))
{ {