-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCBNDSI redundancy? #402
Comments
Avoiding redundant encodings here would be nice and I agree that having shifted zero be |
I'd like to see some distribution of object sizes before thinking about adding that. And it will probably be different on 32- and 64-bit systems. It might be worth marking those as explicitly invalid encodings that are reserved for future expansion. |
These encodings could be used for larger values such as 512 in the future. See riscv#402
That is a good argument - I believe @jonwoodruff did some analysis here. |
These are data samples from Spec2006, averaging distributions from each of 10 benchmarks. This first set is for flat "bits of precision". It starts at 1 bit because we assume signed values. 12 reaches 100% because we're just measuring the used sizes in RISC-V code generation from CHERI ISA-v9, which only has a 12-bit immediate.
And here are results with a "scale bit" that shifts by 4, which was the point that hit the highest number of cases. Presumably this is because it facilitates pointer-aligned arithmetic. Unsurprisingly, this matches choices in the Morello ISA.
I don't know if this informs how effective adding an additional value, e.g. 512, to the spectrum. I can dig up the old scripts and add that condition in. There is at most 10% on the table (the jump from 9 bits to 10 bits; we would get a single value from the 10-bit space, but probably the most common one). |
These encodings could be used for larger values such as 512 in the future. See #402
Just to clarify, it looks like this is the data for incoffset? I would imagine the values used for setbounds are somewhat different. |
#418 is merged, so can we close this now? |
I agree the immediate issue is fixed, but maybe we should keep this open as a future enhancement to allow for larger values? |
SCBNDSI
has a 5-bit immediate,uimm
, and a gated (bys
) shift-by-4 operation, inriscv-cheri/src/insns/scbnds_32bit.adoc
Line 43 in 1c43ce2
0
(unshifed or shifted 0) and16
(unshifed 16, shifted 1). Perhaps "shifted 0" and "shifted 1" could be put to better use (as requests for512
and528
, say)?The text was updated successfully, but these errors were encountered: