Open andresag01 opened 1 year ago
@jonwoodruff also suggested to make the implementation of CSetBounds[Imm]
simpler as it no longer needs to round, so it can execute with a shorter latency than CSetBoundsInexact
which does the rounding up (and shares logic with CRAM/CRRL
)
CHERI-RISC-V currently has the following instructions to set a capability's bounds:
Currently (1) and (2) round down the base and round up the length while (3) does the same but clears the tag if rounding was required. Ideally, software is aware of the rounding and most commonly uses (3) instead of (2)/(1), so it would be ideal to change these instructions into:
A further proposal is also to eliminate CSetBoundsInexact altogether because it could be emulated with the new CSetBounds followed by CBuildCap although it is not a very natural way of performing that operation.