Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions arch/inst/Zicond/czero.eqz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
$schema: "inst_schema.json#"
kind: instruction
name: czero.eqz
long_name: No synopsis available.
long_name: Conditional zero, if condition is equal to zero.
description: |
No description available.
If rs2 contains the value zero, this instruction writes the value zero to rd. Otherwise, this instruction
copies the contents of rs1 to rd.
This instruction carries a syntactic dependency from both rs1 and rs2 to rd. Furthermore, if the Zkt
extension is implemented, this instruction’s timing is independent of the data values in rs1 and rs2..
definedBy: Zicond
assembly: xd, xs1, xs2
encoding:
Expand All @@ -24,12 +27,21 @@ access:
vu: always
data_independent_timing: false
operation(): |
XReg input1 = X[rs1];
XReg input2 = X[rs2];
XReg output = 0;

if(input2 != 0) {
output = input1;
}

X[rd] = output;

sail(): |
{
let value = X(rs1);
let condition = X(rs2);
let result : xlenbits = if (condition != zeros()) then zeros()
let result : xlenbits = if (condition == zeros()) then zeros()
else value;
X(rd) = result;
RETIRE_SUCCESS
Expand Down
16 changes: 14 additions & 2 deletions arch/inst/Zicond/czero.nez.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
$schema: "inst_schema.json#"
kind: instruction
name: czero.nez
long_name: No synopsis available.
long_name: Conditional zero, if condition is nonzero.
description: |
No description available.
If rs2 contains a nonzero value, this instruction writes the value zero to rd. Otherwise, this
instruction copies the contents of rs1 to rd.
This instruction carries a syntactic dependency from both rs1 and rs2 to rd. Furthermore, if the Zkt
extension is implemented, this instruction’s timing is independent of the data values in rs1 and rs2.
definedBy: Zicond
assembly: xd, xs1, xs2
encoding:
Expand All @@ -24,6 +27,15 @@ access:
vu: always
data_independent_timing: false
operation(): |
XReg input1 = X[rs1];
XReg input2 = X[rs2];
XReg output = 0;

if(input2 == 0) {
output = input1;
}

X[rd] = output;

sail(): |
{
Expand Down
Loading