Skip to content

Commit 9cb6fd5

Browse files
authored
fix(data): correct c.addi4spn/c.addi16sp assembly syntax (#849)
riscv/sail-riscv#1045 Fixes #842
1 parent c06c703 commit 9cb6fd5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

arch/inst/C/c.addi16sp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ definedBy:
1313
anyOf:
1414
- C
1515
- Zca
16-
assembly: imm(sp)
16+
assembly: sp, imm
1717
encoding:
1818
match: 011-00010-----01
1919
variables:

arch/inst/C/c.addi4spn.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ definedBy:
1313
anyOf:
1414
- C
1515
- Zca
16-
assembly: xd, imm(sp)
16+
assembly: xd, sp, imm
1717
encoding:
1818
match: 000-----------00
1919
variables:
2020
- name: imm
2121
location: 10-7|12-11|5|6
2222
left_shift: 2
2323
not: 0
24-
- name: rd
24+
- name: xd
2525
location: 4-2
2626
access:
2727
s: always
@@ -33,4 +33,4 @@ operation(): |
3333
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
3434
}
3535
36-
X[creg2reg(rd)] = X[2] + imm;
36+
X[creg2reg(xd)] = X[2] + imm;

backends/instructions_appendix/all_instructions.golden.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,7 +3223,7 @@ Add a zero-extended non-zero immediate, scaled by 4, to the stack pointer
32233223
Encoding::
32243224
[wavedrom, ,svg,subs='attributes',width="100%"]
32253225
....
3226-
{"reg":[{"bits":2,"name": 0x0,"type":2},{"bits":3,"name": "rd","type":4},{"bits":8,"name": "imm != 0[5:4|9:6|2|3]","type":4},{"bits":3,"name": 0x0,"type":2}]}
3226+
{"reg":[{"bits":2,"name": 0x0,"type":2},{"bits":3,"name": "xd","type":4},{"bits":8,"name": "imm != 0[5:4|9:6|2|3]","type":4},{"bits":3,"name": 0x0,"type":2}]}
32273227
....
32283228

32293229
Description::
@@ -3238,7 +3238,7 @@ Decode Variables::
32383238
|===
32393239
|Variable Name |Location
32403240
|imm |{$encoding[10:7], $encoding[12:11], $encoding[5], $encoding[6], 2'd0}
3241-
|rd |$encoding[4:2]
3241+
|xd |$encoding[4:2]
32423242
|===
32433243

32443244
Included in::

0 commit comments

Comments
 (0)