Calculate "exact" more efficiently.

This commit is contained in:
Jonathan Woodruff
2020-03-06 17:57:12 +00:00
parent 7a50514e7e
commit 6267c2bb2e

View File

@@ -495,17 +495,15 @@ function SetBoundsReturn setBoundsFat(CapFat cap, Address lengthFull);
if (lengthIsMax && (lengthCarryIn || lengthRoundUp)) lengthOverflow = True; if (lengthIsMax && (lengthCarryIn || lengthRoundUp)) lengthOverflow = True;
if (lengthIsMaxLessOne && lengthCarryIn && lengthRoundUp) lengthOverflow = True; if (lengthIsMaxLessOne && lengthCarryIn && lengthRoundUp) lengthOverflow = True;
Bool exact = True;
if(lengthOverflow && intExp) begin if(lengthOverflow && intExp) begin
e = e+1; e = e+1;
ret.bounds.topBits = (lostSignificantTopHigher) ? (newTopBitsHigher+'b1000):newTopBitsHigher; ret.bounds.topBits = (lostSignificantTopHigher) ? (newTopBitsHigher+'b1000):newTopBitsHigher;
ret.bounds.baseBits = truncateLSB(newBaseBits); ret.bounds.baseBits = truncateLSB(newBaseBits);
exact = !(lostSignificantBaseHigher || lostSignificantTopHigher);
end else begin end else begin
ret.bounds.topBits = (lostSignificantTop) ? truncate(newTopBits+'b1000):truncate(newTopBits); ret.bounds.topBits = (lostSignificantTop) ? truncate(newTopBits+'b1000):truncate(newTopBits);
ret.bounds.baseBits = truncate(newBaseBits); ret.bounds.baseBits = truncate(newBaseBits);
exact = !(lostSignificantBase || lostSignificantTop);
end end
Bool exact = !(lostSignificantBase || lostSignificantTop);
ret.bounds.exp = e; ret.bounds.exp = e;
// Update the addrBits fields // Update the addrBits fields