On 10/2/2025 3:55 PM, 'Craig Topper' via RISC-V ISA Dev wrote:
> The 0.93 spec contained 10 Zb* extensions. CMOV was part of Zbt. Only 4
> of those extensions were chosen to move forward for ratification, Zba,
> Zbb, Zbs, and Zbc. The 0.94 spec contains only those 4 extensions that
> were chosen to move forward. I think the main reason CMOV wasn't pursued
> is because it requires reading 3 sources which may require an additional
> register file read port to be implemented in hardware.
>
IMHO, categorically disallowing 3R1W encodings is overly limiting:
Indexed Store;
Integer Multiply-Accumulate;
Conditional Move/Select;
Funnel Shift;
...
Makes more sense merely to optimize for 2R1W, but then allow 3R1W
instructions to be optionally supported for implementations where doing
so is not a significant burden (eg: 2 or 3 wide in-order superscalar
machines, etc).
In these cases, 3R1W instructions may reduce effective pipeline width,
but can bring more benefit than they cost.
As I understand it, 3R1W is more of an inconvenience for OoO machines,
but these processors are far more in a position to "eat the cost" than
in the other categories.
And, for small microcontrollers, they are more in a position to simply
omit supporting them.
Though, as I can note, even within my own "feature wishlist" for
mainline RISC-V, the most useful instructions can still be done within a
2R1W configuration.
So, it is more of a "what feature has enough value-added to crack the
ice?" thing...
> -Craig
>
> On Thursday, October 2, 2025 at 1:43:13 PM UTC-7 Vadím Sukhomlínov wrote:
>
> Hi All,
>
> I'm looking for the justification on why ternary `cmov` was removed.
> It looks like it was in v0.93 (
https://github.com/riscv/riscv-
> bitmanip/releases/download/v0.93/bitmanip-0.93.pdf <https://
>
github.com/riscv/riscv-bitmanip/releases/download/v0.93/
> bitmanip-0.93.pdf>), but not in 0.94.60 (
https://github.com/riscv/
> riscv-bitmanip/releases/tag/v0.94.60 <
https://github.com/riscv/
> riscv-bitmanip/releases/tag/v0.94.60>).
>
> An "initial conversion" (
https://github.com/riscv/riscv-bitmanip/
> commit/08dea82df087bdd852711a88366849741ff126bf <
https://github.com/
> riscv/riscv-bitmanip/
> commit/08dea82df087bdd852711a88366849741ff126bf>) conversion marking
> start of the 0.94.60 already don't have it - could it be lost in
> some broken automated process?
>
> cmov is highly useful for the security focused implementations as it
> has better properties against side-channel attacks vs. proposed by -
> Zicond sequence:
> ```
> czero.eqz rd, rs1, rc
> czero.nez rtmp, rs2, rc
> or rd, rd, rtmp
> ```
>
> Regards,
> Vadim
>
> --
> You received this message because you are subscribed to the Google
> Groups "RISC-V ISA Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
isa-dev+u...@groups.riscv.org <mailto:
isa-
>
dev+uns...@groups.riscv.org>.
> To view this discussion visit
https://groups.google.com/a/
>
groups.riscv.org/d/msgid/isa-
> dev/7eded9d5-20a1-4ba2-84dc-18bd8b66871dn%
40groups.riscv.org <https://
>
groups.google.com/a/groups.riscv.org/d/msgid/isa-
> dev/7eded9d5-20a1-4ba2-84dc-18bd8b66871dn%
40groups.riscv.org?
> utm_medium=email&utm_source=footer>.