fix(big): calculate shift from divisor in Div

This commit is contained in:
fallenoak 2023-02-06 12:15:25 -06:00
parent 955a0bbba7
commit 2d2ae3276a
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D

View file

@ -76,7 +76,7 @@ void Div(BigBuffer& a, BigBuffer& b, const BigBuffer& c, const BigBuffer& d, Big
auto& dd = stack.Alloc(&allocCount); auto& dd = stack.Alloc(&allocCount);
auto& work = stack.Alloc(&allocCount); auto& work = stack.Alloc(&allocCount);
uint32_t shift = 0x1F - (HighBitPos(work) & 0x1F); uint32_t shift = 0x1F - (HighBitPos(d) & 0x1F);
Shl(cc, c, shift); Shl(cc, c, shift);
Shl(dd, d, shift); Shl(dd, d, shift);