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

Commit

Permalink
Merge pull request #4 from riscv/dvt-normative
Browse files Browse the repository at this point in the history
Make DVIT property normative
  • Loading branch information
ptomsich authored Feb 22, 2023
2 parents 9e8a541 + 18f87bf commit c488952
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions zicondops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,16 @@ Encoding::

Description::
This instruction behaves as if there is a conditional branch dependent on _rs2_ being equal to zero, wherein it branches to code that writes a 0 into _rd_ when the equivalence is true, and otherwise falls through to code that moves _rs1_ into _rd_.
Accordingly, the syntactic dependency on _rs1_ is only propagated when the condition is false. +
Accordingly, the syntactic dependency on _rs1_ is only propagated when the condition is false.
Furthermore, this instruction's timing is independent of the data value of _rs1_ if the Zkt extension is implemented. +

In effect, if the value of register _rs2_ is zero, place 0 (zero) into the register _rd_; otherwise, place the value of register _rs1_ into _rd_.

[NOTE]
====
These branch-based semantics do not prevent implementing this instruction as a simple select (e.g., "(rs2==0) ? 0 : rs1").
Instead, they allow for more sophisticated implementations where a zero-result can be returned when the condition (rs2==0) is true without waiting for _rs1_ to be available.
Instead, they allow for more sophisticated implementations where a zero result can be returned when the condition (rs2==0) is true without waiting for _rs1_ to be available.
Furthermore, implementations can predict the condition just as they might for branches.
As a consequence of this instruction's equivalence to `mv rd, rs1` when _rs2_ is nonzero, this instruction's timing is independent of the data value of _rs1_ if the Zkt extension is implemented.
====

SAIL code::
Expand Down Expand Up @@ -137,17 +136,16 @@ Encoding::

Description::
This instruction behaves as if there is a conditional branch dependent on _rs2_ being not equal to zero, wherein it branches to code that writes a 0 into _rd_ when the equivalence is true, and otherwise falls through to code that moves _rs1_ into _rd_.
Accordingly, the syntactic dependency on _rs1_ is only propagated when the condition is false. +
Accordingly, the syntactic dependency on _rs1_ is only propagated when the condition is false.
Furthermore, this instruction's timing is independent of the data value of _rs1_ if the Zkt extension is implemented. +

In effect, if the value of register _rs2_ is non-zero, place 0 (zero) into the register _rd_; otherwise, place the value of register _rs1_ into _rd_.

[NOTE]
====
These branch-based semantics do not prevent implementing this instruction as a simple select (e.g., "(rs2!=0) ? 0 : rs1").
Instead, they allow for more sophisticated implementations where a zero-result can be returned when the condition (rs2!=0) is true without waiting for _rs1_ to be available.
Instead, they allow for more sophisticated implementations where a zero result can be returned when the condition (rs2!=0) is true without waiting for _rs1_ to be available.
Furthermore, implementations can predict the condition just as they might for branches.
As a consequence of this instruction's equivalence to `mv rd, rs1` when _rs2_ is zero, this instruction's timing is independent of the data value of _rs1_ if the Zkt extension is implemented.
====

SAIL code::
Expand Down

0 comments on commit c488952

Please sign in to comment.