← Home

ct.cjalr

Capability register cd is replaced with the next instruction's PCC and sealed as a sentry. PCC is replaced with the value of capability register cs1 with its address incremented by imm and the 0th bit of its address set to 0, and is unsealed if it is a sentry. Exceptions An exception is raised if: - cs1.tag is not set. - cs1 is sealed and imm != 0 - None of the following combinations hold: 1. cd = cnull, cs1 = cra and cs1 is a backwards sentry (Function return aka cret is only permitted to backwards sentry) 2. cd = cnull, cs1 ne cra and cs1 is unsealed or a forwards interrupt inheriting sentry (Tail calls are only permitted to unsealed caps or interrupt handling sentry using a target register different from cra, with the return register cra set by a different instruction) 3. cd != cnull and cs1 is unsealed or a forwards interrupt inheriting sentry (Less restricted function calls to interrupt inheriting sentries) 4. cd = cra and cs1 is unsealed or a forwards sentry (Function calls are only permitted to unsealed caps or forwards sentry, with link register cra) - cs1.perms does not grant Permit_Execute. - cs1.address + imm is unaligned, ignoring bit 0. Notes - This instruction no longer attempts to check that the destination is within the bounds of PCC. In that case an exception will be raised raised by the subsequent instruction fetch. EPCC will have the new PC as address but will have the tag cleared due to the possibility of creating an unrepresentable PCC. The bounds of EPCC will be undefined.

Assembly format

ct.cjalr cd, cs1, imm

Encoding

313029282726252423222120191817161514131211109876543210
immcs1000cd1100111

Decode variables

VariableBitsWidth
imm[31:20]12
cs1[19:15]5
cd[11:7]5

No execution pseudocode is available for this instruction.

Defined by

Xcheriot

Access

SU
AlwaysAlways

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.