From 9ffff8ae50af68d7cfccceabc4a17b4255b70d03 Mon Sep 17 00:00:00 2001 From: Tariq Kurd <59061376+tariqkurd-repo@users.noreply.github.com> Date: Mon, 23 Oct 2023 08:52:17 +0100 Subject: [PATCH 1/2] clarify when to set misa.C add rules specifying when misa.C is set Signed-off-by: Tariq Kurd <59061376+tariqkurd-repo@users.noreply.github.com> --- Zc-specification/Zc.adoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Zc-specification/Zc.adoc b/Zc-specification/Zc.adoc index 4bd996b..391f120 100644 --- a/Zc-specification/Zc.adoc +++ b/Zc-specification/Zc.adoc @@ -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 @@ -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 From 00c281cd8c42e18a5891135b2afeb89131f29844 Mon Sep 17 00:00:00 2001 From: Tariq Kurd <59061376+tariqkurd-repo@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:28:23 +0100 Subject: [PATCH 2/2] simplify the text Signed-off-by: Tariq Kurd <59061376+tariqkurd-repo@users.noreply.github.com> --- Zc-specification/Zc.adoc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Zc-specification/Zc.adoc b/Zc-specification/Zc.adoc index 391f120..41255bc 100644 --- a/Zc-specification/Zc.adoc +++ b/Zc-specification/Zc.adoc @@ -124,7 +124,7 @@ Therefore common ISA strings can be updated as follows to include the relevant Z [#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: +MISA.C is set if the following extensions are selected: * Zca and not F * Zca, Zcf and F is specified (RV32 only) @@ -133,10 +133,6 @@ If all the instructions from the C extension are present, and the MISA CSR, has * 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