From 6267c2bb2e3903d14adb443648a95fa1154a9e88 Mon Sep 17 00:00:00 2001 From: Jonathan Woodruff Date: Fri, 6 Mar 2020 17:57:12 +0000 Subject: [PATCH] Calculate "exact" more efficiently. --- CHERICC_Fat.bsv | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHERICC_Fat.bsv b/CHERICC_Fat.bsv index bcc0fc1..da7c395 100644 --- a/CHERICC_Fat.bsv +++ b/CHERICC_Fat.bsv @@ -495,17 +495,15 @@ function SetBoundsReturn setBoundsFat(CapFat cap, Address lengthFull); if (lengthIsMax && (lengthCarryIn || lengthRoundUp)) lengthOverflow = True; if (lengthIsMaxLessOne && lengthCarryIn && lengthRoundUp) lengthOverflow = True; - Bool exact = True; if(lengthOverflow && intExp) begin e = e+1; ret.bounds.topBits = (lostSignificantTopHigher) ? (newTopBitsHigher+'b1000):newTopBitsHigher; ret.bounds.baseBits = truncateLSB(newBaseBits); - exact = !(lostSignificantBaseHigher || lostSignificantTopHigher); end else begin ret.bounds.topBits = (lostSignificantTop) ? truncate(newTopBits+'b1000):truncate(newTopBits); ret.bounds.baseBits = truncate(newBaseBits); - exact = !(lostSignificantBase || lostSignificantTop); end + Bool exact = !(lostSignificantBase || lostSignificantTop); ret.bounds.exp = e; // Update the addrBits fields