Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
clarify when to set misa.C
Browse files Browse the repository at this point in the history
add rules specifying when misa.C is set

Signed-off-by: Tariq Kurd <[email protected]>
  • Loading branch information
tariqkurd-repo authored Oct 23, 2023
1 parent 9d7ebba commit 9ffff8a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Zc-specification/Zc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[width="100%",options=header]
|====================================================================================
|Version | change
|v1.0.4-3 | Added misa.C clarification
|v1.0.4-2 | Added rule that C implies Zca, Zcf, Zcd - discussed in https://github.com/riscv/riscv-isa-manual/issues/1132
|v1.0.4-1 | Added rule that Zcf implies F and Zcd implies D - discussed in https://github.com/riscv/riscv-code-size-reduction/issues/221

Expand Down Expand Up @@ -120,6 +121,22 @@ Therefore common ISA strings can be updated as follows to include the relevant Z
* RV32IMC becomes RV32IM_Zce
* RV32IMCF becomes RV32IMF_Zce

[#misaC]
=== MISA.C

If all the instructions from the C extension are present, and the MISA CSR, has been implemented, then MISA.C is set. This happens if the following extensions are selected:

* Zca and not F
* Zca, Zcf and F is specified (RV32 only)
* Zca, Zcf and Zcd if D is specified (RV32 only)
** this configuration excludes Zcmp, Zcmt
* Zca, Zcd if D is specified (RV64 only)
** this configuration excludes Zcmp, Zcmt

Therefore MISA.C can be set without directly specifying the C extension.

Specifying Zce sets MISA.C if D is not implemented. If D _is_ implemented then Zce does _not_ set MISA.C as it cannot include Zcd because some of the encodings have been repurposed by Zcmp and Zcmt.

[#Zca]
=== Zca

Expand Down

0 comments on commit 9ffff8a

Please sign in to comment.