Should C.ADD(I) be C.CADD(I) in capability mode? #307
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
question
Further information is requested
There is no compressed pointer add other than the SP-relative ones in capability mode. This means e.g. pointer arithmetic loops have to use uncompressed instructions.
Should we remap these instructions to the capability versions in capability mode?
In most cases it should be possible to use the capability op for an integer operation as long as the compiler knows the input is already guaranteed to be untagged. Unclear what percentage of instructions would still need to explicitly use the integer version.
The downside would be that we do need a representability check and have to use the CHERI ALU rather than the integer one for these instructions. Should not matter for simple cores but might be an issue for larger ones.
Would need to estimate how much code size savings could be made by this change. A simple approximation could be to always use c.cadd(i) for both integer and capability adds and compare that to the current code generation.
The text was updated successfully, but these errors were encountered: