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

Commit

Permalink
non-normative: add guidance for Zkt alternative sequences
Browse files Browse the repository at this point in the history
Added a section of alternative sequences that can be built up using Zkt
instructions, as requested in today's Tech Chairs.
  • Loading branch information
ptomsich committed Jan 25, 2023
1 parent ccb2e33 commit 4edbea4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion header.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[header]]
:description: RISC-V Integer Conditional (Zicond) operations extension
:company: RISC-V.org
:revdate: 9/2022
:revdate: 2023-01-25
:revnumber: 1.0
:revremark: This document is in development. Assume everything can change. See http://riscv.org/spec-state for details.
:url-riscv: http://riscv.org
Expand Down
23 changes: 23 additions & 0 deletions zicondops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,29 @@ or rd, rd, rtmp

|===

=== Alternative sequences with data-invariant timing

The definition of `czero.eqz` and `czero.nez` does not generally guarantee data-invariant timing (although it guarantees independence of the value of one of its arguments, if the Zkt extension is implemented).

However, sequences using instructions covered by Zkt are available to express the same semantics as for the `czero.eqz` and `czero.nez` instructions:

[%header,cols="2,.^4l"]
|===
|Zicond instruction
|Alternative sequence with data-invariant timing

|`czero.eqz rd, rs1, rs2`
|snez rtmp, rs2
neg rtmp, rtmp
and rd, rtmp, rs1

|`czero.nez rd, rs1, rs2`
|seqz rtmp, rs2
neg rtmp, rtmp
and rd, rtmp, rs1

|===

== Instructions (in alphabetical order)

<<<
Expand Down

0 comments on commit 4edbea4

Please sign in to comment.