Instruction encoding of RISC-V
I note Opcode, Funct 3, Funct 6/7 of each instruction type of RISC - V.
Format |
Instruction |
Opcode |
Funct3 |
Funct6/7 |
R-type
|
add |
0110011 |
000 |
0000000 |
sub |
0110011 |
000 |
0100000 |
sll |
0110011 |
001 |
0000000 |
xor |
0110011 |
100 |
0000000 |
sri |
0110011 |
101 |
0000000 |
sra |
0110011 |
101 |
0000000 |
or |
0110011 |
110 |
0000000 |
and |
0110011 |
111 |
0000000 |
lr.d |
0110011 |
011 |
0001000 |
sc.d |
0110011 |
011 |
0001100 |
I-type
|
lb |
0000011 |
000 |
N/A |
lh |
0000011 |
001 |
N/A |
lw |
0000011 |
010 |
N/A |
ld |
0000011 |
011 |
N/A |
lbu |
0000011 |
100 |
N/A |
lhu |
0000011 |
101 |
N/A |
lwu |
0000011 |
110 |
N/A |
addi |
0010011 |
000 |
N/A |
slli |
0010011 |
001 |
000000 |
xori |
0010011 |
100 |
N/A |
srli |
0010011 |
101 |
000000 |
srai |
0010011 |
101 |
010000 |
ori |
0010011 |
110 |
N/A |
andi |
0010011 |
111 |
N/A |
jalr |
1100111 |
000 |
N/A |
S-type
|
sb |
0100011 |
000 |
N/A |
sh |
0100011 |
001 |
N/A |
sw |
0100011 |
010 |
N/A |
sd |
0100011 |
111 |
N/A |
SB-type
|
beq |
1100111 |
000 |
N/A |
bne |
1100111 |
001 |
N/A |
blt |
1100111 |
100 |
N/A |
bqe |
1100111 |
101 |
N/A |
bltu |
1100111 |
110 |
N/A |
bqeu |
1100111 |
111 |
N/A |
U-type |
lui |
0110111 |
N/A |
N/A |
UJ-type |
jalr |
1101111 |
N/A |
N/A |