Rename ENABLE_L8 and L8 to ENABLE_MSB and MSB #1283
In {rv64y_uni_base_name}, `EW=6` is even (`TE` and `BE` are 3 bits each).
For {cheri_base32_ext_name} capability-encoding formats only a 5-bit exponent is needed, and exponent bits are shared equally between the base and top bound meaning that another exponent bit needs to be stored separately in the L8 bit.
Additionally, L8 gives and an extra bit of bounds precision when `EF=1`.
I find this easier to understand, but I don't think it gives the full picture yet.
L8 needs renaming.
It's the MSB of the exponent if EF=1 and also gives an extra bit of mantissa precision.
Right now it's added into bit 8 of the top as MW=10
It's bit 8 of the length as it's added to the base upper bits to form the top upper bits.
T[MW - 1:MW - 2] = B[MW - 1:MW - 2] + LCout + LMSB
I'm wondering if it should simply be MSB as it's for the exponent and length MSB?!
Following discussion with @PeterRugg I've renamed L8 to MSB and improved the description of the field.
Following discussion with PeterRugg I've renamed L8 to MSB and improved the description of the field.
Yeah I also thought we should really rename it. This pr was the minimal fix but I think we should do it properly
it's much better with the rename, I never knew why it was called L8 until today
Actually now I wonder if we even need this flag, isn't it really just EW is odd/even?
no - because it has a dual purpose and also increases the length - it get's added into top[MW-2]
EF=0 -> exponent, EF=1 -> increase length of small cap
they could be controlled by a separate parameters... could be cleaner
or just an enable for the extra bit on the length - the exponent is just even, odd certainly.
Looks like a reasonable change to me.
I've gone further, 2 more commits.
The first one tidies up the wording.
The second one is more extensive:
1. remove ENABLE_L8 (renamed to ENABLE_LMSB) completely
2. Have MSB (formerly L8) as read-only-zero for RV64Y, inly encoded for RV32Y
3. Simplify the pseudo-code as the new MSB is the same as the old (ENABLE_MSB && MSB)
4. Simplify the malformed bounds check inthe same way as (3)
This is a simpler and hopefully acceptable alternative to #1287 (which I suggested to Alex)
I don't think this is right. Claude's tried to have a go at this in a similar way before. I don't think it understands it (or maybe I don't, who knows...)
The point is if you have enableL8 (using the old terminology), then you can reach all these encodings with EF=1, MSB=1, and still have your lower bits of precision in your mantissa.
This is a bit of an issue for the whole approach of removing enableL8. We need to know if these encodings can be reached using L8 with EF=1 to decide if we ban them when EF=0, so it's a "global" property of the format we need to check. I think what we used to have here is E == 0 && XLEN==32 or similar, but it's a bit harder to understand what's going on.
this was a manual change by me - not by Claude - and that previous line has been there since at least 0.9.3, but I see your point. You only need the line if that case is possible which is currently gated by enableL8=1.
I'm now convinced it's still correct (and not just because Claude hasn't complained).
The reason is that enablel8 has _no_ effect if the encoded L8 (MSB) bit is zero, so the only way that the malformed bounds check is different is if the encoded bit is actually set.
Therefore testing L8 (MSB) directly gives the same end result without the enable.
Sorry, didn't mean to imply that Claude had made the change, just that it hadn't noticed the inconsistency.
But I'm afraid I still disagree.
ah ok!
The reason is that enablel8 has no effect if the encoded L8 (MSB) bit is zero
Yes: but the point is that the encodings that _are_ enabled by MSB=1 make _these_ encodings redundant.
From discussing offline, I've realised this does _technically_ work, and is explained by the non-normative note from below that I'd missed:
This relies onMSBbeing set wheneverE=0andEF=0, which holds for any format with anMSBbit whereCAP_MAX_E >= 16, because then{ MSB, TE, BE } = CAP_MAX_EhasMSB=1.
Capability-encoding formats with an
MSB bit must satisfy this constraint, or must define the redundant E=0 encodings as malformed differently.This is very strange though: effectively sneaking in an XLEN dependency by relying on something that happens to always be true when XLEN=32 and is defined away as false when XLEN=64...
yeah - we've agreed that this isn't the way forwards
I've reverted that commit
By not conditioning here, the RHS of the subtract becomes 7 bits for RV64, which is a bit odd, but I don't think it matters
Approved these changes.
I'll revert it
I don't really mind which way we do this but there is also #1287
I'm not convinced MSB is a good name for this field, how about LE like I did in #1287 ?
These two paragraphs are basically the same information
This one is a bit weird now since we say the field does not exist?
I think this sentence is weird with the two MSB meaning different things, would be easier if we used a different name like LE for the field
it's read-only-zero or encoded.
But either way it needs to move to RV32
yes - the double use of MSB is a bit odd
Well if it's always zero then isn't the bit concatenation below a size mismatch? But ok having it as always zero works
Oh I see that's fixed now
Looking at this again the enable_ prefix is a bit odd. Maybe we should have used something like HAVE_LE / HAS_LE / NEED_LE?
closed in favour of #1287
tariqkurd-repo
arichardson
Addresses the following ARC review comments on v0.9.10:
capability metadata and doesn't appear to be calculated."
match other variables and the pseudo-code."
Signed-off-by: Alex Richardson <alexrichardson@google.com>