diff options
| author | Robert Norton | 2018-05-01 15:28:42 +0100 |
|---|---|---|
| committer | Robert Norton | 2018-05-01 15:28:42 +0100 |
| commit | 4db05909b63223083b119a9890e2adc070d9db8a (patch) | |
| tree | c6ec57442331e488e1515d0e9cf507c22eb41e04 | |
| parent | f2aa97392d597ec0622c3a94585cf63d79eb6c81 (diff) | |
cheri256: minor optimisation -- factor out null_cap_bits as top level let.
| -rw-r--r-- | cheri/cheri_prelude_256.sail | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cheri/cheri_prelude_256.sail b/cheri/cheri_prelude_256.sail index ba8a5d16..5590bbb8 100644 --- a/cheri/cheri_prelude_256.sail +++ b/cheri/cheri_prelude_256.sail @@ -165,12 +165,12 @@ function capStructToMemBits256(cap) : CapStruct -> bits(256) = this ensures that canonical null_cap is always all-zeros in memory even though it may have bits set logically (e.g. length or exponent) */ +let null_cap_bits : bits(256) = capStructToMemBits256(null_cap) + function capStructToMemBits(cap) : CapStruct -> bits(256)= - let null_cap_bits : bits(256) = capStructToMemBits256(null_cap) in capStructToMemBits256(cap) ^ null_cap_bits function memBitsToCapBits(tag, b) : (bool, bits(256)) -> bits(257) = - let null_cap_bits : bits(256) = capStructToMemBits256(null_cap) in tag @ (b ^ null_cap_bits) function capStructToCapReg(cap) : CapStruct -> CapReg = cap.tag @ capStructToMemBits256(cap) |
