Skip to content

Commit 291f78f

Browse files
Add long_name and description to AES and CSR instructions (#689)
This PR adds missing long_name and description to the following AES and CSR instructions: - aes64ks1i - aes64ks2 - es64ds - aes64dsm - aes64im - aes64es - aes64esm - csrrc - csrrci - csrrsi
1 parent de3ea3e commit 291f78f

File tree

10 files changed

+89
-21
lines changed

10 files changed

+89
-21
lines changed

arch/inst/Zicsr/csrrc.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,25 @@
33
$schema: inst_schema.json#
44
kind: instruction
55
name: csrrc
6-
long_name: No synopsis available
6+
long_name: Atomic Read and Clear Bits in CSR
77
description: |
8-
No description available.
8+
-id: inst-csrrc-behavior
9+
-normative: false
10+
-text: |
11+
The CSRRC (Atomic Read and Clear Bits in CSR) instruction reads the value of the CSR, zero-extends
12+
the value to XLEN bits, and writes it to integer register `rd`. The initial value in integer register `rs1` is
13+
treated as a bit mask that specifies bit positions to be cleared in the CSR. Any bit that is high in `rs1` will
14+
cause the corresponding bit to be cleared in the CSR, if that CSR bit is writable.
15+
16+
For CSRRC, if `rs1=x0`, then the instruction will not write to the CSR at all, and so shall
17+
not cause any of the side effects that might otherwise occur on a CSR write, nor raise illegal-
18+
instruction exceptions on accesses to read-only CSRs. CSRRC always reads the addressed CSR and
19+
cause any read side effects regardless of `rs1` and `rd` fields.
20+
Note that if `rs1` specifies a register other than `x0`, and that register holds a zero value,
21+
the instruction will not action any attendant per-field side effects, but will action any
22+
side effects caused by writing to the entire CSR.
923
definedBy: Zicsr
10-
assembly: xd, imm, xs1
24+
assembly: xd, csr, xs1
1125
encoding:
1226
match: -----------------011-----1110011
1327
variables:

arch/inst/Zicsr/csrrci.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
$schema: inst_schema.json#
44
kind: instruction
55
name: csrrci
6-
long_name: No synopsis available
6+
long_name: Atomic Read and Clear Bits in CSR with Immediate
77
description: |
8-
No description available.
8+
-id: inst-csrrci-behavior
9+
-normative: false
10+
-text: |
11+
The CSRRCI variant is similar to CSRRC, except this updates the CSR using an XLEN-bit value obtained
12+
by zero-extending a 5-bit unsigned immediate (uimm[4:0]) field encoded in the `rs1` field instead of a
13+
value from an integer register. For CSRRCI, if the `uimm[4:0]` field is zero, then this instruction
14+
will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on
15+
a CSR write, nor raise illegal-instruction exceptions on accesses to read-only CSRs. The CSRRCI will
16+
always read the CSR and cause any read side effects regardless of `rd` and `rs1` fields.
917
definedBy: Zicsr
1018
assembly: xd, csr, uimm
1119
encoding:

arch/inst/Zicsr/csrrsi.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
$schema: inst_schema.json#
44
kind: instruction
55
name: csrrsi
6-
long_name: No synopsis available
6+
long_name: Atomic Read and Set Bits in CSR with Immediate
77
description: |
8-
No description available.
8+
-id: inst-csrrsi-behavior
9+
-normative: false
10+
-text: |
11+
The CSRRSI variant is similar to CSRRS, except this updates the CSR using an XLEN-bit value obtained
12+
by zero-extending a 5-bit unsigned immediate (uimm[4:0]) field encoded in the `rs1` field instead of a
13+
value from an integer register. For CSRRSI, if the `uimm[4:0]` field is zero, then this instruction
14+
will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on
15+
a CSR write, nor raise illegal-instruction exceptions on accesses to read-only CSRs. The CSRRSI will
16+
always read the CSR and cause any read side effects regardless of `rd` and `rs1` fields.
917
definedBy: Zicsr
1018
assembly: xd, csr, uimm
1119
encoding:

arch/inst/Zkn/aes64ks1i.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: aes64ks1i
6-
long_name: No synopsis available
6+
long_name: AES Key Schedule Instruction 1
77
description: |
8-
No description available.
8+
-id: inst-aes64ks1i-behavior
9+
-normative: true
10+
-text: |
11+
This instruction implements the rotation, SubBytes and Round Constant addition steps of the AES
12+
block cipher Key Schedule. This instruction must _always_ be implemented such that its execution
13+
latency does not depend on the data being operated on. Note that `rnum` must be in the range
14+
`0x0..0xA`. The values `0xB..0xF` are reserved.
915
definedBy:
1016
anyOf: [Zknd, Zkne]
1117
base: 64

arch/inst/Zkn/aes64ks2.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: aes64ks2
6-
long_name: No synopsis available
6+
long_name: AES Key Schedule Instruction 2
77
description: |
8-
No description available.
8+
-id: instr-aes64ks2-behavior
9+
-normative: true
10+
-text: |
11+
This instruction implements the additional XOR'ing of key words as part of the AES block cipher
12+
Key Schedule. This instruction must _always_ be implemented such that its execution latency does
13+
not depend on the data being operated on.
914
definedBy:
1015
anyOf: [Zknd, Zkne]
1116
base: 64

arch/inst/Zknd/aes64ds.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: aes64ds
6-
long_name: No synopsis available
6+
long_name: AES decrypt final round
77
description: |
8-
No description available.
8+
-id: inst-aes64ds-behavior
9+
-normative: true
10+
-text: |
11+
Uses the two 64-bit source registers to represent the entire AES state, and produces _half_ of the next
12+
round output, applying the Inverse ShiftRows and SubBytes steps. This instruction must _always_ be
13+
implemented such that its execution latency does not depend on the data being operated on.
914
definedBy: Zknd
1015
base: 64
1116
assembly: xd, xs1, xs2

arch/inst/Zknd/aes64dsm.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: aes64dsm
6-
long_name: No synopsis available
6+
long_name: AES decrypt middle round
77
description: |
8-
No description available.
8+
-id: inst-aes64dsm-behavior
9+
-normative: true
10+
-text: |
11+
Uses the two 64-bit source registers to represent the entire AES state, and produces _half_ of the next
12+
round output, applying the Inverse ShiftRows, SubBytes and MixColumns steps. This instruction must _always_
13+
be implemented such that its execution latency does not depend on the data being operated on.
914
definedBy: Zknd
1015
base: 64
1116
assembly: xd, xs1, xs2

arch/inst/Zknd/aes64im.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: aes64im
6-
long_name: No synopsis available
6+
long_name: AES Decrypt KeySchedule MixColumns
77
description: |
8-
No description available.
8+
-id: inst-aes64im-behavior
9+
-normative: true
10+
-text: |
11+
The instruction applies the inverse MixColumns transformation to two columns of the state array,
12+
packed into a single 64-bit register. It is used to create the inverse cipher KeySchedule, according to
13+
the equivalent inverse cipher construction in (NIST, 2001) (Page 23, Section 5.3.5). This
14+
instruction must always be implemented such that its execution latency does not depend on the
15+
data being operated on.
916
definedBy: Zknd
1017
base: 64
1118
assembly: xd, xs1

arch/inst/Zkne/aes64es.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: aes64es
6-
long_name: No synopsis available
6+
long_name: AES encrypt final round
77
description: |
8-
No description available.
8+
-id: inst-aes64es-behavior
9+
-normative: true
10+
-text: |
11+
Uses the two 64-bit source registers to represent the entire AES state, and produces _half_ of the next
12+
round output, applying the ShiftRows and SubBytes steps. This instruction must _always_ be
13+
implemented such that its execution latency does not depend on the data being operated on.
914
definedBy: Zkne
1015
base: 64
1116
assembly: xd, xs1, xs2

arch/inst/Zkne/aes64esm.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: aes64esm
6-
long_name: No synopsis available
6+
long_name: AES encrypt middle round
77
description: |
8-
No description available.
8+
-id: inst-aes64esm-behavior
9+
-normative: true
10+
-text: |
11+
Uses the two 64-bit source registers to represent the entire AES state, and produces _half_ of the next
12+
round output, applying the Inverse ShiftRows, SubBytes and MixColumns steps. This instruction must _always_
13+
be implemented such that its execution latency does not depend on the data being operated on.
914
definedBy: Zkne
1015
base: 64
1116
assembly: xd, xs1, xs2

0 commit comments

Comments
 (0)