diff options
author | Andrew Waterman <waterman@s144.Millennium.Berkeley.EDU> | 2010-11-05 14:06:12 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@s144.Millennium.Berkeley.EDU> | 2010-11-21 16:54:33 -0800 |
commit | 54aec7dfe21f3ef0684a27f4545d668a20bce1f8 (patch) | |
tree | f13ee25eca6666bfd342ad64aa8f83564f467c7b | |
parent | 65721333eb55a580b86c0837ced29ebde36f1b3b (diff) | |
download | riscv-opcodes-54aec7dfe21f3ef0684a27f4545d668a20bce1f8.zip riscv-opcodes-54aec7dfe21f3ef0684a27f4545d668a20bce1f8.tar.gz riscv-opcodes-54aec7dfe21f3ef0684a27f4545d668a20bce1f8.tar.bz2 |
[xcc, sim, pk, opcodes] new instruction encoding!
-rw-r--r-- | inst.v | 329 | ||||
-rw-r--r-- | instr-table.tex | 877 | ||||
-rw-r--r-- | opcodes | 427 | ||||
-rwxr-xr-x | parse-opcodes | 68 |
4 files changed, 812 insertions, 889 deletions
@@ -2,178 +2,177 @@ `define J 32'b1100000_????????????????????????? `define JAL 32'b1100001_????????????????????????? `define LUI 32'b1110001_?????_???????????????????? -`define BEQ 32'b1110011_?????_?????_000_???????????? -`define BNE 32'b1110011_?????_?????_001_???????????? -`define BLT 32'b1110011_?????_?????_100_???????????? -`define BGE 32'b1110011_?????_?????_101_???????????? -`define BLTU 32'b1110011_?????_?????_110_???????????? -`define BGEU 32'b1110011_?????_?????_111_???????????? +`define JALR_C 32'b1110010_?????_?????_000_???????????? +`define JALR_R 32'b1110010_?????_?????_000_???????????? +`define JALR_J 32'b1110010_?????_?????_000_???????????? +`define BEQ 32'b1110011_?????_?????_000_000000000000 +`define BNE 32'b1110011_?????_?????_000_000000000000 +`define BLT 32'b1110011_?????_?????_000_000000000000 +`define BGE 32'b1110011_?????_?????_000_000000000000 +`define BLTU 32'b1110011_?????_?????_000_000000000000 +`define BGEU 32'b1110011_?????_?????_000_000000000000 `define ADDI 32'b1110100_?????_?????_000_???????????? -`define SLTI 32'b1110100_?????_?????_010_???????????? -`define SLTIU 32'b1110100_?????_?????_011_???????????? -`define ANDI 32'b1110100_?????_?????_100_???????????? -`define ORI 32'b1110100_?????_?????_101_???????????? -`define XORI 32'b1110100_?????_?????_110_???????????? -`define SLLI 32'b1110100_?????_?????_111000001_?????? -`define SRLI 32'b1110100_?????_?????_111000010_?????? -`define SRAI 32'b1110100_?????_?????_111000011_?????? +`define SLTI 32'b1110100_?????_?????_000_???????????? +`define SLTIU 32'b1110100_?????_?????_000_???????????? +`define ANDI 32'b1110100_?????_?????_000_???????????? +`define ORI 32'b1110100_?????_?????_000_???????????? +`define XORI 32'b1110100_?????_?????_000_???????????? +`define SLLI 32'b1110100_?????_?????_000000000_?????? +`define SRLI 32'b1110100_?????_?????_000000000_?????? +`define SRAI 32'b1110100_?????_?????_000000000_?????? `define ADD 32'b1110101_?????_?????_0000000000_????? -`define SUB 32'b1110101_?????_?????_0000000001_????? -`define SLT 32'b1110101_?????_?????_0000000010_????? -`define SLTU 32'b1110101_?????_?????_0000000011_????? -`define AND 32'b1110101_?????_?????_0000000100_????? -`define OR 32'b1110101_?????_?????_0000000101_????? -`define XOR 32'b1110101_?????_?????_0000000110_????? -`define NOR 32'b1110101_?????_?????_0000000111_????? -`define SLL 32'b1110101_?????_?????_1110000010_????? -`define SRL 32'b1110101_?????_?????_1110000100_????? -`define SRA 32'b1110101_?????_?????_1110000110_????? -`define MUL 32'b1110101_?????_?????_0010000000_????? -`define MULH 32'b1110101_?????_?????_0010000010_????? -`define MULHU 32'b1110101_?????_?????_0010000011_????? -`define DIV 32'b1110101_?????_?????_0010000100_????? -`define DIVU 32'b1110101_?????_?????_0010000101_????? -`define REM 32'b1110101_?????_?????_0010000110_????? -`define REMU 32'b1110101_?????_?????_0010000111_????? +`define SUB 32'b1110101_?????_?????_0000000000_????? +`define SLT 32'b1110101_?????_?????_0000000000_????? +`define SLTU 32'b1110101_?????_?????_0000000000_????? +`define AND 32'b1110101_?????_?????_0000000000_????? +`define OR 32'b1110101_?????_?????_0000000000_????? +`define XOR 32'b1110101_?????_?????_0000000000_????? +`define NOR 32'b1110101_?????_?????_0000000000_????? +`define SLL 32'b1110101_?????_?????_0000000000_????? +`define SRL 32'b1110101_?????_?????_0000000000_????? +`define SRA 32'b1110101_?????_?????_0000000000_????? +`define MUL 32'b1110101_?????_?????_0000000000_????? +`define MULH 32'b1110101_?????_?????_0000000000_????? +`define MULHU 32'b1110101_?????_?????_0000000000_????? +`define DIV 32'b1110101_?????_?????_0000000000_????? +`define DIVU 32'b1110101_?????_?????_0000000000_????? +`define REM 32'b1110101_?????_?????_0000000000_????? +`define REMU 32'b1110101_?????_?????_0000000000_????? `define ADDIW 32'b1110110_?????_?????_000_???????????? -`define SLLIW 32'b1110110_?????_?????_111000001_0_????? -`define SRLIW 32'b1110110_?????_?????_111000010_0_????? -`define SRAIW 32'b1110110_?????_?????_111000011_0_????? +`define SLLIW 32'b1110110_?????_?????_000000000_0_????? +`define SRLIW 32'b1110110_?????_?????_000000000_0_????? +`define SRAIW 32'b1110110_?????_?????_000000000_0_????? `define ADDW 32'b1110111_?????_?????_0000000000_????? -`define SUBW 32'b1110111_?????_?????_0000000001_????? -`define SLLW 32'b1110111_?????_?????_1110000010_????? -`define SRLW 32'b1110111_?????_?????_1110000100_????? -`define SRAW 32'b1110111_?????_?????_1110000110_????? -`define MULW 32'b1110111_?????_?????_0010000000_????? -`define MULHW 32'b1110111_?????_?????_0010000010_????? -`define MULHUW 32'b1110111_?????_?????_0010000011_????? -`define DIVW 32'b1110111_?????_?????_0010000100_????? -`define DIVUW 32'b1110111_?????_?????_0010000101_????? -`define REMW 32'b1110111_?????_?????_0010000110_????? -`define REMUW 32'b1110111_?????_?????_0010000111_????? +`define SUBW 32'b1110111_?????_?????_0000000000_????? +`define SLLW 32'b1110111_?????_?????_0000000000_????? +`define SRLW 32'b1110111_?????_?????_0000000000_????? +`define SRAW 32'b1110111_?????_?????_0000000000_????? +`define MULW 32'b1110111_?????_?????_0000000000_????? +`define MULHW 32'b1110111_?????_?????_0000000000_????? +`define MULHUW 32'b1110111_?????_?????_0000000000_????? +`define DIVW 32'b1110111_?????_?????_0000000000_????? +`define DIVUW 32'b1110111_?????_?????_0000000000_????? +`define REMW 32'b1110111_?????_?????_0000000000_????? +`define REMUW 32'b1110111_?????_?????_0000000000_????? `define LB 32'b1111000_?????_?????_000_???????????? -`define LH 32'b1111000_?????_?????_001_???????????? -`define LW 32'b1111000_?????_?????_010_???????????? -`define LD 32'b1111000_?????_?????_011_???????????? -`define LBU 32'b1111000_?????_?????_100_???????????? -`define LHU 32'b1111000_?????_?????_101_???????????? -`define LWU 32'b1111000_?????_?????_110_???????????? -`define SYNCI 32'b1111000_00000_?????_111_???????????? -`define SB 32'b1111001_?????_?????_000_???????????? -`define SH 32'b1111001_?????_?????_001_???????????? -`define SW 32'b1111001_?????_?????_010_???????????? -`define SD 32'b1111001_?????_?????_011_???????????? -`define AMOW_ADD 32'b1111010_?????_?????_0100000000_????? -`define AMOW_SWAP 32'b1111010_?????_?????_0100000001_????? -`define AMOW_AND 32'b1111010_?????_?????_0100000010_????? -`define AMOW_OR 32'b1111010_?????_?????_0100000011_????? -`define AMOW_MIN 32'b1111010_?????_?????_0100000100_????? -`define AMOW_MAX 32'b1111010_?????_?????_0100000101_????? -`define AMOW_MINU 32'b1111010_?????_?????_0100000110_????? -`define AMOW_MAXU 32'b1111010_?????_?????_0100000111_????? -`define AMO_ADD 32'b1111010_?????_?????_0110000000_????? -`define AMO_SWAP 32'b1111010_?????_?????_0110000001_????? -`define AMO_AND 32'b1111010_?????_?????_0110000010_????? -`define AMO_OR 32'b1111010_?????_?????_0110000011_????? -`define AMO_MIN 32'b1111010_?????_?????_0110000100_????? -`define AMO_MAX 32'b1111010_?????_?????_0110000101_????? -`define AMO_MINU 32'b1111010_?????_?????_0110000110_????? -`define AMO_MAXU 32'b1111010_?????_?????_0110000111_????? -`define JALR_C 32'b1111011_00000_?????_0000000000_????? -`define JALR_R 32'b1111011_00000_?????_0000000001_????? -`define JALR_J 32'b1111011_00000_?????_0000000010_????? -`define RDNPC 32'b1111011_00000_00000_0010000000_????? -`define MFCR 32'b1111011_?????_00000_0100000000_????? -`define MTCR 32'b1111011_?????_?????_0110000000_00000 -`define SYNC 32'b1111011_00000_00000_1000000000_00000 -`define SYSCALL 32'b1111011_00000_00000_1010000000_00000 -`define BREAK 32'b1111011_00000_00000_1100000000_00000 -`define EI 32'b1111110_00000_00000_0000000000_????? -`define DI 32'b1111110_00000_00000_0010000000_????? -`define ERET 32'b1111110_00000_00000_0100000000_00000 -`define MFPCR 32'b1111110_?????_00000_1000000000_????? -`define MTPCR 32'b1111110_?????_?????_1010000000_00000 +`define LH 32'b1111000_?????_?????_000_???????????? +`define LW 32'b1111000_?????_?????_000_???????????? +`define LD 32'b1111000_?????_?????_000_???????????? +`define LBU 32'b1111000_?????_?????_000_???????????? +`define LHU 32'b1111000_?????_?????_000_???????????? +`define LWU 32'b1111000_?????_?????_000_???????????? +`define SYNCI 32'b1111000_00000_?????_000_???????????? +`define SB 32'b1111001_?????_?????_000_000000000000 +`define SH 32'b1111001_?????_?????_000_000000000000 +`define SW 32'b1111001_?????_?????_000_000000000000 +`define SD 32'b1111001_?????_?????_000_000000000000 +`define AMOW_ADD 32'b1111010_?????_?????_0000000000_????? +`define AMOW_SWAP 32'b1111010_?????_?????_0000000000_????? +`define AMOW_AND 32'b1111010_?????_?????_0000000000_????? +`define AMOW_OR 32'b1111010_?????_?????_0000000000_????? +`define AMOW_MIN 32'b1111010_?????_?????_0000000000_????? +`define AMOW_MAX 32'b1111010_?????_?????_0000000000_????? +`define AMOW_MINU 32'b1111010_?????_?????_0000000000_????? +`define AMOW_MAXU 32'b1111010_?????_?????_0000000000_????? +`define AMO_ADD 32'b1111010_?????_?????_0000000000_????? +`define AMO_SWAP 32'b1111010_?????_?????_0000000000_????? +`define AMO_AND 32'b1111010_?????_?????_0000000000_????? +`define AMO_OR 32'b1111010_?????_?????_0000000000_????? +`define AMO_MIN 32'b1111010_?????_?????_0000000000_????? +`define AMO_MAX 32'b1111010_?????_?????_0000000000_????? +`define AMO_MINU 32'b1111010_?????_?????_0000000000_????? +`define AMO_MAXU 32'b1111010_?????_?????_0000000000_????? +`define RDNPC 32'b1111011_00000_00000_0000000000_????? +`define MFCR 32'b1111011_?????_00000_0000000000_????? +`define MTCR 32'b1111011_?????_?????_0000000000_00000 +`define SYNC 32'b1111011_00000_00000_0000000000_00000 +`define SYSCALL 32'b1111011_00000_00000_0000000000_00000 +`define EI 32'b1101011_00000_00000_0000000000_????? +`define DI 32'b1101011_00000_00000_0000000000_????? +`define MFPCR 32'b1101011_?????_00000_0000000000_????? +`define MTPCR 32'b1101011_?????_?????_0000000000_00000 +`define ERET 32'b1101011_00000_00000_0000000000_00000 `define ADD_S 32'b1101010_?????_?????_0000000000_????? -`define SUB_S 32'b1101010_?????_?????_0000000001_????? -`define MUL_S 32'b1101010_?????_?????_0000000010_????? -`define DIV_S 32'b1101010_?????_?????_0000000011_????? -`define SQRT_S 32'b1101010_00000_?????_0000000100_????? -`define SGNINJ_S 32'b1101010_?????_?????_0000000101_????? -`define SGNINJN_S 32'b1101010_?????_?????_0000000110_????? -`define SGNMUL_S 32'b1101010_?????_?????_0000000111_????? -`define ADD_D 32'b1101010_?????_?????_1100000000_????? -`define SUB_D 32'b1101010_?????_?????_1100000001_????? -`define MUL_D 32'b1101010_?????_?????_1100000010_????? -`define DIV_D 32'b1101010_?????_?????_1100000011_????? -`define SQRT_D 32'b1101010_00000_?????_1100000100_????? -`define SGNINJ_D 32'b1101010_?????_?????_1100000101_????? -`define SGNINJN_D 32'b1101010_?????_?????_1100000110_????? -`define SGNMUL_D 32'b1101010_?????_?????_1100000111_????? -`define ADD_S_RM 32'b1101010_?????_?????_00_??_100000_????? -`define SUB_S_RM 32'b1101010_?????_?????_00_??_100001_????? -`define MUL_S_RM 32'b1101010_?????_?????_00_??_100010_????? -`define DIV_S_RM 32'b1101010_?????_?????_00_??_100011_????? -`define SQRT_S_RM 32'b1101010_00000_?????_00_??_100100_????? -`define ADD_D_RM 32'b1101010_?????_?????_11_??_100000_????? -`define SUB_D_RM 32'b1101010_?????_?????_11_??_100001_????? -`define MUL_D_RM 32'b1101010_?????_?????_11_??_100010_????? -`define DIV_D_RM 32'b1101010_?????_?????_11_??_100011_????? -`define SQRT_D_RM 32'b1101010_00000_?????_11_??_100100_????? -`define CVT_L_S_RM 32'b1101010_00000_?????_00_??_101000_????? -`define CVTU_L_S_RM 32'b1101010_00000_?????_00_??_101001_????? -`define CVT_W_S_RM 32'b1101010_00000_?????_00_??_101010_????? -`define CVTU_W_S_RM 32'b1101010_00000_?????_00_??_101011_????? -`define CVT_L_D_RM 32'b1101010_00000_?????_11_??_101000_????? -`define CVTU_L_D_RM 32'b1101010_00000_?????_11_??_101001_????? -`define CVT_W_D_RM 32'b1101010_00000_?????_11_??_101010_????? -`define CVTU_W_D_RM 32'b1101010_00000_?????_11_??_101011_????? -`define CVT_S_L 32'b1101010_00000_?????_0000001100_????? -`define CVTU_S_L 32'b1101010_00000_?????_0000001101_????? -`define CVT_S_W 32'b1101010_00000_?????_0000001110_????? -`define CVTU_S_W 32'b1101010_00000_?????_0000001111_????? -`define CVT_D_L 32'b1101010_00000_?????_1100001100_????? -`define CVTU_D_L 32'b1101010_00000_?????_1100001101_????? -`define CVT_D_W 32'b1101010_00000_?????_1100001110_????? -`define CVTU_D_W 32'b1101010_00000_?????_1100001111_????? -`define CVT_S_L_RM 32'b1101010_00000_?????_00_??_101100_????? -`define CVTU_S_L_RM 32'b1101010_00000_?????_00_??_101101_????? -`define CVT_S_W_RM 32'b1101010_00000_?????_00_??_101110_????? -`define CVTU_S_W_RM 32'b1101010_00000_?????_00_??_101111_????? -`define CVT_D_L_RM 32'b1101010_00000_?????_11_??_101100_????? -`define CVTU_D_L_RM 32'b1101010_00000_?????_11_??_101101_????? -`define CVT_S_D 32'b1101010_00000_?????_0000010011_????? -`define CVT_D_S 32'b1101010_00000_?????_1100010000_????? -`define CVT_S_D_RM 32'b1101010_00000_?????_00_??_110011_????? -`define C_EQ_S 32'b1101010_?????_?????_0000010101_????? -`define C_LT_S 32'b1101010_?????_?????_0000010110_????? -`define C_LE_S 32'b1101010_?????_?????_0000010111_????? -`define C_EQ_D 32'b1101010_?????_?????_1100010101_????? -`define C_LT_D 32'b1101010_?????_?????_1100010110_????? -`define C_LE_D 32'b1101010_?????_?????_1100010111_????? -`define MFF_S 32'b1101010_?????_00000_0001011000_????? -`define MFF_D 32'b1101010_?????_00000_1101011000_????? -`define MFFL_D 32'b1101010_?????_00000_1101011001_????? -`define MFFH_D 32'b1101010_?????_00000_1101011010_????? -`define MTF_S 32'b1101010_00000_?????_0001011100_????? -`define MTF_D 32'b1101010_00000_?????_1101011100_????? -`define MTFLH_D 32'b1101010_?????_?????_1101111100_????? -`define L_S 32'b1101000_?????_?????_010_???????????? -`define L_D 32'b1101000_?????_?????_011_???????????? -`define S_S 32'b1101001_?????_?????_010_???????????? -`define S_D 32'b1101001_?????_?????_011_???????????? +`define SUB_S 32'b1101010_?????_?????_0000000000_????? +`define MUL_S 32'b1101010_?????_?????_0000000000_????? +`define DIV_S 32'b1101010_?????_?????_0000000000_????? +`define SQRT_S 32'b1101010_00000_?????_0000000000_????? +`define SGNINJ_S 32'b1101010_?????_?????_0000000000_????? +`define SGNINJN_S 32'b1101010_?????_?????_0000000000_????? +`define SGNMUL_S 32'b1101010_?????_?????_0000000000_????? +`define ADD_D 32'b1101010_?????_?????_0000000000_????? +`define SUB_D 32'b1101010_?????_?????_0000000000_????? +`define MUL_D 32'b1101010_?????_?????_0000000000_????? +`define DIV_D 32'b1101010_?????_?????_0000000000_????? +`define SQRT_D 32'b1101010_00000_?????_0000000000_????? +`define SGNINJ_D 32'b1101010_?????_?????_0000000000_????? +`define SGNINJN_D 32'b1101010_?????_?????_0000000000_????? +`define SGNMUL_D 32'b1101010_?????_?????_0000000000_????? +`define ADD_S_RM 32'b1101010_?????_?????_00_??_000000_????? +`define SUB_S_RM 32'b1101010_?????_?????_00_??_000000_????? +`define MUL_S_RM 32'b1101010_?????_?????_00_??_000000_????? +`define DIV_S_RM 32'b1101010_?????_?????_00_??_000000_????? +`define SQRT_S_RM 32'b1101010_00000_?????_00_??_000000_????? +`define ADD_D_RM 32'b1101010_?????_?????_00_??_000000_????? +`define SUB_D_RM 32'b1101010_?????_?????_00_??_000000_????? +`define MUL_D_RM 32'b1101010_?????_?????_00_??_000000_????? +`define DIV_D_RM 32'b1101010_?????_?????_00_??_000000_????? +`define SQRT_D_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_L_S_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVTU_L_S_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_W_S_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVTU_W_S_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_L_D_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVTU_L_D_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_W_D_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVTU_W_D_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_S_L 32'b1101010_00000_?????_0000000000_????? +`define CVTU_S_L 32'b1101010_00000_?????_0000000000_????? +`define CVT_S_W 32'b1101010_00000_?????_0000000000_????? +`define CVTU_S_W 32'b1101010_00000_?????_0000000000_????? +`define CVT_D_L 32'b1101010_00000_?????_0000000000_????? +`define CVTU_D_L 32'b1101010_00000_?????_0000000000_????? +`define CVT_D_W 32'b1101010_00000_?????_0000000000_????? +`define CVTU_D_W 32'b1101010_00000_?????_0000000000_????? +`define CVT_S_L_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVTU_S_L_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_S_W_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVTU_S_W_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_D_L_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVTU_D_L_RM 32'b1101010_00000_?????_00_??_000000_????? +`define CVT_S_D 32'b1101010_00000_?????_0000000000_????? +`define CVT_D_S 32'b1101010_00000_?????_0000000000_????? +`define CVT_S_D_RM 32'b1101010_00000_?????_00_??_000000_????? +`define C_EQ_S 32'b1101010_?????_?????_0000000000_????? +`define C_LT_S 32'b1101010_?????_?????_0000000000_????? +`define C_LE_S 32'b1101010_?????_?????_0000000000_????? +`define C_EQ_D 32'b1101010_?????_?????_0000000000_????? +`define C_LT_D 32'b1101010_?????_?????_0000000000_????? +`define C_LE_D 32'b1101010_?????_?????_0000000000_????? +`define MFF_S 32'b1101010_?????_00000_0000000000_????? +`define MFF_D 32'b1101010_?????_00000_0000000000_????? +`define MFFL_D 32'b1101010_?????_00000_0000000000_????? +`define MFFH_D 32'b1101010_?????_00000_0000000000_????? +`define MTF_S 32'b1101010_00000_?????_0000000000_????? +`define MTF_D 32'b1101010_00000_?????_0000000000_????? +`define MTFLH_D 32'b1101010_?????_?????_0000000000_????? +`define L_S 32'b1101000_?????_?????_000_???????????? +`define L_D 32'b1101000_?????_?????_000_???????????? +`define S_S 32'b1101001_?????_?????_000_000000000000 +`define S_D 32'b1101001_?????_?????_000_000000000000 `define MADD_S 32'b1101100_?????_?????_00000_?????_????? `define MSUB_S 32'b1101101_?????_?????_00000_?????_????? `define NMSUB_S 32'b1101110_?????_?????_00000_?????_????? `define NMADD_S 32'b1101111_?????_?????_00000_?????_????? -`define MADD_D 32'b1101100_?????_?????_11000_?????_????? -`define MSUB_D 32'b1101101_?????_?????_11000_?????_????? -`define NMSUB_D 32'b1101110_?????_?????_11000_?????_????? -`define NMADD_D 32'b1101111_?????_?????_11000_?????_????? -`define MADD_S_RM 32'b1101100_?????_?????_00_??_1_?????_????? -`define MSUB_S_RM 32'b1101101_?????_?????_00_??_1_?????_????? -`define NMSUB_S_RM 32'b1101110_?????_?????_00_??_1_?????_????? -`define NMADD_S_RM 32'b1101111_?????_?????_00_??_1_?????_????? -`define MADD_D_RM 32'b1101100_?????_?????_11_??_1_?????_????? -`define MSUB_D_RM 32'b1101101_?????_?????_11_??_1_?????_????? -`define NMSUB_D_RM 32'b1101110_?????_?????_11_??_1_?????_????? -`define NMADD_D_RM 32'b1101111_?????_?????_11_??_1_?????_????? +`define MADD_D 32'b1101100_?????_?????_00000_?????_????? +`define MSUB_D 32'b1101101_?????_?????_00000_?????_????? +`define NMSUB_D 32'b1101110_?????_?????_00000_?????_????? +`define NMADD_D 32'b1101111_?????_?????_00000_?????_????? +`define MADD_S_RM 32'b1101100_?????_?????_00_??_0_?????_????? +`define MSUB_S_RM 32'b1101101_?????_?????_00_??_0_?????_????? +`define NMSUB_S_RM 32'b1101110_?????_?????_00_??_0_?????_????? +`define NMADD_S_RM 32'b1101111_?????_?????_00_??_0_?????_????? +`define MADD_D_RM 32'b1101100_?????_?????_00_??_0_?????_????? +`define MSUB_D_RM 32'b1101101_?????_?????_00_??_0_?????_????? +`define NMSUB_D_RM 32'b1101110_?????_?????_00_??_0_?????_????? +`define NMADD_D_RM 32'b1101111_?????_?????_00_??_0_?????_????? diff --git a/instr-table.tex b/instr-table.tex index 56f5c2a..5455df7 100644 --- a/instr-table.tex +++ b/instr-table.tex @@ -36,19 +36,19 @@ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{8}{c|}{LUI-immediate} & LUI-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi/rs2} & +\multicolumn{1}{c|}{rd/rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{funct3} & \multicolumn{5}{c|}{immediate} & I-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{5}{c|}{funct9} & \multicolumn{2}{c|}{shamt} & ISH-type \\ @@ -58,7 +58,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{funct10} & -\multicolumn{1}{c|}{rdr} & R-type \\ +\multicolumn{1}{c|}{rd} & R-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & @@ -66,7 +66,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{funct5} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & R4-type \\ +\multicolumn{1}{c|}{rd} & R4-type \\ \cline{2-12} @@ -98,27 +98,45 @@ & \multicolumn{2}{|c|}{1111011} & \multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{rs1} & +\multicolumn{1}{c|}{00000} & \multicolumn{6}{c|}{0000000000} & -\multicolumn{1}{c|}{rdr} & JALR.C rdr,rs1 \\ +\multicolumn{1}{c|}{rd} & RDNPC rd \\ \cline{2-12} & \multicolumn{2}{|c|}{1111011} & +\multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{00000} & +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MFCR rd,rs2 \\ +\cline{2-12} + + +& +\multicolumn{2}{|c|}{1111011} & +\multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000001} & -\multicolumn{1}{c|}{rdr} & JALR.R rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{00000} & MTCR rs1,rs2 \\ \cline{2-12} & \multicolumn{2}{|c|}{1111011} & \multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000010} & -\multicolumn{1}{c|}{rdr} & JALR.J rdr,rs1 \\ +\multicolumn{1}{c|}{00000} & +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{00000} & SYNC \\ +\cline{2-12} + + +& +\multicolumn{2}{|c|}{1111011} & +\multicolumn{1}{c|}{00000} & +\multicolumn{1}{c|}{00000} & +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{00000} & SYSCALL imm12 \\ \cline{2-12} @@ -127,7 +145,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{000} & -\multicolumn{5}{c|}{imm12} & BEQ rs1,rs2,imm12 \\ +\multicolumn{5}{c|}{000000000000} & BEQ rs1,rs2,imm12lo,imm12hi \\ \cline{2-12} @@ -135,8 +153,8 @@ \multicolumn{2}{|c|}{1110011} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{001} & -\multicolumn{5}{c|}{imm12} & BNE rs1,rs2,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & BNE rs1,rs2,imm12lo,imm12hi \\ \cline{2-12} @@ -144,8 +162,8 @@ \multicolumn{2}{|c|}{1110011} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{100} & -\multicolumn{5}{c|}{imm12} & BLT rs1,rs2,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & BLT rs1,rs2,imm12lo,imm12hi \\ \cline{2-12} @@ -153,8 +171,8 @@ \multicolumn{2}{|c|}{1110011} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{101} & -\multicolumn{5}{c|}{imm12} & BGE rs1,rs2,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & BGE rs1,rs2,imm12lo,imm12hi \\ \cline{2-12} @@ -162,8 +180,8 @@ \multicolumn{2}{|c|}{1110011} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{110} & -\multicolumn{5}{c|}{imm12} & BLTU rs1,rs2,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & BLTU rs1,rs2,imm12lo,imm12hi \\ \cline{2-12} @@ -171,8 +189,8 @@ \multicolumn{2}{|c|}{1110011} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{111} & -\multicolumn{5}{c|}{imm12} & BGEU rs1,rs2,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & BGEU rs1,rs2,imm12lo,imm12hi \\ \cline{2-12} @@ -185,64 +203,64 @@ & \multicolumn{2}{|c|}{1111000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{000} & -\multicolumn{5}{c|}{imm12} & LB rdi,rs1,imm12 \\ +\multicolumn{5}{c|}{imm12} & LB rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1111000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{001} & -\multicolumn{5}{c|}{imm12} & LH rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & LH rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1111000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{010} & -\multicolumn{5}{c|}{imm12} & LW rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & LW rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1111000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{011} & -\multicolumn{5}{c|}{imm12} & LD rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & LD rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1111000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{100} & -\multicolumn{5}{c|}{imm12} & LBU rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & LBU rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1111000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{101} & -\multicolumn{5}{c|}{imm12} & LHU rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & LHU rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1111000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{110} & -\multicolumn{5}{c|}{imm12} & LWU rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & LWU rd,rs1,imm12 \\ \cline{2-12} @@ -250,7 +268,7 @@ \multicolumn{2}{|c|}{1111000} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{111} & +\multicolumn{2}{c|}{000} & \multicolumn{5}{c|}{imm12} & SYNCI rs1,imm12 \\ \cline{2-12} @@ -260,7 +278,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{000} & -\multicolumn{5}{c|}{imm12} & SB rs2,rs1,imm12 \\ +\multicolumn{5}{c|}{000000000000} & SB rs2,rs1,imm12lo,imm12hi \\ \cline{2-12} @@ -268,8 +286,8 @@ \multicolumn{2}{|c|}{1111001} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{001} & -\multicolumn{5}{c|}{imm12} & SH rs2,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & SH rs2,rs1,imm12lo,imm12hi \\ \cline{2-12} @@ -277,8 +295,8 @@ \multicolumn{2}{|c|}{1111001} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{010} & -\multicolumn{5}{c|}{imm12} & SW rs2,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & SW rs2,rs1,imm12lo,imm12hi \\ \cline{2-12} @@ -286,8 +304,8 @@ \multicolumn{2}{|c|}{1111001} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{011} & -\multicolumn{5}{c|}{imm12} & SD rs2,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & SD rs2,rs1,imm12lo,imm12hi \\ \cline{2-12} @@ -302,8 +320,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000000} & -\multicolumn{1}{c|}{rdr} & AMOW.ADD rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.ADD rd,rs1,rs2 \\ \cline{2-12} @@ -311,8 +329,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000001} & -\multicolumn{1}{c|}{rdr} & AMOW.SWAP rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.SWAP rd,rs1,rs2 \\ \cline{2-12} @@ -320,8 +338,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000010} & -\multicolumn{1}{c|}{rdr} & AMOW.AND rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.AND rd,rs1,rs2 \\ \cline{2-12} @@ -329,8 +347,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000011} & -\multicolumn{1}{c|}{rdr} & AMOW.OR rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.OR rd,rs1,rs2 \\ \cline{2-12} @@ -338,8 +356,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000100} & -\multicolumn{1}{c|}{rdr} & AMOW.MIN rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.MIN rd,rs1,rs2 \\ \cline{2-12} @@ -347,8 +365,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000101} & -\multicolumn{1}{c|}{rdr} & AMOW.MAX rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.MAX rd,rs1,rs2 \\ \cline{2-12} @@ -356,8 +374,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000110} & -\multicolumn{1}{c|}{rdr} & AMOW.MINU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.MINU rd,rs1,rs2 \\ \cline{2-12} @@ -365,8 +383,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0100000111} & -\multicolumn{1}{c|}{rdr} & AMOW.MAXU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMOW.MAXU rd,rs1,rs2 \\ \cline{2-12} @@ -374,8 +392,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000000} & -\multicolumn{1}{c|}{rdr} & AMO.ADD rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.ADD rd,rs1,rs2 \\ \cline{2-12} @@ -383,8 +401,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000001} & -\multicolumn{1}{c|}{rdr} & AMO.SWAP rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.SWAP rd,rs1,rs2 \\ \cline{2-12} @@ -392,8 +410,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000010} & -\multicolumn{1}{c|}{rdr} & AMO.AND rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.AND rd,rs1,rs2 \\ \cline{2-12} @@ -401,8 +419,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000011} & -\multicolumn{1}{c|}{rdr} & AMO.OR rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.OR rd,rs1,rs2 \\ \cline{2-12} @@ -410,8 +428,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000100} & -\multicolumn{1}{c|}{rdr} & AMO.MIN rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.MIN rd,rs1,rs2 \\ \cline{2-12} @@ -419,8 +437,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000101} & -\multicolumn{1}{c|}{rdr} & AMO.MAX rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.MAX rd,rs1,rs2 \\ \cline{2-12} @@ -428,8 +446,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000110} & -\multicolumn{1}{c|}{rdr} & AMO.MINU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.MINU rd,rs1,rs2 \\ \cline{2-12} @@ -437,8 +455,8 @@ \multicolumn{2}{|c|}{1111010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000111} & -\multicolumn{1}{c|}{rdr} & AMO.MAXU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AMO.MAXU rd,rs1,rs2 \\ \cline{2-12} @@ -487,19 +505,19 @@ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{8}{c|}{LUI-immediate} & LUI-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi/rs2} & +\multicolumn{1}{c|}{rd/rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{funct3} & \multicolumn{5}{c|}{immediate} & I-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{5}{c|}{funct9} & \multicolumn{2}{c|}{shamt} & ISH-type \\ @@ -509,7 +527,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{funct10} & -\multicolumn{1}{c|}{rdr} & R-type \\ +\multicolumn{1}{c|}{rd} & R-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & @@ -517,7 +535,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{funct5} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & R4-type \\ +\multicolumn{1}{c|}{rd} & R4-type \\ \cline{2-12} @@ -530,89 +548,89 @@ & \multicolumn{2}{|c|}{1110001} & -\multicolumn{1}{c|}{rdi} & -\multicolumn{8}{c|}{imm20} & LUI rdi,imm20 \\ +\multicolumn{1}{c|}{rd} & +\multicolumn{8}{c|}{imm20} & LUI rd,imm20 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{000} & -\multicolumn{5}{c|}{imm12} & ADDI rdi,rs1,imm12 \\ +\multicolumn{5}{c|}{imm12} & ADDI rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{010} & -\multicolumn{5}{c|}{imm12} & SLTI rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & SLTI rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{011} & -\multicolumn{5}{c|}{imm12} & SLTIU rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & SLTIU rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{100} & -\multicolumn{5}{c|}{imm12} & ANDI rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & ANDI rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{101} & -\multicolumn{5}{c|}{imm12} & ORI rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & ORI rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{110} & -\multicolumn{5}{c|}{imm12} & XORI rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & XORI rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{5}{c|}{111000001} & -\multicolumn{2}{c|}{shamt} & SLLI rdi,rs1,shamt \\ +\multicolumn{5}{c|}{000000000} & +\multicolumn{2}{c|}{shamt} & SLLI rd,rs1,shamt \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{5}{c|}{111000010} & -\multicolumn{2}{c|}{shamt} & SRLI rdi,rs1,shamt \\ +\multicolumn{5}{c|}{000000000} & +\multicolumn{2}{c|}{shamt} & SRLI rd,rs1,shamt \\ \cline{2-12} & \multicolumn{2}{|c|}{1110100} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{5}{c|}{111000011} & -\multicolumn{2}{c|}{shamt} & SRAI rdi,rs1,shamt \\ +\multicolumn{5}{c|}{000000000} & +\multicolumn{2}{c|}{shamt} & SRAI rd,rs1,shamt \\ \cline{2-12} @@ -621,7 +639,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{0000000000} & -\multicolumn{1}{c|}{rdr} & ADD rdr,rs1,rs2 \\ +\multicolumn{1}{c|}{rd} & ADD rd,rs1,rs2 \\ \cline{2-12} @@ -629,8 +647,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000001} & -\multicolumn{1}{c|}{rdr} & SUB rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SUB rd,rs1,rs2 \\ \cline{2-12} @@ -638,8 +656,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000010} & -\multicolumn{1}{c|}{rdr} & SLT rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SLT rd,rs1,rs2 \\ \cline{2-12} @@ -647,8 +665,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000011} & -\multicolumn{1}{c|}{rdr} & SLTU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SLTU rd,rs1,rs2 \\ \cline{2-12} @@ -656,8 +674,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000100} & -\multicolumn{1}{c|}{rdr} & AND rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & AND rd,rs1,rs2 \\ \cline{2-12} @@ -665,8 +683,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000101} & -\multicolumn{1}{c|}{rdr} & OR rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & OR rd,rs1,rs2 \\ \cline{2-12} @@ -674,8 +692,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000110} & -\multicolumn{1}{c|}{rdr} & XOR rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & XOR rd,rs1,rs2 \\ \cline{2-12} @@ -683,8 +701,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000111} & -\multicolumn{1}{c|}{rdr} & NOR rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & NOR rd,rs1,rs2 \\ \cline{2-12} @@ -692,8 +710,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1110000010} & -\multicolumn{1}{c|}{rdr} & SLL rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SLL rd,rs1,rs2 \\ \cline{2-12} @@ -701,8 +719,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1110000100} & -\multicolumn{1}{c|}{rdr} & SRL rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SRL rd,rs1,rs2 \\ \cline{2-12} @@ -710,8 +728,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1110000110} & -\multicolumn{1}{c|}{rdr} & SRA rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SRA rd,rs1,rs2 \\ \cline{2-12} @@ -719,8 +737,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000000} & -\multicolumn{1}{c|}{rdr} & MUL rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MUL rd,rs1,rs2 \\ \cline{2-12} @@ -728,8 +746,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000010} & -\multicolumn{1}{c|}{rdr} & MULH rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MULH rd,rs1,rs2 \\ \cline{2-12} @@ -737,8 +755,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000011} & -\multicolumn{1}{c|}{rdr} & MULHU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MULHU rd,rs1,rs2 \\ \cline{2-12} @@ -746,8 +764,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000100} & -\multicolumn{1}{c|}{rdr} & DIV rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & DIV rd,rs1,rs2 \\ \cline{2-12} @@ -755,8 +773,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000101} & -\multicolumn{1}{c|}{rdr} & DIVU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & DIVU rd,rs1,rs2 \\ \cline{2-12} @@ -764,8 +782,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000110} & -\multicolumn{1}{c|}{rdr} & REM rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & REM rd,rs1,rs2 \\ \cline{2-12} @@ -773,8 +791,8 @@ \multicolumn{2}{|c|}{1110101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000111} & -\multicolumn{1}{c|}{rdr} & REMU rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & REMU rd,rs1,rs2 \\ \cline{2-12} @@ -787,40 +805,40 @@ & \multicolumn{2}{|c|}{1110110} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{000} & -\multicolumn{5}{c|}{imm12} & ADDIW rdi,rs1,imm12 \\ +\multicolumn{5}{c|}{imm12} & ADDIW rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1110110} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{5}{c|}{111000001} & +\multicolumn{5}{c|}{000000000} & \multicolumn{1}{c|}{0} & -\multicolumn{1}{c|}{shamtw} & SLLIW rdi,rs1,shamtw \\ +\multicolumn{1}{c|}{shamtw} & SLLIW rd,rs1,shamtw \\ \cline{2-12} & \multicolumn{2}{|c|}{1110110} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{5}{c|}{111000010} & +\multicolumn{5}{c|}{000000000} & \multicolumn{1}{c|}{0} & -\multicolumn{1}{c|}{shamtw} & SRLIW rdi,rs1,shamtw \\ +\multicolumn{1}{c|}{shamtw} & SRLIW rd,rs1,shamtw \\ \cline{2-12} & \multicolumn{2}{|c|}{1110110} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{5}{c|}{111000011} & +\multicolumn{5}{c|}{000000000} & \multicolumn{1}{c|}{0} & -\multicolumn{1}{c|}{shamtw} & SRAIW rdi,rs1,shamtw \\ +\multicolumn{1}{c|}{shamtw} & SRAIW rd,rs1,shamtw \\ \cline{2-12} @@ -829,7 +847,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{0000000000} & -\multicolumn{1}{c|}{rdr} & ADDW rdr,rs1,rs2 \\ +\multicolumn{1}{c|}{rd} & ADDW rd,rs1,rs2 \\ \cline{2-12} @@ -837,8 +855,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000001} & -\multicolumn{1}{c|}{rdr} & SUBW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SUBW rd,rs1,rs2 \\ \cline{2-12} @@ -846,8 +864,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1110000010} & -\multicolumn{1}{c|}{rdr} & SLLW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SLLW rd,rs1,rs2 \\ \cline{2-12} @@ -855,8 +873,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1110000100} & -\multicolumn{1}{c|}{rdr} & SRLW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SRLW rd,rs1,rs2 \\ \cline{2-12} @@ -864,8 +882,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1110000110} & -\multicolumn{1}{c|}{rdr} & SRAW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SRAW rd,rs1,rs2 \\ \cline{2-12} @@ -873,8 +891,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000000} & -\multicolumn{1}{c|}{rdr} & MULW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MULW rd,rs1,rs2 \\ \cline{2-12} @@ -882,8 +900,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000010} & -\multicolumn{1}{c|}{rdr} & MULHW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MULHW rd,rs1,rs2 \\ \cline{2-12} @@ -891,8 +909,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000011} & -\multicolumn{1}{c|}{rdr} & MULHUW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MULHUW rd,rs1,rs2 \\ \cline{2-12} @@ -900,8 +918,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000100} & -\multicolumn{1}{c|}{rdr} & DIVW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & DIVW rd,rs1,rs2 \\ \cline{2-12} @@ -909,8 +927,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000101} & -\multicolumn{1}{c|}{rdr} & DIVUW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & DIVUW rd,rs1,rs2 \\ \cline{2-12} @@ -918,8 +936,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000110} & -\multicolumn{1}{c|}{rdr} & REMW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & REMW rd,rs1,rs2 \\ \cline{2-12} @@ -927,8 +945,8 @@ \multicolumn{2}{|c|}{1110111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0010000111} & -\multicolumn{1}{c|}{rdr} & REMUW rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & REMUW rd,rs1,rs2 \\ \cline{2-12} @@ -977,19 +995,19 @@ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{8}{c|}{LUI-immediate} & LUI-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi/rs2} & +\multicolumn{1}{c|}{rd/rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{funct3} & \multicolumn{5}{c|}{immediate} & I-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{5}{c|}{funct9} & \multicolumn{2}{c|}{shamt} & ISH-type \\ @@ -999,7 +1017,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{funct10} & -\multicolumn{1}{c|}{rdr} & R-type \\ +\multicolumn{1}{c|}{rd} & R-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & @@ -1007,7 +1025,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{funct5} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & R4-type \\ +\multicolumn{1}{c|}{rd} & R4-type \\ \cline{2-12} @@ -1020,19 +1038,19 @@ & \multicolumn{2}{|c|}{1101000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{010} & -\multicolumn{5}{c|}{imm12} & L.S rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & L.S rd,rs1,imm12 \\ \cline{2-12} & \multicolumn{2}{|c|}{1101000} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{011} & -\multicolumn{5}{c|}{imm12} & L.D rdi,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{imm12} & L.D rd,rs1,imm12 \\ \cline{2-12} @@ -1040,8 +1058,8 @@ \multicolumn{2}{|c|}{1101001} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{010} & -\multicolumn{5}{c|}{imm12} & S.S rs2,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & S.S rs2,rs1,imm12lo,imm12hi \\ \cline{2-12} @@ -1049,8 +1067,8 @@ \multicolumn{2}{|c|}{1101001} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{2}{c|}{011} & -\multicolumn{5}{c|}{imm12} & S.D rs2,rs1,imm12 \\ +\multicolumn{2}{c|}{000} & +\multicolumn{5}{c|}{000000000000} & S.D rs2,rs1,imm12lo,imm12hi \\ \cline{2-12} @@ -1066,7 +1084,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{0000000000} & -\multicolumn{1}{c|}{rdr} & ADD.S rdr,rs1,rs2 \\ +\multicolumn{1}{c|}{rd} & ADD.S rd,rs1,rs2 \\ \cline{2-12} @@ -1074,8 +1092,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000001} & -\multicolumn{1}{c|}{rdr} & SUB.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SUB.S rd,rs1,rs2 \\ \cline{2-12} @@ -1083,8 +1101,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000010} & -\multicolumn{1}{c|}{rdr} & MUL.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MUL.S rd,rs1,rs2 \\ \cline{2-12} @@ -1092,8 +1110,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000011} & -\multicolumn{1}{c|}{rdr} & DIV.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & DIV.S rd,rs1,rs2 \\ \cline{2-12} @@ -1101,8 +1119,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000100} & -\multicolumn{1}{c|}{rdr} & SQRT.S rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SQRT.S rd,rs1 \\ \cline{2-12} @@ -1110,8 +1128,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000000} & -\multicolumn{1}{c|}{rdr} & ADD.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & ADD.D rd,rs1,rs2 \\ \cline{2-12} @@ -1119,8 +1137,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000001} & -\multicolumn{1}{c|}{rdr} & SUB.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SUB.D rd,rs1,rs2 \\ \cline{2-12} @@ -1128,8 +1146,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000010} & -\multicolumn{1}{c|}{rdr} & MUL.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MUL.D rd,rs1,rs2 \\ \cline{2-12} @@ -1137,8 +1155,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000011} & -\multicolumn{1}{c|}{rdr} & DIV.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & DIV.D rd,rs1,rs2 \\ \cline{2-12} @@ -1146,8 +1164,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000100} & -\multicolumn{1}{c|}{rdr} & SQRT.D rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SQRT.D rd,rs1 \\ \cline{2-12} @@ -1157,7 +1175,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MADD.S rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MADD.S rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1167,7 +1185,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MSUB.S rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MSUB.S rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1177,7 +1195,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMSUB.S rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMSUB.S rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1187,7 +1205,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMADD.S rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMADD.S rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1195,9 +1213,9 @@ \multicolumn{2}{|c|}{1101100} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{4}{c|}{11000} & +\multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MADD.D rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MADD.D rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1205,9 +1223,9 @@ \multicolumn{2}{|c|}{1101101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{4}{c|}{11000} & +\multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MSUB.D rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MSUB.D rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1215,9 +1233,9 @@ \multicolumn{2}{|c|}{1101110} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{4}{c|}{11000} & +\multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMSUB.D rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMSUB.D rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1225,9 +1243,9 @@ \multicolumn{2}{|c|}{1101111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{4}{c|}{11000} & +\multicolumn{4}{c|}{00000} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMADD.D rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMADD.D rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1237,8 +1255,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100000} & -\multicolumn{1}{c|}{rdr} & ADD.S.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & ADD.S.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1248,8 +1266,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100001} & -\multicolumn{1}{c|}{rdr} & SUB.S.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & SUB.S.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1259,8 +1277,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100010} & -\multicolumn{1}{c|}{rdr} & MUL.S.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & MUL.S.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1270,8 +1288,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100011} & -\multicolumn{1}{c|}{rdr} & DIV.S.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & DIV.S.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1281,8 +1299,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100100} & -\multicolumn{1}{c|}{rdr} & SQRT.S.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & SQRT.S.RM rd,rs1 \\ \cline{2-12} @@ -1290,10 +1308,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100000} & -\multicolumn{1}{c|}{rdr} & ADD.D.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & ADD.D.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1301,10 +1319,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100001} & -\multicolumn{1}{c|}{rdr} & SUB.D.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & SUB.D.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1312,10 +1330,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100010} & -\multicolumn{1}{c|}{rdr} & MUL.D.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & MUL.D.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1323,10 +1341,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100011} & -\multicolumn{1}{c|}{rdr} & DIV.D.RM rdr,rs1,rs2 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & DIV.D.RM rd,rs1,rs2 \\ \cline{2-12} @@ -1334,10 +1352,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{100100} & -\multicolumn{1}{c|}{rdr} & SQRT.D.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & SQRT.D.RM rd,rs1 \\ \cline{2-12} @@ -1347,9 +1365,9 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MADD.S.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MADD.S.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1359,9 +1377,9 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MSUB.S.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MSUB.S.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1371,9 +1389,9 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMSUB.S.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMSUB.S.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1383,9 +1401,9 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMADD.S.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMADD.S.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1393,11 +1411,11 @@ \multicolumn{2}{|c|}{1101100} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MADD.D.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MADD.D.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1405,11 +1423,11 @@ \multicolumn{2}{|c|}{1101101} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & MSUB.D.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & MSUB.D.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1417,11 +1435,11 @@ \multicolumn{2}{|c|}{1101110} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMSUB.D.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMSUB.D.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1429,11 +1447,11 @@ \multicolumn{2}{|c|}{1101111} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{1}{c|}{1} & +\multicolumn{1}{c|}{0} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & NMADD.D.RM rdr,rs1,rs2,rs3 \\ +\multicolumn{1}{c|}{rd} & NMADD.D.RM rd,rs1,rs2,rs3 \\ \cline{2-12} @@ -1482,19 +1500,19 @@ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{8}{c|}{LUI-immediate} & LUI-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi/rs2} & +\multicolumn{1}{c|}{rd/rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{funct3} & \multicolumn{5}{c|}{immediate} & I-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{5}{c|}{funct9} & \multicolumn{2}{c|}{shamt} & ISH-type \\ @@ -1504,7 +1522,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{funct10} & -\multicolumn{1}{c|}{rdr} & R-type \\ +\multicolumn{1}{c|}{rd} & R-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & @@ -1512,7 +1530,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{funct5} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & R4-type \\ +\multicolumn{1}{c|}{rd} & R4-type \\ \cline{2-12} @@ -1527,8 +1545,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000101} & -\multicolumn{1}{c|}{rdr} & SGNINJ.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SGNINJ.S rd,rs1,rs2 \\ \cline{2-12} @@ -1536,8 +1554,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000110} & -\multicolumn{1}{c|}{rdr} & SGNINJN.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SGNINJN.S rd,rs1,rs2 \\ \cline{2-12} @@ -1545,8 +1563,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000000111} & -\multicolumn{1}{c|}{rdr} & SGNMUL.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SGNMUL.S rd,rs1,rs2 \\ \cline{2-12} @@ -1554,8 +1572,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000101} & -\multicolumn{1}{c|}{rdr} & SGNINJ.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SGNINJ.D rd,rs1,rs2 \\ \cline{2-12} @@ -1563,8 +1581,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000110} & -\multicolumn{1}{c|}{rdr} & SGNINJN.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SGNINJN.D rd,rs1,rs2 \\ \cline{2-12} @@ -1572,8 +1590,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100000111} & -\multicolumn{1}{c|}{rdr} & SGNMUL.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & SGNMUL.D rd,rs1,rs2 \\ \cline{2-12} @@ -1581,8 +1599,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000010011} & -\multicolumn{1}{c|}{rdr} & CVT.S.D rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVT.S.D rd,rs1 \\ \cline{2-12} @@ -1590,8 +1608,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100010000} & -\multicolumn{1}{c|}{rdr} & CVT.D.S rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVT.D.S rd,rs1 \\ \cline{2-12} @@ -1601,8 +1619,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{110011} & -\multicolumn{1}{c|}{rdr} & CVT.S.D.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.S.D.RM rd,rs1 \\ \cline{2-12} @@ -1617,8 +1635,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000001100} & -\multicolumn{1}{c|}{rdr} & CVT.S.L rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVT.S.L rd,rs1 \\ \cline{2-12} @@ -1626,8 +1644,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000001101} & -\multicolumn{1}{c|}{rdr} & CVTU.S.L rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVTU.S.L rd,rs1 \\ \cline{2-12} @@ -1635,8 +1653,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000001110} & -\multicolumn{1}{c|}{rdr} & CVT.S.W rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVT.S.W rd,rs1 \\ \cline{2-12} @@ -1644,8 +1662,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000001111} & -\multicolumn{1}{c|}{rdr} & CVTU.S.W rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVTU.S.W rd,rs1 \\ \cline{2-12} @@ -1653,8 +1671,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100001100} & -\multicolumn{1}{c|}{rdr} & CVT.D.L rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVT.D.L rd,rs1 \\ \cline{2-12} @@ -1662,8 +1680,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100001101} & -\multicolumn{1}{c|}{rdr} & CVTU.D.L rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVTU.D.L rd,rs1 \\ \cline{2-12} @@ -1671,8 +1689,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100001110} & -\multicolumn{1}{c|}{rdr} & CVT.D.W rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVT.D.W rd,rs1 \\ \cline{2-12} @@ -1680,8 +1698,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100001111} & -\multicolumn{1}{c|}{rdr} & CVTU.D.W rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & CVTU.D.W rd,rs1 \\ \cline{2-12} @@ -1691,8 +1709,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101100} & -\multicolumn{1}{c|}{rdr} & CVT.S.L.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.S.L.RM rd,rs1 \\ \cline{2-12} @@ -1702,8 +1720,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101101} & -\multicolumn{1}{c|}{rdr} & CVTU.S.L.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVTU.S.L.RM rd,rs1 \\ \cline{2-12} @@ -1713,8 +1731,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101110} & -\multicolumn{1}{c|}{rdr} & CVT.S.W.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.S.W.RM rd,rs1 \\ \cline{2-12} @@ -1724,8 +1742,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101111} & -\multicolumn{1}{c|}{rdr} & CVTU.S.W.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVTU.S.W.RM rd,rs1 \\ \cline{2-12} @@ -1733,10 +1751,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101100} & -\multicolumn{1}{c|}{rdr} & CVT.D.L.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.D.L.RM rd,rs1 \\ \cline{2-12} @@ -1744,10 +1762,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101101} & -\multicolumn{1}{c|}{rdr} & CVTU.D.L.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVTU.D.L.RM rd,rs1 \\ \cline{2-12} @@ -1755,8 +1773,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1101111100} & -\multicolumn{1}{c|}{rdr} & MTFLH.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MTFLH.D rd,rs1,rs2 \\ \cline{2-12} @@ -1764,8 +1782,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0001011100} & -\multicolumn{1}{c|}{rdr} & MTF.S rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MTF.S rd,rs1 \\ \cline{2-12} @@ -1773,8 +1791,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1101011100} & -\multicolumn{1}{c|}{rdr} & MTF.D rdr,rs1 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MTF.D rd,rs1 \\ \cline{2-12} @@ -1791,8 +1809,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101000} & -\multicolumn{1}{c|}{rdr} & CVT.L.S.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.L.S.RM rd,rs1 \\ \cline{2-12} @@ -1802,8 +1820,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101001} & -\multicolumn{1}{c|}{rdr} & CVTU.L.S.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVTU.L.S.RM rd,rs1 \\ \cline{2-12} @@ -1813,8 +1831,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101010} & -\multicolumn{1}{c|}{rdr} & CVT.W.S.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.W.S.RM rd,rs1 \\ \cline{2-12} @@ -1824,8 +1842,8 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101011} & -\multicolumn{1}{c|}{rdr} & CVTU.W.S.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVTU.W.S.RM rd,rs1 \\ \cline{2-12} @@ -1833,10 +1851,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101000} & -\multicolumn{1}{c|}{rdr} & CVT.L.D.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.L.D.RM rd,rs1 \\ \cline{2-12} @@ -1844,10 +1862,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101001} & -\multicolumn{1}{c|}{rdr} & CVTU.L.D.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVTU.L.D.RM rd,rs1 \\ \cline{2-12} @@ -1855,10 +1873,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101010} & -\multicolumn{1}{c|}{rdr} & CVT.W.D.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVT.W.D.RM rd,rs1 \\ \cline{2-12} @@ -1866,10 +1884,10 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{rs1} & -\multicolumn{1}{c|}{11} & +\multicolumn{1}{c|}{00} & \multicolumn{2}{c|}{rm} & -\multicolumn{3}{c|}{101011} & -\multicolumn{1}{c|}{rdr} & CVTU.W.D.RM rdr,rs1 \\ +\multicolumn{3}{c|}{000000} & +\multicolumn{1}{c|}{rd} & CVTU.W.D.RM rd,rs1 \\ \cline{2-12} @@ -1877,8 +1895,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{1101011001} & -\multicolumn{1}{c|}{rdr} & MFFL.D rdr,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MFFL.D rd,rs2 \\ \cline{2-12} @@ -1886,8 +1904,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{1101011010} & -\multicolumn{1}{c|}{rdr} & MFFH.D rdr,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MFFH.D rd,rs2 \\ \cline{2-12} @@ -1895,8 +1913,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{0001011000} & -\multicolumn{1}{c|}{rdr} & MFF.S rdr,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MFF.S rd,rs2 \\ \cline{2-12} @@ -1904,8 +1922,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{1101011000} & -\multicolumn{1}{c|}{rdr} & MFF.D rdr,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & MFF.D rd,rs2 \\ \cline{2-12} @@ -1954,19 +1972,19 @@ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{8}{c|}{LUI-immediate} & LUI-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi/rs2} & +\multicolumn{1}{c|}{rd/rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{2}{c|}{funct3} & \multicolumn{5}{c|}{immediate} & I-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & -\multicolumn{1}{c|}{rdi} & +\multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{rs1} & \multicolumn{5}{c|}{funct9} & \multicolumn{2}{c|}{shamt} & ISH-type \\ @@ -1976,7 +1994,7 @@ \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & \multicolumn{6}{c|}{funct10} & -\multicolumn{1}{c|}{rdr} & R-type \\ +\multicolumn{1}{c|}{rd} & R-type \\ \cline{2-12} & \multicolumn{2}{|c|}{opcode} & @@ -1984,7 +2002,7 @@ \multicolumn{1}{c|}{rs1} & \multicolumn{4}{c|}{funct5} & \multicolumn{2}{c|}{rs3} & -\multicolumn{1}{c|}{rdr} & R4-type \\ +\multicolumn{1}{c|}{rd} & R4-type \\ \cline{2-12} @@ -1999,8 +2017,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000010101} & -\multicolumn{1}{c|}{rdr} & C.EQ.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & C.EQ.S rd,rs1,rs2 \\ \cline{2-12} @@ -2008,8 +2026,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000010110} & -\multicolumn{1}{c|}{rdr} & C.LT.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & C.LT.S rd,rs1,rs2 \\ \cline{2-12} @@ -2017,8 +2035,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0000010111} & -\multicolumn{1}{c|}{rdr} & C.LE.S rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & C.LE.S rd,rs1,rs2 \\ \cline{2-12} @@ -2026,8 +2044,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100010101} & -\multicolumn{1}{c|}{rdr} & C.EQ.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & C.EQ.D rd,rs1,rs2 \\ \cline{2-12} @@ -2035,8 +2053,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100010110} & -\multicolumn{1}{c|}{rdr} & C.LT.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & C.LT.D rd,rs1,rs2 \\ \cline{2-12} @@ -2044,8 +2062,8 @@ \multicolumn{2}{|c|}{1101010} & \multicolumn{1}{c|}{rs2} & \multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1100010111} & -\multicolumn{1}{c|}{rdr} & C.LE.D rdr,rs1,rs2 \\ +\multicolumn{6}{c|}{0000000000} & +\multicolumn{1}{c|}{rd} & C.LE.D rd,rs1,rs2 \\ \cline{2-12} @@ -2057,111 +2075,12 @@ & -\multicolumn{2}{|c|}{1111011} & -\multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{0010000000} & -\multicolumn{1}{c|}{rdr} & RDNPC rdr \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111011} & -\multicolumn{1}{c|}{rs2} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{0100000000} & -\multicolumn{1}{c|}{rdr} & MFCR rdr,rs2 \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111011} & -\multicolumn{1}{c|}{rs2} & -\multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{0110000000} & -\multicolumn{1}{c|}{00000} & MTCR rs1,rs2 \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111011} & -\multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{1000000000} & -\multicolumn{1}{c|}{00000} & SYNC \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111011} & -\multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{1010000000} & -\multicolumn{1}{c|}{00000} & SYSCALL imm12 \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111011} & -\multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{1100000000} & -\multicolumn{1}{c|}{00000} & BREAK imm12 \\ -\cline{2-12} - - -& \multicolumn{11}{c}{} & \\ & \multicolumn{11}{c}{\bf Privileged Instructions} & \\ \cline{2-12} -& -\multicolumn{2}{|c|}{1111110} & -\multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{0000000000} & -\multicolumn{1}{c|}{rdr} & EI rdr \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111110} & -\multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{0010000000} & -\multicolumn{1}{c|}{rdr} & DI rdr \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111110} & -\multicolumn{1}{c|}{00000} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{0100000000} & -\multicolumn{1}{c|}{00000} & ERET \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111110} & -\multicolumn{1}{c|}{rs2} & -\multicolumn{1}{c|}{00000} & -\multicolumn{6}{c|}{1000000000} & -\multicolumn{1}{c|}{rdr} & MFPCR rdr,rs2 \\ -\cline{2-12} - - -& -\multicolumn{2}{|c|}{1111110} & -\multicolumn{1}{c|}{rs2} & -\multicolumn{1}{c|}{rs1} & -\multicolumn{6}{c|}{1010000000} & -\multicolumn{1}{c|}{00000} & MTPCR rs1,rs2 \\ -\cline{2-12} - - \end{tabular} \end{center} \end{small} @@ -2,7 +2,7 @@ # <instruction name> <opcode> <args> # # <opcode> is given by specifying one or more range/value pairs: -# highbit..lowbit=value (e.g. 31..25=0x45 14..12=0x0) +# highbit..lowbit=value (e.g. 31..25=0x45 24..22=0x0) # # <args> is one of xa,xb,xc,fa,fb,fc,fd,imm,imm20,imm27,shamt,shamtw @@ -11,218 +11,221 @@ unimp 31..0=0 j 31..25=0x60 imm25 jal 31..25=0x61 imm25 -lui 31..25=0x71 rdi imm20 - -beq 31..25=0x73 14..12=0 rs1 rs2 imm12 -bne 31..25=0x73 14..12=1 rs1 rs2 imm12 -blt 31..25=0x73 14..12=4 rs1 rs2 imm12 -bge 31..25=0x73 14..12=5 rs1 rs2 imm12 -bltu 31..25=0x73 14..12=6 rs1 rs2 imm12 -bgeu 31..25=0x73 14..12=7 rs1 rs2 imm12 - -addi 31..25=0x74 14..12=0 rdi rs1 imm12 -slti 31..25=0x74 14..12=2 rdi rs1 imm12 -sltiu 31..25=0x74 14..12=3 rdi rs1 imm12 -andi 31..25=0x74 14..12=4 rdi rs1 imm12 -ori 31..25=0x74 14..12=5 rdi rs1 imm12 -xori 31..25=0x74 14..12=6 rdi rs1 imm12 -slli 31..25=0x74 14..12=7 11..6=1 rdi rs1 shamt -srli 31..25=0x74 14..12=7 11..6=2 rdi rs1 shamt -srai 31..25=0x74 14..12=7 11..6=3 rdi rs1 shamt - -add 31..25=0x75 14..12=0 11..5=0 rdr rs1 rs2 -sub 31..25=0x75 14..12=0 11..5=1 rdr rs1 rs2 -slt 31..25=0x75 14..12=0 11..5=2 rdr rs1 rs2 -sltu 31..25=0x75 14..12=0 11..5=3 rdr rs1 rs2 -and 31..25=0x75 14..12=0 11..5=4 rdr rs1 rs2 -or 31..25=0x75 14..12=0 11..5=5 rdr rs1 rs2 -xor 31..25=0x75 14..12=0 11..5=6 rdr rs1 rs2 -nor 31..25=0x75 14..12=0 11..5=7 rdr rs1 rs2 -sll 31..25=0x75 14..12=7 11..6=1 5=0 rdr rs1 rs2 -srl 31..25=0x75 14..12=7 11..6=2 5=0 rdr rs1 rs2 -sra 31..25=0x75 14..12=7 11..6=3 5=0 rdr rs1 rs2 - -mul 31..25=0x75 14..12=1 11..5=0 rdr rs1 rs2 -mulh 31..25=0x75 14..12=1 11..5=2 rdr rs1 rs2 -mulhu 31..25=0x75 14..12=1 11..5=3 rdr rs1 rs2 -div 31..25=0x75 14..12=1 11..5=4 rdr rs1 rs2 -divu 31..25=0x75 14..12=1 11..5=5 rdr rs1 rs2 -rem 31..25=0x75 14..12=1 11..5=6 rdr rs1 rs2 -remu 31..25=0x75 14..12=1 11..5=7 rdr rs1 rs2 - - - -addiw 31..25=0x76 14..12=0 rdi rs1 imm12 -slliw 31..25=0x76 14..12=7 11..6=1 5=0 rdi rs1 shamtw -srliw 31..25=0x76 14..12=7 11..6=2 5=0 rdi rs1 shamtw -sraiw 31..25=0x76 14..12=7 11..6=3 5=0 rdi rs1 shamtw - -addw 31..25=0x77 14..12=0 11..5=0 rdr rs1 rs2 -subw 31..25=0x77 14..12=0 11..5=1 rdr rs1 rs2 -sllw 31..25=0x77 14..12=7 11..6=1 5=0 rdr rs1 rs2 -srlw 31..25=0x77 14..12=7 11..6=2 5=0 rdr rs1 rs2 -sraw 31..25=0x77 14..12=7 11..6=3 5=0 rdr rs1 rs2 - -mulw 31..25=0x77 14..12=1 11..5=0 rdr rs1 rs2 -mulhw 31..25=0x77 14..12=1 11..5=2 rdr rs1 rs2 -mulhuw 31..25=0x77 14..12=1 11..5=3 rdr rs1 rs2 -divw 31..25=0x77 14..12=1 11..5=4 rdr rs1 rs2 -divuw 31..25=0x77 14..12=1 11..5=5 rdr rs1 rs2 -remw 31..25=0x77 14..12=1 11..5=6 rdr rs1 rs2 -remuw 31..25=0x77 14..12=1 11..5=7 rdr rs1 rs2 - -lb 31..25=0x78 14..12=0 rdi rs1 imm12 -lh 31..25=0x78 14..12=1 rdi rs1 imm12 -lw 31..25=0x78 14..12=2 rdi rs1 imm12 -ld 31..25=0x78 14..12=3 rdi rs1 imm12 -lbu 31..25=0x78 14..12=4 rdi rs1 imm12 -lhu 31..25=0x78 14..12=5 rdi rs1 imm12 -lwu 31..25=0x78 14..12=6 rdi rs1 imm12 -synci 31..25=0x78 14..12=7 24..20=0 rs1 imm12 - -sb 31..25=0x79 14..12=0 rs2 rs1 imm12 -sh 31..25=0x79 14..12=1 rs2 rs1 imm12 -sw 31..25=0x79 14..12=2 rs2 rs1 imm12 -sd 31..25=0x79 14..12=3 rs2 rs1 imm12 - -amow.add 31..25=0x7A 14..12=2 11..5=0 rdr rs1 rs2 -amow.swap 31..25=0x7A 14..12=2 11..5=1 rdr rs1 rs2 -amow.and 31..25=0x7A 14..12=2 11..5=2 rdr rs1 rs2 -amow.or 31..25=0x7A 14..12=2 11..5=3 rdr rs1 rs2 -amow.min 31..25=0x7A 14..12=2 11..5=4 rdr rs1 rs2 -amow.max 31..25=0x7A 14..12=2 11..5=5 rdr rs1 rs2 -amow.minu 31..25=0x7A 14..12=2 11..5=6 rdr rs1 rs2 -amow.maxu 31..25=0x7A 14..12=2 11..5=7 rdr rs1 rs2 - -amo.add 31..25=0x7A 14..12=3 11..5=0 rdr rs1 rs2 -amo.swap 31..25=0x7A 14..12=3 11..5=1 rdr rs1 rs2 -amo.and 31..25=0x7A 14..12=3 11..5=2 rdr rs1 rs2 -amo.or 31..25=0x7A 14..12=3 11..5=3 rdr rs1 rs2 -amo.min 31..25=0x7A 14..12=3 11..5=4 rdr rs1 rs2 -amo.max 31..25=0x7A 14..12=3 11..5=5 rdr rs1 rs2 -amo.minu 31..25=0x7A 14..12=3 11..5=6 rdr rs1 rs2 -amo.maxu 31..25=0x7A 14..12=3 11..5=7 rdr rs1 rs2 - -jalr.c 31..25=0x7B 24..20=0 14..12=0 11..5=0 rdr rs1 -jalr.r 31..25=0x7B 24..20=0 14..12=0 11..5=1 rdr rs1 -jalr.j 31..25=0x7B 24..20=0 14..12=0 11..5=2 rdr rs1 -rdnpc 31..25=0x7B 24..15=0 14..12=1 11..5=0 rdr -mfcr 31..25=0x7B 19..15=0 14..12=2 11..5=0 rdr rs2 -mtcr 31..25=0x7B 14..12=3 11..0=0 rs1 rs2 -sync 31..25=0x7B 24..15=0 14..12=4 11..0=0 -syscall 31..25=0x7B 24..15=0 14..12=5 imm12 -break 31..25=0x7B 24..15=0 14..12=6 imm12 - -ei 31..25=0x7E 14..12=0 24..15=0 11..5=0 rdr -di 31..25=0x7E 14..12=1 24..15=0 11..5=0 rdr -eret 31..25=0x7E 14..12=2 24..15=0 11..0=0 -mfpcr 31..25=0x7E 14..12=4 19..15=0 11..5=0 rdr rs2 -mtpcr 31..25=0x7E 14..12=5 11..0=0 rs1 rs2 +lui 31..25=0x71 rd imm20 + +jalr.c 31..25=0x72 24..22=0 rd rs1 imm12 +jalr.r 31..25=0x72 24..22=1 rd rs1 imm12 +jalr.j 31..25=0x72 24..22=2 rd rs1 imm12 + +beq 31..25=0x73 24..22=0 rs1 rs2 imm12lo imm12hi +bne 31..25=0x73 24..22=1 rs1 rs2 imm12lo imm12hi +blt 31..25=0x73 24..22=4 rs1 rs2 imm12lo imm12hi +bge 31..25=0x73 24..22=5 rs1 rs2 imm12lo imm12hi +bltu 31..25=0x73 24..22=6 rs1 rs2 imm12lo imm12hi +bgeu 31..25=0x73 24..22=7 rs1 rs2 imm12lo imm12hi + +addi 31..25=0x74 24..22=0 rd rs1 imm12 +slti 31..25=0x74 24..22=2 rd rs1 imm12 +sltiu 31..25=0x74 24..22=3 rd rs1 imm12 +andi 31..25=0x74 24..22=4 rd rs1 imm12 +ori 31..25=0x74 24..22=5 rd rs1 imm12 +xori 31..25=0x74 24..22=6 rd rs1 imm12 +slli 31..25=0x74 24..22=7 21..16=1 rd rs1 shamt +srli 31..25=0x74 24..22=7 21..16=2 rd rs1 shamt +srai 31..25=0x74 24..22=7 21..16=3 rd rs1 shamt + +add 31..25=0x75 24..22=0 21..15=0 rd rs1 rs2 +sub 31..25=0x75 24..22=0 21..15=1 rd rs1 rs2 +slt 31..25=0x75 24..22=0 21..15=2 rd rs1 rs2 +sltu 31..25=0x75 24..22=0 21..15=3 rd rs1 rs2 +and 31..25=0x75 24..22=0 21..15=4 rd rs1 rs2 +or 31..25=0x75 24..22=0 21..15=5 rd rs1 rs2 +xor 31..25=0x75 24..22=0 21..15=6 rd rs1 rs2 +nor 31..25=0x75 24..22=0 21..15=7 rd rs1 rs2 +sll 31..25=0x75 24..22=7 21..16=1 15=0 rd rs1 rs2 +srl 31..25=0x75 24..22=7 21..16=2 15=0 rd rs1 rs2 +sra 31..25=0x75 24..22=7 21..16=3 15=0 rd rs1 rs2 + +mul 31..25=0x75 24..22=1 21..15=0 rd rs1 rs2 +mulh 31..25=0x75 24..22=1 21..15=2 rd rs1 rs2 +mulhu 31..25=0x75 24..22=1 21..15=3 rd rs1 rs2 +div 31..25=0x75 24..22=1 21..15=4 rd rs1 rs2 +divu 31..25=0x75 24..22=1 21..15=5 rd rs1 rs2 +rem 31..25=0x75 24..22=1 21..15=6 rd rs1 rs2 +remu 31..25=0x75 24..22=1 21..15=7 rd rs1 rs2 + + + +addiw 31..25=0x76 24..22=0 rd rs1 imm12 +slliw 31..25=0x76 24..22=7 21..16=1 15=0 rd rs1 shamtw +srliw 31..25=0x76 24..22=7 21..16=2 15=0 rd rs1 shamtw +sraiw 31..25=0x76 24..22=7 21..16=3 15=0 rd rs1 shamtw + +addw 31..25=0x77 24..22=0 21..15=0 rd rs1 rs2 +subw 31..25=0x77 24..22=0 21..15=1 rd rs1 rs2 +sllw 31..25=0x77 24..22=7 21..16=1 15=0 rd rs1 rs2 +srlw 31..25=0x77 24..22=7 21..16=2 15=0 rd rs1 rs2 +sraw 31..25=0x77 24..22=7 21..16=3 15=0 rd rs1 rs2 + +mulw 31..25=0x77 24..22=1 21..15=0 rd rs1 rs2 +mulhw 31..25=0x77 24..22=1 21..15=2 rd rs1 rs2 +mulhuw 31..25=0x77 24..22=1 21..15=3 rd rs1 rs2 +divw 31..25=0x77 24..22=1 21..15=4 rd rs1 rs2 +divuw 31..25=0x77 24..22=1 21..15=5 rd rs1 rs2 +remw 31..25=0x77 24..22=1 21..15=6 rd rs1 rs2 +remuw 31..25=0x77 24..22=1 21..15=7 rd rs1 rs2 + +lb 31..25=0x78 24..22=0 rd rs1 imm12 +lh 31..25=0x78 24..22=1 rd rs1 imm12 +lw 31..25=0x78 24..22=2 rd rs1 imm12 +ld 31..25=0x78 24..22=3 rd rs1 imm12 +lbu 31..25=0x78 24..22=4 rd rs1 imm12 +lhu 31..25=0x78 24..22=5 rd rs1 imm12 +lwu 31..25=0x78 24..22=6 rd rs1 imm12 +synci 31..25=0x78 24..22=7 4..0=0 rs1 imm12 + +# NOTE: if you add new store instructions, make sure to modify tc-mips-riscv.c +# and elfxx-mips.c to detect them. this is a hack to handle the split immed. +# just open up those files and search for MATCH_SW; should be obvious. +sb 31..25=0x79 24..22=0 rs2 rs1 imm12lo imm12hi +sh 31..25=0x79 24..22=1 rs2 rs1 imm12lo imm12hi +sw 31..25=0x79 24..22=2 rs2 rs1 imm12lo imm12hi +sd 31..25=0x79 24..22=3 rs2 rs1 imm12lo imm12hi + +amow.add 31..25=0x7A 24..22=2 21..15=0 rd rs1 rs2 +amow.swap 31..25=0x7A 24..22=2 21..15=1 rd rs1 rs2 +amow.and 31..25=0x7A 24..22=2 21..15=2 rd rs1 rs2 +amow.or 31..25=0x7A 24..22=2 21..15=3 rd rs1 rs2 +amow.min 31..25=0x7A 24..22=2 21..15=4 rd rs1 rs2 +amow.max 31..25=0x7A 24..22=2 21..15=5 rd rs1 rs2 +amow.minu 31..25=0x7A 24..22=2 21..15=6 rd rs1 rs2 +amow.maxu 31..25=0x7A 24..22=2 21..15=7 rd rs1 rs2 + +amo.add 31..25=0x7A 24..22=3 21..15=0 rd rs1 rs2 +amo.swap 31..25=0x7A 24..22=3 21..15=1 rd rs1 rs2 +amo.and 31..25=0x7A 24..22=3 21..15=2 rd rs1 rs2 +amo.or 31..25=0x7A 24..22=3 21..15=3 rd rs1 rs2 +amo.min 31..25=0x7A 24..22=3 21..15=4 rd rs1 rs2 +amo.max 31..25=0x7A 24..22=3 21..15=5 rd rs1 rs2 +amo.minu 31..25=0x7A 24..22=3 21..15=6 rd rs1 rs2 +amo.maxu 31..25=0x7A 24..22=3 21..15=7 rd rs1 rs2 + +rdnpc 31..25=0x7B 24..22=0 21..15=0 14..5=0 rd +mfcr 31..25=0x7B 24..22=1 21..15=0 9..5=0 rd rs2 +mtcr 31..25=0x7B 24..22=1 21..15=1 4..0=0 rs1 rs2 +sync 31..25=0x7B 24..22=2 21..15=0 14..0=0 +syscall 31..25=0x7B 24..22=3 9..0=0 imm12 + +ei 31..25=0x6B 24..22=0 21..15=0 14..5=0 rd +di 31..25=0x6B 24..22=0 21..15=1 14..5=0 rd +mfpcr 31..25=0x6B 24..22=1 21..15=0 9..5=0 rd rs2 +mtpcr 31..25=0x6B 24..22=1 21..15=1 4..0=0 rs1 rs2 +eret 31..25=0x6B 24..22=2 21..15=0 14..0=0 # 0x7F is reserved for 64-bit-long instructions -add.s 31..25=0x6A 14..13=0 12..10=0 9..5=0 rdr rs1 rs2 -sub.s 31..25=0x6A 14..13=0 12..10=0 9..5=1 rdr rs1 rs2 -mul.s 31..25=0x6A 14..13=0 12..10=0 9..5=2 rdr rs1 rs2 -div.s 31..25=0x6A 14..13=0 12..10=0 9..5=3 rdr rs1 rs2 -sqrt.s 31..25=0x6A 14..13=0 12..10=0 9..5=4 24..20=0 rdr rs1 -sgninj.s 31..25=0x6A 14..13=0 12..10=0 9..5=5 rdr rs1 rs2 -sgninjn.s 31..25=0x6A 14..13=0 12..10=0 9..5=6 rdr rs1 rs2 -sgnmul.s 31..25=0x6A 14..13=0 12..10=0 9..5=7 rdr rs1 rs2 - -add.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x0 rdr rs1 rs2 -sub.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x1 rdr rs1 rs2 -mul.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x2 rdr rs1 rs2 -div.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x3 rdr rs1 rs2 -sqrt.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x4 24..20=0 rdr rs1 -sgninj.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x5 rdr rs1 rs2 -sgninjn.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x6 rdr rs1 rs2 -sgnmul.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x7 rdr rs1 rs2 - -add.s.rm 31..25=0x6A 14..13=0 10=1 9..5=0 rm rdr rs1 rs2 -sub.s.rm 31..25=0x6A 14..13=0 10=1 9..5=1 rm rdr rs1 rs2 -mul.s.rm 31..25=0x6A 14..13=0 10=1 9..5=2 rm rdr rs1 rs2 -div.s.rm 31..25=0x6A 14..13=0 10=1 9..5=3 rm rdr rs1 rs2 -sqrt.s.rm 31..25=0x6A 14..13=0 10=1 9..5=4 24..20=0 rm rdr rs1 - -add.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0x0 rm rdr rs1 rs2 -sub.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0x1 rm rdr rs1 rs2 -mul.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0x2 rm rdr rs1 rs2 -div.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0x3 rm rdr rs1 rs2 -sqrt.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0x4 24..20=0 rm rdr rs1 - -cvt.l.s.rm 31..25=0x6A 14..13=0 10=1 9..5=0x8 24..20=0 rm rdr rs1 -cvtu.l.s.rm 31..25=0x6A 14..13=0 10=1 9..5=0x9 24..20=0 rm rdr rs1 -cvt.w.s.rm 31..25=0x6A 14..13=0 10=1 9..5=0xA 24..20=0 rm rdr rs1 -cvtu.w.s.rm 31..25=0x6A 14..13=0 10=1 9..5=0xB 24..20=0 rm rdr rs1 - -cvt.l.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0x8 24..20=0 rm rdr rs1 -cvtu.l.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0x9 24..20=0 rm rdr rs1 -cvt.w.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0xA 24..20=0 rm rdr rs1 -cvtu.w.d.rm 31..25=0x6A 14..13=3 10=1 9..5=0xB 24..20=0 rm rdr rs1 - -cvt.s.l 31..25=0x6A 14..13=0 12..10=0 9..5=0xC 24..20=0 rdr rs1 -cvtu.s.l 31..25=0x6A 14..13=0 12..10=0 9..5=0xD 24..20=0 rdr rs1 -cvt.s.w 31..25=0x6A 14..13=0 12..10=0 9..5=0xE 24..20=0 rdr rs1 -cvtu.s.w 31..25=0x6A 14..13=0 12..10=0 9..5=0xF 24..20=0 rdr rs1 - -cvt.d.l 31..25=0x6A 14..13=3 12..10=0 9..5=0xC 24..20=0 rdr rs1 -cvtu.d.l 31..25=0x6A 14..13=3 12..10=0 9..5=0xD 24..20=0 rdr rs1 -cvt.d.w 31..25=0x6A 14..13=3 12..10=0 9..5=0xE 24..20=0 rdr rs1 -cvtu.d.w 31..25=0x6A 14..13=3 12..10=0 9..5=0xF 24..20=0 rdr rs1 - -cvt.s.l.rm 31..25=0x6A 14..13=0 10=1 9..5=0xC 24..20=0 rm rdr rs1 -cvtu.s.l.rm 31..25=0x6A 14..13=0 10=1 9..5=0xD 24..20=0 rm rdr rs1 -cvt.s.w.rm 31..25=0x6A 14..13=0 10=1 9..5=0xE 24..20=0 rm rdr rs1 -cvtu.s.w.rm 31..25=0x6A 14..13=0 10=1 9..5=0xF 24..20=0 rm rdr rs1 - -cvt.d.l.rm 31..25=0x6A 14..13=3 10=1 9..5=0xC 24..20=0 rm rdr rs1 -cvtu.d.l.rm 31..25=0x6A 14..13=3 10=1 9..5=0xD 24..20=0 rm rdr rs1 - -cvt.s.d 31..25=0x6A 14..13=0 12..10=0 9..5=0x13 24..20=0 rdr rs1 -cvt.d.s 31..25=0x6A 14..13=3 12..10=0 9..5=0x10 24..20=0 rdr rs1 - -cvt.s.d.rm 31..25=0x6A 14..13=0 10=1 9..5=0x13 24..20=0 rm rdr rs1 - -c.eq.s 31..25=0x6A 14..13=0 12..10=0 9..5=0x15 rdr rs1 rs2 -c.lt.s 31..25=0x6A 14..13=0 12..10=0 9..5=0x16 rdr rs1 rs2 -c.le.s 31..25=0x6A 14..13=0 12..10=0 9..5=0x17 rdr rs1 rs2 - -c.eq.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x15 rdr rs1 rs2 -c.lt.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x16 rdr rs1 rs2 -c.le.d 31..25=0x6A 14..13=3 12..10=0 9..5=0x17 rdr rs1 rs2 - -mff.s 31..25=0x6A 19..15=0 14..13=0 12..10=2 9..5=0x18 rdr rs2 -mff.d 31..25=0x6A 19..15=0 14..13=3 12..10=2 9..5=0x18 rdr rs2 -mffl.d 31..25=0x6A 19..15=0 14..13=3 12..10=2 9..5=0x19 rdr rs2 -mffh.d 31..25=0x6A 19..15=0 14..13=3 12..10=2 9..5=0x1A rdr rs2 -mtf.s 31..25=0x6A 24..20=0 14..13=0 12..10=2 9..5=0x1C rdr rs1 -mtf.d 31..25=0x6A 24..20=0 14..13=3 12..10=2 9..5=0x1C rdr rs1 -mtflh.d 31..25=0x6A 14..13=3 12..10=3 9..5=0x1C rdr rs1 rs2 - -l.s 31..25=0x68 14..12=2 rdi rs1 imm12 -l.d 31..25=0x68 14..12=3 rdi rs1 imm12 - -s.s 31..25=0x69 14..12=2 rs2 rs1 imm12 -s.d 31..25=0x69 14..12=3 rs2 rs1 imm12 - -madd.s 31..25=0x6C 14..13=0 12..10=0 rdr rs1 rs2 rs3 -msub.s 31..25=0x6D 14..13=0 12..10=0 rdr rs1 rs2 rs3 -nmsub.s 31..25=0x6E 14..13=0 12..10=0 rdr rs1 rs2 rs3 -nmadd.s 31..25=0x6F 14..13=0 12..10=0 rdr rs1 rs2 rs3 - -madd.d 31..25=0x6C 14..13=3 12..10=0 rdr rs1 rs2 rs3 -msub.d 31..25=0x6D 14..13=3 12..10=0 rdr rs1 rs2 rs3 -nmsub.d 31..25=0x6E 14..13=3 12..10=0 rdr rs1 rs2 rs3 -nmadd.d 31..25=0x6F 14..13=3 12..10=0 rdr rs1 rs2 rs3 - -madd.s.rm 31..25=0x6C 14..13=0 10=1 rm rdr rs1 rs2 rs3 -msub.s.rm 31..25=0x6D 14..13=0 10=1 rm rdr rs1 rs2 rs3 -nmsub.s.rm 31..25=0x6E 14..13=0 10=1 rm rdr rs1 rs2 rs3 -nmadd.s.rm 31..25=0x6F 14..13=0 10=1 rm rdr rs1 rs2 rs3 - -madd.d.rm 31..25=0x6C 14..13=3 10=1 rm rdr rs1 rs2 rs3 -msub.d.rm 31..25=0x6D 14..13=3 10=1 rm rdr rs1 rs2 rs3 -nmsub.d.rm 31..25=0x6E 14..13=3 10=1 rm rdr rs1 rs2 rs3 -nmadd.d.rm 31..25=0x6F 14..13=3 10=1 rm rdr rs1 rs2 rs3 +add.s 31..25=0x6A 24..23=0 22..20=0 19..15=0 rd rs1 rs2 +sub.s 31..25=0x6A 24..23=0 22..20=0 19..15=1 rd rs1 rs2 +mul.s 31..25=0x6A 24..23=0 22..20=0 19..15=2 rd rs1 rs2 +div.s 31..25=0x6A 24..23=0 22..20=0 19..15=3 rd rs1 rs2 +sqrt.s 31..25=0x6A 24..23=0 22..20=0 19..15=4 14..10=0 rd rs1 +sgninj.s 31..25=0x6A 24..23=0 22..20=0 19..15=5 rd rs1 rs2 +sgninjn.s 31..25=0x6A 24..23=0 22..20=0 19..15=6 rd rs1 rs2 +sgnmul.s 31..25=0x6A 24..23=0 22..20=0 19..15=7 rd rs1 rs2 + +add.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x0 rd rs1 rs2 +sub.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x1 rd rs1 rs2 +mul.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x2 rd rs1 rs2 +div.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x3 rd rs1 rs2 +sqrt.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x4 14..10=0 rd rs1 +sgninj.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x5 rd rs1 rs2 +sgninjn.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x6 rd rs1 rs2 +sgnmul.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x7 rd rs1 rs2 + +add.s.rm 31..25=0x6A 24..23=0 22=1 19..15=0 rm rd rs1 rs2 +sub.s.rm 31..25=0x6A 24..23=0 22=1 19..15=1 rm rd rs1 rs2 +mul.s.rm 31..25=0x6A 24..23=0 22=1 19..15=2 rm rd rs1 rs2 +div.s.rm 31..25=0x6A 24..23=0 22=1 19..15=3 rm rd rs1 rs2 +sqrt.s.rm 31..25=0x6A 24..23=0 22=1 19..15=4 14..10=0 rm rd rs1 + +add.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0x0 rm rd rs1 rs2 +sub.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0x1 rm rd rs1 rs2 +mul.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0x2 rm rd rs1 rs2 +div.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0x3 rm rd rs1 rs2 +sqrt.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0x4 14..10=0 rm rd rs1 + +cvt.l.s.rm 31..25=0x6A 24..23=0 22=1 19..15=0x8 14..10=0 rm rd rs1 +cvtu.l.s.rm 31..25=0x6A 24..23=0 22=1 19..15=0x9 14..10=0 rm rd rs1 +cvt.w.s.rm 31..25=0x6A 24..23=0 22=1 19..15=0xA 14..10=0 rm rd rs1 +cvtu.w.s.rm 31..25=0x6A 24..23=0 22=1 19..15=0xB 14..10=0 rm rd rs1 + +cvt.l.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0x8 14..10=0 rm rd rs1 +cvtu.l.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0x9 14..10=0 rm rd rs1 +cvt.w.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0xA 14..10=0 rm rd rs1 +cvtu.w.d.rm 31..25=0x6A 24..23=3 22=1 19..15=0xB 14..10=0 rm rd rs1 + +cvt.s.l 31..25=0x6A 24..23=0 22..20=0 19..15=0xC 14..10=0 rd rs1 +cvtu.s.l 31..25=0x6A 24..23=0 22..20=0 19..15=0xD 14..10=0 rd rs1 +cvt.s.w 31..25=0x6A 24..23=0 22..20=0 19..15=0xE 14..10=0 rd rs1 +cvtu.s.w 31..25=0x6A 24..23=0 22..20=0 19..15=0xF 14..10=0 rd rs1 + +cvt.d.l 31..25=0x6A 24..23=3 22..20=0 19..15=0xC 14..10=0 rd rs1 +cvtu.d.l 31..25=0x6A 24..23=3 22..20=0 19..15=0xD 14..10=0 rd rs1 +cvt.d.w 31..25=0x6A 24..23=3 22..20=0 19..15=0xE 14..10=0 rd rs1 +cvtu.d.w 31..25=0x6A 24..23=3 22..20=0 19..15=0xF 14..10=0 rd rs1 + +cvt.s.l.rm 31..25=0x6A 24..23=0 22=1 19..15=0xC 14..10=0 rm rd rs1 +cvtu.s.l.rm 31..25=0x6A 24..23=0 22=1 19..15=0xD 14..10=0 rm rd rs1 +cvt.s.w.rm 31..25=0x6A 24..23=0 22=1 19..15=0xE 14..10=0 rm rd rs1 +cvtu.s.w.rm 31..25=0x6A 24..23=0 22=1 19..15=0xF 14..10=0 rm rd rs1 + +cvt.d.l.rm 31..25=0x6A 24..23=3 22=1 19..15=0xC 14..10=0 rm rd rs1 +cvtu.d.l.rm 31..25=0x6A 24..23=3 22=1 19..15=0xD 14..10=0 rm rd rs1 + +cvt.s.d 31..25=0x6A 24..23=0 22..20=0 19..15=0x13 14..10=0 rd rs1 +cvt.d.s 31..25=0x6A 24..23=3 22..20=0 19..15=0x10 14..10=0 rd rs1 + +cvt.s.d.rm 31..25=0x6A 24..23=0 22=1 19..15=0x13 14..10=0 rm rd rs1 + +c.eq.s 31..25=0x6A 24..23=0 22..20=0 19..15=0x15 rd rs1 rs2 +c.lt.s 31..25=0x6A 24..23=0 22..20=0 19..15=0x16 rd rs1 rs2 +c.le.s 31..25=0x6A 24..23=0 22..20=0 19..15=0x17 rd rs1 rs2 + +c.eq.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x15 rd rs1 rs2 +c.lt.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x16 rd rs1 rs2 +c.le.d 31..25=0x6A 24..23=3 22..20=0 19..15=0x17 rd rs1 rs2 + +mff.s 31..25=0x6A 9..5=0 24..23=0 22..20=2 19..15=0x18 rd rs2 +mff.d 31..25=0x6A 9..5=0 24..23=3 22..20=2 19..15=0x18 rd rs2 +mffl.d 31..25=0x6A 9..5=0 24..23=3 22..20=2 19..15=0x19 rd rs2 +mffh.d 31..25=0x6A 9..5=0 24..23=3 22..20=2 19..15=0x1A rd rs2 +mtf.s 31..25=0x6A 14..10=0 24..23=0 22..20=2 19..15=0x1C rd rs1 +mtf.d 31..25=0x6A 14..10=0 24..23=3 22..20=2 19..15=0x1C rd rs1 +mtflh.d 31..25=0x6A 24..23=3 22..20=3 19..15=0x1C rd rs1 rs2 + +l.s 31..25=0x68 24..22=2 rd rs1 imm12 +l.d 31..25=0x68 24..22=3 rd rs1 imm12 + +s.s 31..25=0x69 24..22=2 rs2 rs1 imm12lo imm12hi +s.d 31..25=0x69 24..22=3 rs2 rs1 imm12lo imm12hi + +madd.s 31..25=0x6C 24..23=0 22..20=0 rd rs1 rs2 rs3 +msub.s 31..25=0x6D 24..23=0 22..20=0 rd rs1 rs2 rs3 +nmsub.s 31..25=0x6E 24..23=0 22..20=0 rd rs1 rs2 rs3 +nmadd.s 31..25=0x6F 24..23=0 22..20=0 rd rs1 rs2 rs3 + +madd.d 31..25=0x6C 24..23=3 22..20=0 rd rs1 rs2 rs3 +msub.d 31..25=0x6D 24..23=3 22..20=0 rd rs1 rs2 rs3 +nmsub.d 31..25=0x6E 24..23=3 22..20=0 rd rs1 rs2 rs3 +nmadd.d 31..25=0x6F 24..23=3 22..20=0 rd rs1 rs2 rs3 + +madd.s.rm 31..25=0x6C 24..23=0 22=1 rm rd rs1 rs2 rs3 +msub.s.rm 31..25=0x6D 24..23=0 22=1 rm rd rs1 rs2 rs3 +nmsub.s.rm 31..25=0x6E 24..23=0 22=1 rm rd rs1 rs2 rs3 +nmadd.s.rm 31..25=0x6F 24..23=0 22=1 rm rd rs1 rs2 rs3 + +madd.d.rm 31..25=0x6C 24..23=3 22=1 rm rd rs1 rs2 rs3 +msub.d.rm 31..25=0x6D 24..23=3 22=1 rm rd rs1 rs2 rs3 +nmsub.d.rm 31..25=0x6E 24..23=3 22=1 rm rd rs1 rs2 rs3 +nmadd.d.rm 31..25=0x6F 24..23=3 22=1 rm rd rs1 rs2 rs3 diff --git a/parse-opcodes b/parse-opcodes index b1860df..0a9965b 100755 --- a/parse-opcodes +++ b/parse-opcodes @@ -11,23 +11,25 @@ arguments = {} types = {} arglut = {} -arglut['rdi'] = (24,20) -arglut['rs2'] = (24,20) -arglut['rs1'] = (19,15) -arglut['rdr'] = (4,0) -arglut['rs3'] = (9,5) +arglut['rs2'] = (14,10) +arglut['rs1'] = (9,5) +arglut['rd'] = (4,0) +arglut['rs3'] = (19,15) arglut['imm25'] = (24,0) -arglut['imm20'] = (19,0) -arglut['imm12'] = (11,0) -arglut['shamt'] = (5,0) -arglut['shamtw'] = (4,0) -arglut['rm'] = (12,11) +arglut['imm20'] = (24,5) +arglut['imm12'] = (21,10) +arglut['imm12lo'] = (4,0) +arglut['imm12hi'] = (21,15) +arglut['shamt'] = (15,10) +arglut['shamtw'] = (14,10) +arglut['rm'] = (21,20) typelut = {} # 0=unimp,1=j,2=lui,3=imm,4=r,5=r4,6=ish,7=ishw typelut[0x00] = 0 typelut[0x60] = 1 typelut[0x61] = 1 typelut[0x71] = 2 +typelut[0x72] = 3 typelut[0x73] = 3 typelut[0x74] = 3 typelut[0x75] = 4 @@ -37,10 +39,10 @@ typelut[0x78] = 3 typelut[0x79] = 3 typelut[0x7a] = 4 typelut[0x7b] = 4 -typelut[0x7e] = 4 typelut[0x68] = 3 typelut[0x69] = 3 typelut[0x6a] = 4 +typelut[0x6b] = 4 typelut[0x6c] = 5 typelut[0x6d] = 5 typelut[0x6e] = 5 @@ -60,7 +62,7 @@ def make_disasm_table(match,mask): def make_switch(match,mask): opcode_base = 25 opcode_size = 7 - funct_base = 12 + funct_base = 22 funct_size = 3 opcode_mask = ((1<<(opcode_base+opcode_size))-(1<<opcode_base)) @@ -189,7 +191,7 @@ def print_lui_type(name,match,arguments): """ % \ ( \ binary(yank(match,25,7),7), \ - str_arg('rdi','',match,arguments), \ + str_arg('rd','',match,arguments), \ str_arg('imm20','',match,arguments), \ str_inst(name,arguments) \ ) @@ -206,7 +208,7 @@ def print_i_type(name,match,arguments): """ % \ ( \ binary(yank(match,25,7),7), \ - str_arg('rdi','rs2',match,arguments), \ + str_arg('rd','rs2',match,arguments), \ str_arg('rs1','',match,arguments), \ binary(yank(match,12,3),3), \ str_arg('imm12','',match,arguments), \ @@ -225,7 +227,7 @@ def print_ish_type(name,match,arguments): """ % \ ( \ binary(yank(match,25,7),7), \ - str_arg('rdi','',match,arguments), \ + str_arg('rd','',match,arguments), \ str_arg('rs1','',match,arguments), \ binary(yank(match,6,9),9), \ str_arg('shamt','',match,arguments), \ @@ -245,7 +247,7 @@ def print_ishw_type(name,match,arguments): """ % \ ( \ binary(yank(match,25,7),7), \ - str_arg('rdi','',match,arguments), \ + str_arg('rd','',match,arguments), \ str_arg('rs1','',match,arguments), \ binary(yank(match,6,9),9), \ str_arg('shamtw','',match,arguments), \ @@ -267,7 +269,7 @@ def print_r_type(name,match,arguments): str_arg('rs2','',match,arguments), \ str_arg('rs1','',match,arguments), \ binary(yank(match,5,10),10), \ - str_arg('rdr','',match,arguments), \ + str_arg('rd','',match,arguments), \ str_inst(name,arguments) \ ) @@ -290,7 +292,7 @@ def print_r_rm_type(name,match,arguments): binary(yank(match,13,2),2), \ str_arg('rm','',match,arguments), \ binary(yank(match,5,6),6), \ - str_arg('rdr','',match,arguments), \ + str_arg('rd','',match,arguments), \ str_inst(name,arguments) \ ) @@ -311,7 +313,7 @@ def print_r4_type(name,match,arguments): str_arg('rs1','',match,arguments), \ binary(yank(match,10,5),5), \ str_arg('rs3','',match,arguments), \ - str_arg('rdr','',match,arguments), \ + str_arg('rd','',match,arguments), \ str_inst(name,arguments) \ ) @@ -336,7 +338,7 @@ def print_r4_rm_type(name,match,arguments): str_arg('rm','',match,arguments), \ binary(yank(match,10,1),1), \ str_arg('rs3','',match,arguments), \ - str_arg('rdr','',match,arguments), \ + str_arg('rd','',match,arguments), \ str_inst(name,arguments) \ ) @@ -379,19 +381,19 @@ def print_header(): \\cline{2-12} & \\multicolumn{2}{|c|}{opcode} & -\\multicolumn{1}{c|}{rdi} & +\\multicolumn{1}{c|}{rd} & \\multicolumn{8}{c|}{LUI-immediate} & LUI-type \\\\ \\cline{2-12} & \\multicolumn{2}{|c|}{opcode} & -\\multicolumn{1}{c|}{rdi/rs2} & +\\multicolumn{1}{c|}{rd/rs2} & \\multicolumn{1}{c|}{rs1} & \\multicolumn{2}{c|}{funct3} & \\multicolumn{5}{c|}{immediate} & I-type \\\\ \\cline{2-12} & \\multicolumn{2}{|c|}{opcode} & -\\multicolumn{1}{c|}{rdi} & +\\multicolumn{1}{c|}{rd} & \\multicolumn{1}{c|}{rs1} & \\multicolumn{5}{c|}{funct9} & \\multicolumn{2}{c|}{shamt} & ISH-type \\\\ @@ -401,7 +403,7 @@ def print_header(): \\multicolumn{1}{c|}{rs2} & \\multicolumn{1}{c|}{rs1} & \\multicolumn{6}{c|}{funct10} & -\\multicolumn{1}{c|}{rdr} & R-type \\\\ +\\multicolumn{1}{c|}{rd} & R-type \\\\ \\cline{2-12} & \\multicolumn{2}{|c|}{opcode} & @@ -409,7 +411,7 @@ def print_header(): \\multicolumn{1}{c|}{rs1} & \\multicolumn{4}{c|}{funct5} & \\multicolumn{2}{c|}{rs3} & -\\multicolumn{1}{c|}{rdr} & R4-type \\\\ +\\multicolumn{1}{c|}{rd} & R4-type \\\\ \\cline{2-12} """ @@ -616,7 +618,7 @@ def print_verilog_lui_type(name,match,arguments): ( \ name.replace('.','_').upper(), \ binary(yank(match,25,7),7), \ - str_verilog_arg('rdi','',match,arguments), \ + str_verilog_arg('rd','',match,arguments), \ str_verilog_arg('imm20','',match,arguments) \ ) @@ -625,7 +627,7 @@ def print_verilog_i_type(name,match,arguments): ( \ name.replace('.','_').upper(), \ binary(yank(match,25,7),7), \ - str_verilog_arg('rdi','rs2',match,arguments), \ + str_verilog_arg('rd','rs2',match,arguments), \ str_verilog_arg('rs1','',match,arguments), \ binary(yank(match,12,3),3), \ str_verilog_arg('imm12','',match,arguments) \ @@ -636,7 +638,7 @@ def print_verilog_ish_type(name,match,arguments): ( \ name.replace('.','_').upper(), \ binary(yank(match,25,7),7), \ - str_verilog_arg('rdi','',match,arguments), \ + str_verilog_arg('rd','',match,arguments), \ str_verilog_arg('rs1','',match,arguments), \ binary(yank(match,6,9),9), \ str_verilog_arg('shamt','',match,arguments) \ @@ -647,7 +649,7 @@ def print_verilog_ishw_type(name,match,arguments): ( \ name.replace('.','_').upper(), \ binary(yank(match,25,7),7), \ - str_verilog_arg('rdi','',match,arguments), \ + str_verilog_arg('rd','',match,arguments), \ str_verilog_arg('rs1','',match,arguments), \ binary(yank(match,6,9),9), \ str_verilog_arg('shamtw','',match,arguments) \ @@ -662,7 +664,7 @@ def print_verilog_r4_type(name,match,arguments): str_verilog_arg('rs1','',match,arguments), \ binary(yank(match,10,5),5), \ str_verilog_arg('rs3','',match,arguments), \ - str_verilog_arg('rdr','',match,arguments) \ + str_verilog_arg('rd','',match,arguments) \ ) def print_verilog_r4_rm_type(name,match,arguments): @@ -676,7 +678,7 @@ def print_verilog_r4_rm_type(name,match,arguments): str_verilog_arg('rm','',match,arguments), \ binary(yank(match,10,1),1), \ str_verilog_arg('rs3','',match,arguments), \ - str_verilog_arg('rdr','',match,arguments) \ + str_verilog_arg('rd','',match,arguments) \ ) def print_verilog_r_rm_type(name,match,arguments): @@ -689,7 +691,7 @@ def print_verilog_r_rm_type(name,match,arguments): binary(yank(match,13,2),2), \ str_verilog_arg('rm','',match,arguments), \ binary(yank(match,5,6),6), \ - str_verilog_arg('rdr','',match,arguments) \ + str_verilog_arg('rd','',match,arguments) \ ) def print_verilog_r_type(name,match,arguments): @@ -700,7 +702,7 @@ def print_verilog_r_type(name,match,arguments): str_verilog_arg('rs2','',match,arguments), \ str_verilog_arg('rs1','',match,arguments), \ binary(yank(match,5,10),10), \ - str_verilog_arg('rdr','',match,arguments) \ + str_verilog_arg('rd','',match,arguments) \ ) def make_verilog(): |