Skip to content

Commit

Permalink
Merge pull request #76 from tariqkurd-repo/fix-issue-58
Browse files Browse the repository at this point in the history
clarify PCC bounds after zcmt instruction
  • Loading branch information
andresag01 authored Jan 31, 2024
2 parents be9b125 + aa7fb69 commit 4b6d984
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/insns/cjal_jal_32bit.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<<<
//[#insns-cjal_jal-32bit,reftext="Jumps (CJAL, JAL), 32-bit encodings"]

[#CJ,reftext="CJ"]
==== CJ

Expands to <<CJAL>> following the expansion rule for <<J>> expanding to <<JAL>> from cite:[riscv-unpriv-spec].

[#J,reftext="J"]
==== J

Expands to <<JAL>> following the expansion rule from cite:[riscv-unpriv-spec].

[#CJAL,reftext="CJAL"]
==== CJAL

Expand Down
10 changes: 10 additions & 0 deletions src/insns/cjalr_jalr_32bit.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<<<

[#CJR,reftext="CJR"]
==== CJR

Expands to <<CJALR>> following the expansion rule for <<JR>> expanding to <<JARL>> from cite:[riscv-unpriv-spec].

[#JR,reftext="JR"]
==== JR

Expands to <<JALR>> following the expansion rule from cite:[riscv-unpriv-spec].

[#CJALR,reftext="CJALR"]
==== CJALR

Expand Down
13 changes: 12 additions & 1 deletion src/instructions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,18 @@ include::img/jvtcreg.edn[]

All instruction fetches from the jump vector table are checked against <<jvtc>>.

See <<CM.CJALT>>, <<CM.JALT>>, <<CM.CJT>>, <<CM.JT>>.
See <<CM_CJALT>>, <<CM_JALT>>, <<CM_CJT>>, <<CM_JT>>.

If the access to the jump table succeeds, then the instructions execute as follows:

* In capability mode
** <<CM_JT>> executes as <<CJ>> or <<AUIPCC>>+<<CJR>>
** <<CM_JALT>> executes as <<CJAL>> or <<AUIPCC>>+<<CJALR>>
* In legacy mode
** <<CM_JT>> executes as <<J>> or <<AUIPC>>+<<JR>>
** <<CM_JALT>> executes as <<JAL>> or <<AUIPC>>+<<JALR>>
As a result the capability metadata is retained in the <<pcc>> during execution.

include::insns/zcmt_cmjalt.adoc[]

Expand Down

0 comments on commit 4b6d984

Please sign in to comment.