Skip to content

Commit

Permalink
gas/doc/riscv: Fixed misaligned instruction table
Browse files Browse the repository at this point in the history
gas/
	* doc/c-riscv.texi: Fixed misaligned instruction table.
  • Loading branch information
Nelson Chu committed Oct 31, 2024
1 parent 004a5bf commit 6c4f88a
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions gas/doc/c-riscv.texi
Original file line number Diff line number Diff line change
Expand Up @@ -556,45 +556,45 @@ with the @samp{.insn} pseudo directive:
@table @code
@item R type: .insn r opcode7, funct3, funct7, rd, rs1, rs2
@verbatim
+-------+-----+-----+-------+----+---------+
+--------+-----+-----+--------+----+---------+
| funct7 | rs2 | rs1 | funct3 | rd | opcode7 |
+-------+-----+-----+-------+----+---------+
31 25 20 15 12 7 0
+--------+-----+-----+--------+----+---------+
31 25 20 15 12 7 0
@end verbatim

@item R type with 4 register operands: .insn r opcode7, funct3, funct2, rd, rs1, rs2, rs3
@itemx R4 type: .insn r4 opcode7, funct3, funct2, rd, rs1, rs2, rs3
@verbatim
+-----+-------+-----+-----+-------+----+---------+
+-----+--------+-----+-----+--------+----+---------+
| rs3 | funct2 | rs2 | rs1 | funct3 | rd | opcode7 |
+-----+-------+-----+-----+-------+----+---------+
31 27 25 20 15 12 7 0
+-----+--------+-----+-----+--------+----+---------+
31 27 25 20 15 12 7 0
@end verbatim

@item I type: .insn i opcode7, funct3, rd, rs1, simm12
@itemx I type: .insn i opcode7, funct3, rd, simm12(rs1)
@verbatim
+--------------+-----+-------+----+---------+
+--------------+-----+--------+----+---------+
| simm12[11:0] | rs1 | funct3 | rd | opcode7 |
+--------------+-----+-------+----+---------+
31 20 15 12 7 0
+--------------+-----+--------+----+---------+
31 20 15 12 7 0
@end verbatim

@item S type: .insn s opcode7, funct3, rs2, simm12(rs1)
@verbatim
+--------------+-----+-----+-------+-------------+---------+
+--------------+-----+-----+--------+-------------+---------+
| simm12[11:5] | rs2 | rs1 | funct3 | simm12[4:0] | opcode7 |
+--------------+-----+-----+-------+-------------+---------+
31 25 20 15 12 7 0
+--------------+-----+-----+--------+-------------+---------+
31 25 20 15 12 7 0
@end verbatim

@item B type: .insn s opcode7, funct3, rs1, rs2, symbol
@itemx SB type: .insn sb opcode7, funct3, rs1, rs2, symbol
@verbatim
+-----------------+-----+-----+-------+----------------+---------+
+-----------------+-----+-----+--------+----------------+---------+
| simm12[12|10:5] | rs2 | rs1 | funct3 | simm12[4:1|11] | opcode7 |
+-----------------+-----+-----+-------+----------------+---------+
31 25 20 15 12 7 0
+-----------------+-----+-----+--------+----------------+---------+
31 25 20 15 12 7 0
@end verbatim

@item U type: .insn u opcode7, rd, simm20
Expand All @@ -616,74 +616,74 @@ with the @samp{.insn} pseudo directive:

@item CR type: .insn cr opcode2, funct4, rd, rs2
@verbatim
+-------+--------+-----+---------+
+--------+--------+-----+---------+
| funct4 | rd/rs1 | rs2 | opcode2 |
+-------+--------+-----+---------+
15 12 7 2 0
+--------+--------+-----+---------+
15 12 7 2 0
@end verbatim

@item CI type: .insn ci opcode2, funct3, rd, simm6
@verbatim
+-------+----------+--------+------------+---------+
+--------+----------+--------+------------+---------+
| funct3 | simm6[5] | rd/rs1 | simm6[4:0] | opcode2 |
+-------+----------+--------+------------+---------+
15 13 12 7 2 0
+--------+----------+--------+------------+---------+
15 13 12 7 2 0
@end verbatim

@item CIW type: .insn ciw opcode2, funct3, rd', uimm8
@verbatim
+-------+------------+-----+---------+
+--------+------------+-----+---------+
| funct3 | uimm8[7:0] | rd' | opcode2 |
+-------+-------- ---+-----+---------+
15 13 5 2 0
+--------+-------- ---+-----+---------+
15 13 5 2 0
@end verbatim

@item CSS type: .insn css opcode2, funct3, rd, uimm6
@verbatim
+-------+------------+----+---------+
+--------+------------+----+---------+
| funct3 | uimm6[5:0] | rd | opcode2 |
+-------+------------+----+---------+
15 13 7 2 0
+--------+------------+----+---------+
15 13 7 2 0
@end verbatim

@item CL type: .insn cl opcode2, funct3, rd', uimm5(rs1')
@verbatim
+-------+------------+------+------------+------+---------+
+--------+------------+------+------------+------+---------+
| funct3 | uimm5[4:2] | rs1' | uimm5[1:0] | rd' | opcode2 |
+-------+------------+------+------------+------+---------+
15 13 10 7 5 2 0
+--------+------------+------+------------+------+---------+
15 13 10 7 5 2 0
@end verbatim

@item CS type: .insn cs opcode2, funct3, rs2', uimm5(rs1')
@verbatim
+-------+------------+------+------------+------+---------+
+--------+------------+------+------------+------+---------+
| funct3 | uimm5[4:2] | rs1' | uimm5[1:0] | rs2' | opcode2 |
+-------+------------+------+------------+------+---------+
15 13 10 7 5 2 0
+--------+------------+------+------------+------+---------+
15 13 10 7 5 2 0
@end verbatim

@item CA type: .insn ca opcode2, funct6, funct2, rd', rs2'
@verbatim
+-- ----+----------+-------+------+---------+
+--------+----------+--------+------+---------+
| funct6 | rd'/rs1' | funct2 | rs2' | opcode2 |
+-------+----------+-------+------+---------+
15 10 7 5 2 0
+--------+----------+--------+------+---------+
15 10 7 5 2 0
@end verbatim

@item CB type: .insn cb opcode2, funct3, rs1', symbol
@verbatim
+-------+--------------+------+------------------+---------+
+--------+--------------+------+------------------+---------+
| funct3 | simm8[8|4:3] | rs1' | simm8[7:6|2:1|5] | opcode2 |
+-------+--------------+------+------------------+---------+
15 13 10 7 2 0
+--------+--------------+------+------------------+---------+
15 13 10 7 2 0
@end verbatim

@item CJ type: .insn cj opcode2, funct3, symbol
@verbatim
+-------+-------------------------------+---------+
+--------+-------------------------------+---------+
| funct3 | simm11[11|4|9:8|10|6|7|3:1|5] | opcode2 |
+-------+-------------------------------+---------+
15 13 2 0
+--------+-------------------------------+---------+
15 13 2 0
@end verbatim


Expand Down

0 comments on commit 6c4f88a

Please sign in to comment.