X86: Actual change that fixes div. How did that happen?
This commit is contained in:
parent
776e8d5c8e
commit
cc76842f83
1 changed files with 6 additions and 2 deletions
|
@ -620,15 +620,19 @@ let {{
|
||||||
remaining--;
|
remaining--;
|
||||||
}
|
}
|
||||||
if (dividend & (ULL(1) << 63)) {
|
if (dividend & (ULL(1) << 63)) {
|
||||||
|
bool highBit = false;
|
||||||
if (dividend < divisor && remaining) {
|
if (dividend < divisor && remaining) {
|
||||||
|
highBit = true;
|
||||||
dividend = (dividend << 1) |
|
dividend = (dividend << 1) |
|
||||||
bits(SrcReg1, remaining - 1);
|
bits(SrcReg1, remaining - 1);
|
||||||
quotient <<= 1;
|
quotient <<= 1;
|
||||||
remaining--;
|
remaining--;
|
||||||
}
|
}
|
||||||
|
if (highBit || divisor <= dividend) {
|
||||||
quotient++;
|
quotient++;
|
||||||
dividend -= divisor;
|
dividend -= divisor;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
remainder = dividend;
|
remainder = dividend;
|
||||||
} else {
|
} else {
|
||||||
//Shift in bits from the low order portion of the dividend
|
//Shift in bits from the low order portion of the dividend
|
||||||
|
|
Loading…
Reference in a new issue