상위 문서:
RISC-V 1.3.4. 압축된 명령어 형식 ("C" 확장)
2.1.1. ALU 레지스터-상수 연산 명령어
2.1.2. Shift immediate 명령어
2.2.2.3. 32-bit shift immediate 명령어
2.7.1. RV32F Load/Store 명령어
2.8.1. RV32D Load/Store 명령어
2.9.1. RV32Q Load/Store 명령어
2.10.1. RV32Zfh Load/Store 명령어
2.11. RISC-V Privileged ISA
2.11.5. 하이퍼바이저 가상머신 Load/Store 명령어
2.12.1. 스택 포인터 기반 Load/Store 명령어
2.12.2. 레지스터 기반 Load/Store 명령어
2.16. "Zfinx" / "Zdinx" / "Zhinx " / "Zhinxmin" 확장
2.20.1.4. Unit-Stride Segment Load/Store 명령어
2.20.1.5. Strided Segment Load/Store 명령어
2.20.1.6. Vector Indexed Segment Load/Store 명령어
RISC-V 아키텍처의 명령어 목록.
- rd : destination register. 값을 기록할 레지스터
- rs : source register. 값을 읽고자 하는 레지스터
- imm : 상수
명령어 길이 | base | base+2 | base+4 |
16-bit[1] | xxxxxxxxxxxxxxaa | | |
32-bit[2] | xxxxxxxxxxxbbb11 | xxxxxxxxxxxxxxxx | |
48-bit | xxxxxxxxxx011111 | xxxxxxxxxxxxxxxx | ... |
64-bit | xxxxxxxxx0111111 | xxxxxxxxxxxxxxxx | ... |
(80+16*nnn)-bit[3] | xnnnxxxxx1111111 | xxxxxxxxxxxxxxxx | ... |
192-bit 이상 | x111xxxxx1111111 | xxxxxxxxxxxxxxxx | ... |
종류 | 31 | 30:25 | 24:21 | 20 | 19:15 | 14:12 | 11:8 | 7 | 6:0 |
R-type | funct7 | rs2 | rs1 | funct3 | rd | opcode |
I-type | imm[11:0] | rs1 | funct3 | rd | opcode |
S-type | imm[11:5] | rs2 | rs1 | funct3 | imm[4:0] | opcode |
B-type | imm[12] | imm[10:5] | rs2 | rs1 | funct3 | imm[4:1] | imm[11] | opcode |
U-type | imm[31:12] | rd | opcode |
J-type | imm[20] | imm[10:1] | imm[11] | imm[19:12] | rd | opcode |
[각주]
000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | [4:2] / [6:5] |
LOAD | (LOAD-FP) | custom-1 | MISC-MEM | OP-IMM | AUIPC | OP-IMM-32 | 48b | 00 |
STORE | (STORE-FP) | custom-2 | AMO | OP | LUI | OP-32 | 64b | 01 |
(MADD) | (MSUB) | (NMSUB) | (NMADD) | (OP-FP) | (OP-V) | custom-2/rv128 | 48b | 10 |
BRANCH | JALR | reserved | JAL | SYSTEM | reserved | custom-3/rv128 | =80b | 11 |
[각주]
종류 | 31:27 | 26 | 25 | 24:20 | 19:15 | 14:12 | 11:7 | 6:0 |
R-type | funct5 | aq | rl | rs2 | rs1 | rm | rd | opcode |
[각주]
1.3.4. 압축된 명령어 형식 ("C" 확장)[편집]
종류 | 의미 | 15:13 | 12 | 11:10 | 9:7 | 6:5 | 4:2 | 1:0 |
CR | Register | funct4 | rd/rs1 | rs2 | op |
CI | Immediate | funct3 | imm | rd/rs1 | imm | op |
CSS | Stack-relative Store | funct3 | imm | rs2 | op |
CIW | Wide Immediate | funct3 | imm | rd' | op |
CL | Load | funct3 | imm | rs1' | imm | rd' | op |
CS | Store | funct3 | imm | rs1' | imm | rs2' | op |
CA | Arithmetic | funct6 | rd'/rs1' | funct2 | rs2' | op |
CB | Branch | funct3 | offset | rs1' | offset | op |
CJ | Jump | funct3 | jump target | op |
[각주]
RV32C opcode map은 다음과 같다:
000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | RV32 [15:13] / [1:0] |
ADDI4SPN | FLD | LW | FLW | Reserved | FSD | SW | FSW | 00 |
ADDI | JAL | LI | LUI ADDI16SP | MISC-ALU | J | BEQZ | BNEZ | 01 |
SLLI | FLDSP | LWSP | FLWSP | JALR/JR ADD/MV EBREAK | FSDSP | SWSP | FSWSP | 10 |
16b | 11 |
RV64C opcode map은 다음과 같다:
000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | RV64 [15:13] / [1:0] |
ADDI4SPN | FLD | LW | LD | Reserved | FSD | SW | SD | 00 |
ADDI | ADDIW | LI | LUI ADDI16SP | MISC-ALU | J | BEQZ | BNEZ | 01 |
SLLI | FLDSP | LWSP | LDSP | JALR/JR ADD/MV EBREAK | FSDSP | SWSP | SDSP | 10 |
16b | 11 |
[각주]
CIW, CL, CS, CA, CB 형식의 경우 3-bit 필드를 사용해 아래와 같이 레지스터를 명시한다:
RVC 레지스터 번호 | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
정수 레지스터 | x8 | x9 | x10 | x11 | x12 | x13 | x14 | x15 |
ABI 이름 | s0 | s1 | a0 | a1 | a2 | a3 | a4 | a5 |
부동소수점 레지스터 | f8 | x9 | f10 | f11 | f12 | f13 | f14 | f15 |
ABI 이름 | fs0 | fs1 | fa0 | fa1 | fa2 | fa3 | fa4 | fa5 |
[각주]
종류 | 31:27 | 26:25 | 24:20 | 19:15 | 14:12 | 11:7 | 6:0 |
I-type | imm[11:0] | rs1 | width | rd | opcode |
S-type | imm[11:5] | rs2 | rs1 | width | imm[4:0] | opcode |
R-type | funct5 | fmt | rs2 | rs1 | rm | rd | opcode |
R4-type | rs3 | fmt | rs2 | rs1 | rm | rd | opcode |
[각주]
종류 | 31 | 30 | 29 | 28 | 27:26 | 25 | 24:20 | 19:15 | 14:12 | 11:7 | 6:0 |
VL* | nf | mew | mop | vm | lumop | rs1 | width | vd | 0000111 |
VLS* | nf | mew | mop | vm | rs2 | rs1 | width | vd | 0000111 |
VLX* | nf | mew | mop | vm | vs2 | rs1 | width | vd | 0000111 |
VS* | nf | mew | mop | vm | sumop | rs1 | width | vs3 | 0100111 |
VSS* | nf | mew | mop | vm | rs2 | rs1 | width | vs3 | 0100111 |
VSX* | nf | mew | mop | vm | vs2 | rs1 | width | vs3 | 0100111 |
OPIVV | funct6 | vm | vs2 | rs1 | | vd | 1010111 |
OPFVV | funct6 | vm | vs2 | rs1 | 001 | vd/rd | 1010111 |
OPMVV | funct6 | vm | vs2 | rs1 | 010 | vd/rd | 1010111 |
OPIVI | funct6 | vm | vs2 | imm[4:0] | 011 | vd | 1010111 |
OPIVX | funct6 | vm | vs2 | rs1 | 100 | vd | 1010111 |
OPFVF | funct6 | vm | vs2 | rs1 | 101 | vd | 1010111 |
OPMVX | funct6 | vm | vs2 | rs1 | 110 | vd/rd | 1010111 |
vsetvli | 0 | zimm[10:0] | rs1 | 111 | rd | 1010111 |
vsetivli | 1 | 1 | zimm[9:0] | uimm[4:0] | 111 | rd | 1010111 |
vsetvl | 1 | 0 | 0 | 0 | 00 | 0 | rs2 | rs1 | 111 | rd | 1010111 |
벡터 Load/Store 명령어는 각각 (LOAD-FP), (STORE-FP) opcode를 사용하며 width로 구분한다. 나머지 명령어는 OP-V opcode를 사용한다.
[각주]
RISC-V 기본 ISA에서는 XLEN 비트 레지스터 32개 및 pc(program counter)를 정의한다. (RV32의 경우 XLEN=32, RV64의 경우 XLEN=64)
레지스터 | x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 |
ABI 이름 | zero | ra | sp | gp | tp | t0 | t1 | t2 |
레지스터 | x8 | x9 | x10 | x11 | x12 | x13 | x14 | x15 |
ABI 이름 | s0/fp | s1 | a0 | a1 | a2 | a3 | a4 | a5 |
레지스터 | x16 | x17 | x18 | x19 | x20 | x21 | x22 | x23 |
ABI 이름 | a6 | a7 | s2 | s3 | s4 | s5 | s6 | s7 |
레지스터 | x24 | x25 | x26 | x27 | x28 | x29 | x30 | x31 |
ABI 이름 | s8 | s9 | s10 | s11 | t3 | t4 | t5 | t6 |
- zero 레지스터는 hard-wired zero 레지스터로 이 레지스터에 대한 쓰기는 무시한다.
- pc: program counter. 현재 instruction의 주소를 저장한다.
- 호출 규약:
- ra, t0-6, a0-7 레지스터는 caller-saved 레지스터이다.
- sp, s0-s11 레지스터는 callee-saved 레지스터이다.
[각주]
RISC-V 부동소수점 확장("F", "D", "Q" 등)에서는 FLEN 비트 레지스터 32개를 정의한다. (f0-f31)
레지스터 | f0 | f1 | f2 | f3 | f4 | f5 | f6 | f7 |
ABI 이름 | ft0 | ft1 | ft2 | ft3 | ft4 | ft5 | ft6 | ft7 |
레지스터 | f8 | f9 | f10 | f11 | f12 | f13 | f14 | f15 |
ABI 이름 | fs0 | fs1 | fa0 | fa1 | fa2 | fa3 | fa4 | fa5 |
레지스터 | f16 | f17 | f18 | f19 | f20 | f21 | f22 | f23 |
ABI 이름 | fa6 | fa7 | fs2 | fs3 | fs4 | fs5 | fs6 | fs7 |
레지스터 | f24 | f25 | f26 | f27 | f28 | f29 | f30 | f31 |
ABI 이름 | fs8 | fs9 | fs10 | fs11 | ft8 | ft9 | ft10 | ft11 |
- "F" 확장: FLEN=32
- "D" 확장: FLEN=64
[각주]
RISC-V 벡터 확장("V")에서는 VLEN 비트 레지스터 32개를 정의한다. (v0-v31)
[각주]
- CSR 주소 할당 표 [ 펼치기 · 접기 ]
CSR Address | Hex | Use And Accessibility |
[11:10] | [9:8] | [7:4] |
Unprevileged and User-Level CSRs |
00 | 00 | XXXX | 0x000-0x0FF | Standard read/write |
01 | 00 | XXXX | 0x400-0x4FF | Standard read/write |
10 | 00 | XXXX | 0x800-0x8FF | Custom read/write |
11 | 00 | 0XXX | 0xC00-0xC7F | Standard read-only |
11 | 00 | 10XX | 0xC80-0xCBF | Standard read-only |
11 | 00 | 11XX | 0xCC0-0xCFF | Custom read-only |
Supervisor-Level CSRs |
00 | 01 | XXXX | 0x100-0x1FF | Standard read/write |
01 | 01 | 0XXX | 0x500-0x57F | Standard read/write |
01 | 01 | 10XX | 0x580-0x5BF | Standard read/write |
01 | 01 | 11XX | 0x5C0-0x5FF | Custom read/write |
10 | 01 | 0XXX | 0x900-0x97F | Standard read/write |
10 | 01 | 10XX | 0x980-0x9BF | Standard read/write |
10 | 01 | 11XX | 0x9C0-0x9FF | Custom read/write |
11 | 01 | 0XXX | 0xD00-0xD7F | Standard read-only |
11 | 01 | 10XX | 0xD80-0xDBF | Standard read-only |
11 | 01 | 11XX | 0xDC0-0xDFF | Custom read-only |
Hypervisor and VS CSRs |
00 | 10 | XXXX | 0x200-0x2FF | Standard read/write |
01 | 10 | 0XXX | 0x600-0x67F | Standard read/write |
01 | 10 | 10XX | 0x680-0x6BF | Standard read/write |
01 | 10 | 11XX | 0x6C0-0x6FF | Custom read/write |
10 | 10 | 0XXX | 0xA00-0xA7F | Standard read/write |
10 | 10 | 10XX | 0xA80-0xABF | Standard read/write |
10 | 10 | 11XX | 0xAC0-0xAFF | Custom read/write |
11 | 10 | 0XXX | 0xE00-0xE7F | Standard read-only |
11 | 10 | 10XX | 0xE80-0xEBF | Standard read-only |
11 | 10 | 11XX | 0xEC0-0xEFF | Custom read-only |
Machine-Level CSRs |
00 | 11 | XXXX | 0x300-0x3FF | Standard read/write |
01 | 11 | 0XXX | 0x700-0x77F | Standard read/write |
01 | 11 | 100X | 0x780-0x79F | Standard read/write |
01 | 11 | 1010 | 0x7A0-0x7AF | Standard read/write debug CSRs |
01 | 11 | 1011 | 0x7B0-0x7BF | Debug-mode-only CSRs |
01 | 11 | 11XX | 0x7C0-0x7FF | Custom read/write |
10 | 11 | 0XXX | 0xB00-0xB7F | Standard read/write |
10 | 11 | 10XX | 0xB80-0xBBF | Standard read/write |
10 | 11 | 11XX | 0xBC0-0xBFF | Custom read/write |
11 | 11 | 0XXX | 0xF00-0xF7F | Standard read-only |
11 | 11 | 10XX | 0xF80-0xFBF | Standard read-only |
11 | 11 | 11XX | 0xFC0-0xFFF | Custom read-only |
- 현재 할당된 RISC-V unprevileged CSR 주소
-
0x001
(URW): fflags
— Floating-Point Accured Exceptions. -
0x002
(URW): frm
— Floating-Point Dynamic Rounding Mode. -
0x003
(URW): fcsr
— Floating-Point Control and Status Register (frm
+ fflags
). -
0xC00
(URO): cycle
— Cycle counter for RDCYCLE instruction. -
0xC01
(URO): time
— Timer for RDTIME instruction. -
0xC02
(URO): instret
— Instructions-retired counter for RDINSTRET instruction. -
0xC03-0xC1F
(URO): hpmcounter3
... hpmcounter31
— Performance-monitoring counter. -
0xC80
(URO): cycleh
— Upper 32 bits of cycle
, RV32 only. -
0xC81
(URO): timeh
— Upper 32 bits of time
, RV32 only. -
0xC82
(URO): instreth
— Upper 32 bits of instret
, RV32 only. -
0xC83-0xC9F
(URO): hpmcounter3h
... hpmcounter31h
— Upper 32 bits of hpmcounter, RV32 only.
- 현재 할당된 RISC-V supervisor-level CSR 주소
- 현재 할당된 RISC-V hypervisor 및 VS CSR 주소
- 현재 할당된 RISC-V machine-level CSR 주소
- 0xF11
(MRO): mvendorid
— Vendor ID.
- 0xF12
(MRO): marchid
— Architecture ID.
- 0xF13
(MRO): mimpid
— Implementation ID.
- 0xF14
(MRO): mhartid
— Hardware thread ID.
- 0xF15
(MRO): mconfigptr
— Pointer to configuration data structure.
- Machine Trap Setup
- Machine Trap Handling
- Machine Configuration
- Machine Memory Protection
- Machine Counter/Timers
- Machine Counter Setup
- Debug/Trace Registers (shared with Debug Mode)
- Debug Mode Registers
[각주]
총 40개의 명령어로 구성되어 있다.
2.1.1. ALU 레지스터-상수 연산 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
ADDI | addi rd, rs1, imm | I-type | 000 | 00 | 100 |
SLTI | slti rd, rs1, imm | I-type | 010 | 00 | 100 |
SLTIU | sltiu rd, rs1, imm | I-type | 011 | 00 | 100 |
XORI | xori rd, rs1, imm | I-type | 100 | 00 | 100 |
ORI | ori rd, rs1, imm | I-type | 110 | 00 | 100 |
ANDI | andi rd, rs1, imm | I-type | 111 | 00 | 100 |
LUI | lui rd, imm20 | U-type | - | 01 | 101 |
AUIPC | auipc rd, imm20 | U-type | - | 00 | 101 |
NOP 연산은
ADDI x0, x0, 0
으로 인코딩된다.
[각주]
2.1.2. Shift immediate 명령어[편집]
명령어 | mnemonic | 인코딩 | imm[11:5] | funct3 | inst[6:5] | inst[4:2] |
SLLI | slli rd, rs1, shamt | I-type | 0000000 | 001 | 00 | 100 |
SRLI | srli rd, rs1, shamt | I-type | 0000000 | 101 | 00 | 100 |
SRAI | srai rd, rs1, shamt | I-type | 0100000 | 101 | 00 | 100 |
32-bit shift immediate 명령어는 immediate의 하위 5비트인 imm[4:0]을 shamt로 사용한다.
[각주]
명령어 | mnemonic | 인코딩 | funct7 | funct3 | inst[6:5] | inst[4:2] |
ADD | add rd, rs1, rs2 | R-type | 0000000 | 000 | 01 | 100 |
SUB | sub rd, rs1, rs2 | R-type | 0100000 | 000 | 01 | 100 |
SLT | slt rd, rs1, rs2 | R-type | 0000000 | 010 | 01 | 100 |
SLTU | sltu rd, rs1, rs2 | R-type | 0000000 | 011 | 01 | 100 |
XOR | xor rd, rs1, rs2 | R-type | 0000000 | 100 | 01 | 100 |
OR | or rd, rs1, rs2 | R-type | 0000000 | 110 | 01 | 100 |
AND | and rd, rs1, rs2 | R-type | 0000000 | 111 | 01 | 100 |
SLL | sll rd, rs1, rs2 | R-type | 0000000 | 001 | 01 | 100 |
SRL | srl rd, rs1, rs2 | R-type | 0000000 | 101 | 01 | 100 |
SRA | sra rd, rs1, rs2 | R-type | 0100000 | 101 | 01 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
JAL | jal rd, offset | J-type | - | 11 | 011 |
JALR | jalr rd, offset(rs1) | I-type | 000 | 11 | 001 |
BEQ | beq rs1, rs2, offset | B-type | 000 | 11 | 000 |
BNE | bne rs1, rs2, offset | B-type | 001 | 11 | 000 |
BLT | blt rs1, rs2, offset | B-type | 100 | 11 | 000 |
BGE | bge rs1, rs2, offset | B-type | 101 | 11 | 000 |
BLTU | bltu rs1, rs2, offset | B-type | 110 | 11 | 000 |
BGEU | bgeu rs1, rs2, offset | B-type | 111 | 11 | 000 |
[각주]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
LB | lb rd, offset(rs1) | I-type | 000 | 00 | 000 |
LH | lh rd, offset(rs1) | I-type | 001 | 00 | 000 |
LW | lw rd, offset(rs1) | I-type | 010 | 00 | 000 |
LBU | lbu rd, offset(rs1) | I-type | 100 | 00 | 000 |
LHU | lhu rd, offset(rs1) | I-type | 101 | 00 | 000 |
SB | sb rs2, offset(rs1) | S-type | 000 | 01 | 000 |
SH | sh rs2, offset(rs1) | S-type | 001 | 01 | 000 |
SW | sw rs2, offset(rs1) | S-type | 010 | 01 | 000 |
[각주]
명령어 | mnemonic | 인코딩 | imm | rs1 | rd | funct3 | inst[6:5] | inst[4:2] |
FENCE | fence | I-type | fm|pred|succ | 0 | 0 | 000 | 00 | 011 |
ECALL | ecall | I-type | 000000000000 | 0 | 0 | 000 | 11 | 100 |
EBREAK | ebreak | I-type | 000000000001 | 0 | 0 | 000 | 11 | 100 |
[각주]
[각주]
RV64I에서는 RV32I를 바탕으로 레지스터를 64-bit로 확장하였다. 이에 따라 기존 연산은 64-bit로 확장되어 동작한다.
명령어 | mnemonic | 인코딩 | imm[11:6] | funct3 | inst[6:5] | inst[4:2] |
SLLI | slli rd, rs1, shamt | I-type | 000000 | 001 | 00 | 100 |
SRLI | srli rd, rs1, shamt | I-type | 000000 | 101 | 00 | 100 |
SRAI | srai rd, rs1, shamt | I-type | 010000 | 101 | 00 | 100 |
64-bit shift immediate 명령어는 immediate의 하위 6비트인 imm[5:0]을 shamt로 사용한다.
[각주]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
LD | ld rd, offset(rs1) | I-type | 011 | 00 | 000 |
LWU | lwu rd, offset(rs1) | I-type | 110 | 00 | 000 |
SD | sd rs2, offset(rs1) | S-type | 011 | 01 | 000 |
[각주]
2.2.2.2. 32-bit ALU 레지스터-상수 연산 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
ADDIW | addiw rd, rs1, imm | I-type | 000 | 00 | 110 |
[각주]
2.2.2.3. 32-bit shift immediate 명령어[편집]
명령어 | mnemonic | 인코딩 | imm[11:5] | funct3 | inst[6:5] | inst[4:2] |
SLLIW | slliw rd, rs1, shamt | I-type | 0000000 | 001 | 00 | 110 |
SRLIW | srliw rd, rs1, shamt | I-type | 0000000 | 101 | 00 | 110 |
SRAIW | sraiw rd, rs1, shamt | I-type | 0100000 | 101 | 00 | 110 |
32-bit shift immediate 명령어는 immediate의 하위 5비트인 imm[4:0]을 shamt로 사용한다.
[각주]
2.2.2.4. 32-bit 레지스터-레지스터 연산 명령어[편집]
명령어 | mnemonic | 인코딩 | funct7 | funct3 | inst[6:5] | inst[4:2] |
ADDW | addw rd, rs1, rs2 | R-type | 0000000 | 000 | 01 | 110 |
SUBW | subw rd, rs1, rs2 | R-type | 0100000 | 000 | 01 | 110 |
SLLW | sllw rd, rs1, rs2 | R-type | 0000000 | 001 | 01 | 110 |
SRLW | srlw rd, rs1, rs2 | R-type | 0000000 | 101 | 01 | 110 |
SRAW | sraw rd, rs1, rs2 | R-type | 0100000 | 101 | 01 | 110 |
[각주]
2.3. "Zifencei" 확장[편집]
명령어 | mnemonic | 인코딩 | imm | rs1 | rd | funct3 | inst[6:5] | inst[4:2] |
FENCE.I | fence.i | I-type | 0 | 0 | 0 | 001 | 00 | 011 |
[각주]
명령어 | mnemonic | 인코딩 | imm | rs1 | funct3 | inst[6:5] | inst[4:2] |
CSRRW | csrrw rd, csr, rs1 | I-type | csr | source | 001 | 11 | 100 |
CSRRS | csrrs rd, csr, rs1 | I-type | csr | source | 010 | 11 | 100 |
CSRRC | csrrc rd, csr, rs1 | I-type | csr | source | 011 | 11 | 100 |
CSRRWI | csrrwi rd, csr, uimm | I-type | csr | uimm[4:0] | 101 | 11 | 100 |
CSRRSI | csrrsi rd, csr, uimm | I-type | csr | uimm[4:0] | 110 | 11 | 100 |
CSRRCI | csrrci rd, csr, uimm | I-type | csr | uimm[4:0] | 111 | 11 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | funct7 | funct3 | inst[6:5] | inst[4:2] |
MUL | mul rd, rs1, rs2 | R-type | 0000001 | 000 | 01 | 100 |
MULH | mulh rd, rs1, rs2 | R-type | 0000001 | 001 | 01 | 100 |
MULHSU | mulhsu rd, rs1, rs2 | R-type | 0000001 | 010 | 01 | 100 |
MULHU | mulhu rd, rs1, rs2 | R-type | 0000001 | 011 | 01 | 100 |
DIV | div rd, rs1, rs2 | R-type | 0000001 | 100 | 01 | 100 |
DIVU | divu rd, rs1, rs2 | R-type | 0000001 | 101 | 01 | 100 |
REM | rem rd, rs1, rs2 | R-type | 0000001 | 110 | 01 | 100 |
REMU | remu rd, rs1, rs2 | R-type | 0000001 | 111 | 01 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | funct7 | funct3 | inst[6:5] | inst[4:2] |
MULW | mulw rd, rs1, rs2 | R-type | 0000001 | 000 | 01 | 110 |
DIVW | divw rd, rs1, rs2 | R-type | 0000001 | 100 | 01 | 110 |
DIVUW | divuw rd, rs1, rs2 | R-type | 0000001 | 101 | 01 | 110 |
REMW | remw rd, rs1, rs2 | R-type | 0000001 | 110 | 01 | 110 |
REMUW | remuw rd, rs1, rs2 | R-type | 0000001 | 111 | 01 | 110 |
[각주]
Zmmul 확장은 "M" 확장의 곱셈 명령어만 구현한 부분집합이다. (MUL, MULH, MULHU, MULHSU, [RV64 한정] MULW)
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | funct3 | inst[6:5] | inst[4:2] |
LR.W | lr.w rd, (rs1) | R-type | 0 | 00010 | 010 | 01 | 011 |
SC.W | sc.w rd, rs2, (rs1) | R-type | src | 00011 | 010 | 01 | 011 |
AMOADD.W | amoadd.w rd, rs2, (rs1) | R-type | src | 00000 | 010 | 01 | 011 |
AMOSWAP.W | amoswap.w rd, rs2, (rs1) | R-type | src | 00001 | 010 | 01 | 011 |
AMOXOR.W | amoxor.w rd, rs2, (rs1) | R-type | src | 00100 | 010 | 01 | 011 |
AMOOR.W | amoor.w rd, rs2, (rs1) | R-type | src | 01000 | 010 | 01 | 011 |
AMOAND.W | amoand.w rd, rs2, (rs1) | R-type | src | 01100 | 010 | 01 | 011 |
AMOMIN.W | amomin.w rd, rs2, (rs1) | R-type | src | 10000 | 010 | 01 | 011 |
AMOMAX.W | amomax.w rd, rs2, (rs1) | R-type | src | 10100 | 010 | 01 | 011 |
AMOMINU.W | amominu.w rd, rs2, (rs1) | R-type | src | 11000 | 010 | 01 | 011 |
AMOMAXU.W | amomaxu.w rd, rs2, (rs1) | R-type | src | 11100 | 010 | 01 | 011 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | funct3 | inst[6:5] | inst[4:2] |
LR.D | lr.d rd, (rs1) | R-type | 0 | 00010 | 011 | 01 | 011 |
SC.D | sc.d rd, rs2, (rs1) | R-type | src | 00011 | 011 | 01 | 011 |
AMOADD.D | amoadd.d rd, rs2, (rs1) | R-type | src | 00000 | 011 | 01 | 011 |
AMOSWAP.D | amoswap.d rd, rs2, (rs1) | R-type | src | 00001 | 011 | 01 | 011 |
AMOXOR.D | amoxor.d rd, rs2, (rs1) | R-type | src | 00100 | 011 | 01 | 011 |
AMOOR.D | amoor.d rd, rs2, (rs1) | R-type | src | 01000 | 011 | 01 | 011 |
AMOAND.D | amoand.d rd, rs2, (rs1) | R-type | src | 01100 | 011 | 01 | 011 |
AMOMIN.D | amomin.d rd, rs2, (rs1) | R-type | src | 10000 | 011 | 01 | 011 |
AMOMAX.D | amomax.d rd, rs2, (rs1) | R-type | src | 10100 | 011 | 01 | 011 |
AMOMINU.D | amominu.d rd, rs2, (rs1) | R-type | src | 11000 | 011 | 01 | 011 |
AMOMAXU.D | amomaxu.d rd, rs2, (rs1) | R-type | src | 11100 | 011 | 01 | 011 |
[각주]
2.7.1. RV32F Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
FLW | flw rd, offset(rs1) | I-type | 010 | 00 | 001 |
FSW | fsw rs2, offset(rs1) | S-type | 010 | 01 | 001 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FMADD.S | fmadd.s rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 00 | rm | 10 | 000 |
FMSUB.S | fmsub.s rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 00 | rm | 10 | 001 |
FNMSUB.S | fnmsub.s rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 00 | rm | 10 | 010 |
FNMADD.S | fnmadd.s rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 00 | rm | 10 | 011 |
FADD.S | fadd.s rd, rs1, rs2 | R-type | src2 | 00000 | 00 | rm | 10 | 100 |
FSUB.S | fsub.s rd, rs1, rs2 | R-type | src2 | 00001 | 00 | rm | 10 | 100 |
FMUL.S | fmul.s rd, rs1, rs2 | R-type | src2 | 00010 | 00 | rm | 10 | 100 |
FDIV.S | fdiv.s rd, rs1, rs2 | R-type | src2 | 00011 | 00 | rm | 10 | 100 |
FSQRT.S | fsqrt.s rd, rs1 | R-type | 0 | 01011 | 00 | rm | 10 | 100 |
FMIN.S | fmin.s rd, rs1, rs2 | R-type | src2 | 00101 | 00 | 000 | 10 | 100 |
FMAX.S | fmax.s rd, rs1, rs2 | R-type | src2 | 00101 | 00 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.W.S | fcvt.w.s rd, rs1 | R-type | 00000 | 11000 | 00 | rm | 10 | 100 |
FCVT.WU.S | fcvt.wu.s rd, rs1 | R-type | 00001 | 11000 | 00 | rm | 10 | 100 |
FCVT.S.W | fcvt.s.w rd, rs1 | R-type | 00000 | 11010 | 00 | rm | 10 | 100 |
FCVT.S.WU | fcvt.s.wu rd, rs1 | R-type | 00001 | 11010 | 00 | rm | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FSGNJ.S | fsgnj.s rd, rs1, rs2 | R-type | src2 | 00100 | 00 | 000 | 10 | 100 |
FSGNJN.S | fsgnjn.s rd, rs1, rs2 | R-type | src2 | 00100 | 00 | 001 | 10 | 100 |
FSGNJX.S | fsgnjx.s rd, rs1, rs2 | R-type | src2 | 00100 | 00 | 010 | 10 | 100 |
FMV.X.W | fmv.x.w rd, rs1 | R-type | 0 | 11100 | 00 | 000 | 10 | 100 |
FMV.W.X | fmv.w.x rd, rs1 | R-type | 0 | 11110 | 00 | 000 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FEQ.S | feq.s rd, rs1, rs2 | R-type | src2 | 10100 | 00 | 010 | 10 | 100 |
FLT.S | flt.s rd, rs1, rs2 | R-type | src2 | 10100 | 00 | 001 | 10 | 100 |
FLE.S | fle.s rd, rs1, rs2 | R-type | src2 | 10100 | 00 | 000 | 10 | 100 |
FCLASS.S | fclass.s rd, rs1 | R-type | 0 | 10100 | 00 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.L.S | fcvt.l.s rd, rs1 | R-type | 00010 | 11000 | 00 | rm | 10 | 100 |
FCVT.LU.S | fcvt.lu.s rd, rs1 | R-type | 00011 | 11000 | 00 | rm | 10 | 100 |
FCVT.S.L | fcvt.s.l rd, rs1 | R-type | 00010 | 11010 | 00 | rm | 10 | 100 |
FCVT.S.LU | fcvt.s.lu rd, rs1 | R-type | 00011 | 11010 | 00 | rm | 10 | 100 |
[각주]
2.8.1. RV32D Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
FLD | fld rd, offset(rs1) | I-type | 011 | 00 | 001 |
FSD | fsd rs2, offset(rs1) | S-type | 011 | 01 | 001 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FMADD.D | fmadd.d rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 01 | rm | 10 | 000 |
FMSUB.D | fmsub.d rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 01 | rm | 10 | 001 |
FNMSUB.D | fnmsub.d rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 01 | rm | 10 | 010 |
FNMADD.D | fnmadd.d rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 01 | rm | 10 | 011 |
FADD.D | fadd.d rd, rs1, rs2 | R-type | src2 | 00000 | 01 | rm | 10 | 100 |
FSUB.D | fsub.d rd, rs1, rs2 | R-type | src2 | 00001 | 01 | rm | 10 | 100 |
FMUL.D | fmul.d rd, rs1, rs2 | R-type | src2 | 00010 | 01 | rm | 10 | 100 |
FDIV.D | fdiv.d rd, rs1, rs2 | R-type | src2 | 00011 | 01 | rm | 10 | 100 |
FSQRT.D | fsqrt.d rd, rs1 | R-type | 0 | 01011 | 01 | rm | 10 | 100 |
FMIN.D | fmin.d rd, rs1, rs2 | R-type | src2 | 00101 | 01 | 000 | 10 | 100 |
FMAX.D | fmax.d rd, rs1, rs2 | R-type | src2 | 00101 | 01 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.D.S | fcvt.d.s rd, rs1 | R-type | 00000 | 01000 | 01 | rm | 10 | 100 |
FCVT.S.D | fcvt.s.d rd, rs1 | R-type | 00001 | 01000 | 00 | rm | 10 | 100 |
FCVT.W.D | fcvt.w.d rd, rs1 | R-type | 00000 | 11000 | 01 | rm | 10 | 100 |
FCVT.WU.D | fcvt.wu.d rd, rs1 | R-type | 00001 | 11000 | 01 | rm | 10 | 100 |
FCVT.D.W | fcvt.d.w rd, rs1 | R-type | 00000 | 11010 | 01 | rm | 10 | 100 |
FCVT.D.WU | fcvt.d.wu rd, rs1 | R-type | 00001 | 11010 | 01 | rm | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FSGNJ.D | fsgnj.d rd, rs1, rs2 | R-type | src2 | 00100 | 01 | 000 | 10 | 100 |
FSGNJN.D | fsgnjn.d rd, rs1, rs2 | R-type | src2 | 00100 | 01 | 001 | 10 | 100 |
FSGNJX.D | fsgnjx.d rd, rs1, rs2 | R-type | src2 | 00100 | 01 | 010 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FEQ.D | feq.d rd, rs1, rs2 | R-type | src2 | 10100 | 01 | 010 | 10 | 100 |
FLT.D | flt.d rd, rs1, rs2 | R-type | src2 | 10100 | 01 | 001 | 10 | 100 |
FLE.D | fle.d rd, rs1, rs2 | R-type | src2 | 10100 | 01 | 000 | 10 | 100 |
FCLASS.D | fclass.d rd, rs1 | R-type | 0 | 10100 | 01 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.L.D | fcvt.l.d rd, rs1 | R-type | 00010 | 11000 | 01 | rm | 10 | 100 |
FCVT.LU.D | fcvt.lu.d rd, rs1 | R-type | 00011 | 11000 | 01 | rm | 10 | 100 |
FCVT.D.L | fcvt.d.l rd, rs1 | R-type | 00010 | 11010 | 01 | rm | 10 | 100 |
FCVT.D.LU | fcvt.d.lu rd, rs1 | R-type | 00011 | 11010 | 01 | rm | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FMV.X.D | fmv.x.d rd, rs1 | R-type | 0 | 11100 | 01 | 000 | 10 | 100 |
FMV.D.X | fmv.d.x rd, rs1 | R-type | 0 | 11110 | 01 | 000 | 10 | 100 |
[각주]
2.9.1. RV32Q Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
FLQ | flq rd, offset(rs1) | I-type | 100 | 00 | 001 |
FSQ | fsq rs2, offset(rs1) | S-type | 100 | 01 | 001 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FMADD.Q | fmadd.q rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 11 | rm | 10 | 000 |
FMSUB.Q | fmsub.q rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 11 | rm | 10 | 001 |
FNMSUB.Q | fnmsub.q rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 11 | rm | 10 | 010 |
FNMADD.Q | fnmadd.q rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 11 | rm | 10 | 011 |
FADD.Q | fadd.q rd, rs1, rs2 | R-type | src2 | 00000 | 11 | rm | 10 | 100 |
FSUB.Q | fsub.q rd, rs1, rs2 | R-type | src2 | 00001 | 11 | rm | 10 | 100 |
FMUL.Q | fmul.q rd, rs1, rs2 | R-type | src2 | 00010 | 11 | rm | 10 | 100 |
FDIV.Q | fdiv.q rd, rs1, rs2 | R-type | src2 | 00011 | 11 | rm | 10 | 100 |
FSQRT.Q | fsqrt.q rd, rs1 | R-type | 0 | 01011 | 11 | rm | 10 | 100 |
FMIN.Q | fmin.q rd, rs1, rs2 | R-type | src2 | 00101 | 11 | 000 | 10 | 100 |
FMAX.Q | fmax.q rd, rs1, rs2 | R-type | src2 | 00101 | 11 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.Q.S | fcvt.q.s rd, rs1 | R-type | 00000 | 01000 | 11 | rm | 10 | 100 |
FCVT.Q.D | fcvt.q.d rd, rs1 | R-type | 00001 | 01000 | 11 | rm | 10 | 100 |
FCVT.S.Q | fcvt.s.q rd, rs1 | R-type | 00011 | 01000 | 00 | rm | 10 | 100 |
FCVT.D.Q | fcvt.d.q rd, rs1 | R-type | 00011 | 01000 | 01 | rm | 10 | 100 |
FCVT.W.Q | fcvt.w.q rd, rs1 | R-type | 00000 | 11000 | 11 | rm | 10 | 100 |
FCVT.WU.Q | fcvt.wu.q rd, rs1 | R-type | 00001 | 11000 | 11 | rm | 10 | 100 |
FCVT.Q.W | fcvt.q.w rd, rs1 | R-type | 00000 | 11010 | 11 | rm | 10 | 100 |
FCVT.Q.WU | fcvt.q.wu rd, rs1 | R-type | 00001 | 11010 | 11 | rm | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FSGNJ.Q | fsgnj.q rd, rs1, rs2 | R-type | src2 | 00100 | 11 | 000 | 10 | 100 |
FSGNJN.Q | fsgnjn.q rd, rs1, rs2 | R-type | src2 | 00100 | 11 | 001 | 10 | 100 |
FSGNJX.Q | fsgnjx.q rd, rs1, rs2 | R-type | src2 | 00100 | 11 | 010 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FEQ.Q | feq.q rd, rs1, rs2 | R-type | src2 | 10100 | 11 | 010 | 10 | 100 |
FLT.Q | flt.q rd, rs1, rs2 | R-type | src2 | 10100 | 11 | 001 | 10 | 100 |
FLE.Q | fle.q rd, rs1, rs2 | R-type | src2 | 10100 | 11 | 000 | 10 | 100 |
FCLASS.Q | fclass.q rd, rs1 | R-type | 0 | 10100 | 11 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.Q.L | fcvt.q.l rd, rs1 | R-type | 00010 | 11000 | 11 | rm | 10 | 100 |
FCVT.Q.LU | fcvt.q.lu rd, rs1 | R-type | 00011 | 11000 | 11 | rm | 10 | 100 |
FCVT.L.Q | fcvt.l.q rd, rs1 | R-type | 00010 | 11010 | 11 | rm | 10 | 100 |
FCVT.LU.Q | fcvt.lu.q rd, rs1 | R-type | 00011 | 11010 | 11 | rm | 10 | 100 |
[각주]
2.10. "Zfh", "Zfhmin" 확장[편집]
"Zfhmin" 확장은 Load/Store 명령어 및 변환 명령어만을 포함한다.
2.10.1. RV32Zfh Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[6:5] | inst[4:2] |
FLH | flh rd, offset(rs1) | I-type | 001 | 00 | 001 |
FSH | fsh rs2, offset(rs1) | S-type | 001 | 01 | 001 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FMADD.H | fmadd.h rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 10 | rm | 10 | 000 |
FMSUB.H | fmsub.h rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 10 | rm | 10 | 001 |
FNMSUB.H | fnmsub.h rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 10 | rm | 10 | 010 |
FNMADD.H | fnmadd.h rd, rs1, rs2, rs3 | R4-type | src2 | rs3 | 10 | rm | 10 | 011 |
FADD.H | fadd.h rd, rs1, rs2 | R-type | src2 | 00000 | 10 | rm | 10 | 100 |
FSUB.H | fsub.h rd, rs1, rs2 | R-type | src2 | 00001 | 10 | rm | 10 | 100 |
FMUL.H | fmul.h rd, rs1, rs2 | R-type | src2 | 00010 | 10 | rm | 10 | 100 |
FDIV.H | fdiv.h rd, rs1, rs2 | R-type | src2 | 00011 | 10 | rm | 10 | 100 |
FSQRT.H | fsqrt.h rd, rs1 | R-type | 0 | 01011 | 10 | rm | 10 | 100 |
FMIN.H | fmin.h rd, rs1, rs2 | R-type | src2 | 00101 | 10 | 000 | 10 | 100 |
FMAX.H | fmax.h rd, rs1, rs2 | R-type | src2 | 00101 | 10 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.S.H | fcvt.s.h rd, rs1 | R-type | 00010 | 01000 | 00 | rm | 10 | 100 |
FCVT.D.H | fcvt.d.h rd, rs1 | R-type | 00010 | 01000 | 01 | rm | 10 | 100 |
FCVT.Q.H | fcvt.d.h rd, rs1 | R-type | 00010 | 01000 | 01 | rm | 10 | 100 |
FCVT.H.S | fcvt.h.s rd, rs1 | R-type | 00000 | 01000 | 10 | rm | 10 | 100 |
FCVT.H.D | fcvt.h.d rd, rs1 | R-type | 00001 | 01000 | 10 | rm | 10 | 100 |
FCVT.H.Q | fcvt.h.q rd, rs1 | R-type | 00011 | 01000 | 10 | rm | 10 | 100 |
FCVT.W.H | fcvt.w.h rd, rs1 | R-type | 00000 | 11000 | 10 | rm | 10 | 100 |
FCVT.WU.H | fcvt.wu.h rd, rs1 | R-type | 00001 | 11000 | 10 | rm | 10 | 100 |
FCVT.H.W | fcvt.h.w rd, rs1 | R-type | 00000 | 11010 | 10 | rm | 10 | 100 |
FCVT.H.WU | fcvt.h.wu rd, rs1 | R-type | 00001 | 11010 | 10 | rm | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FSGNJ.H | fsgnj.h rd, rs1, rs2 | R-type | src2 | 00100 | 10 | 000 | 10 | 100 |
FSGNJN.H | fsgnjn.h rd, rs1, rs2 | R-type | src2 | 00100 | 10 | 001 | 10 | 100 |
FSGNJX.H | fsgnjx.h rd, rs1, rs2 | R-type | src2 | 00100 | 10 | 010 | 10 | 100 |
FMV.X.H | fmv.x.h rd, rs1 | R-type | 0 | 11100 | 10 | 000 | 10 | 100 |
FMV.H.X | fmv.h.x rd, rs1 | R-type | 0 | 11110 | 10 | 000 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FEQ.H | feq.h rd, rs1, rs2 | R-type | src2 | 10100 | 10 | 010 | 10 | 100 |
FLT.H | flt.h rd, rs1, rs2 | R-type | src2 | 10100 | 10 | 001 | 10 | 100 |
FLE.H | fle.h rd, rs1, rs2 | R-type | src2 | 10100 | 10 | 000 | 10 | 100 |
FCLASS.H | fclass.h rd, rs1 | R-type | 0 | 10100 | 10 | 001 | 10 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] |
FCVT.L.H | fcvt.l.h rd, rs1 | R-type | 00010 | 11000 | 10 | rm | 10 | 100 |
FCVT.LU.H | fcvt.lu.h rd, rs1 | R-type | 00011 | 11000 | 10 | rm | 10 | 100 |
FCVT.H.L | fcvt.h.l rd, rs1 | R-type | 00010 | 11010 | 10 | rm | 10 | 100 |
FCVT.H.LU | fcvt.h.lu rd, rs1 | R-type | 00011 | 11010 | 10 | rm | 10 | 100 |
[각주]
2.11. RISC-V Privileged ISA[편집]
명령어 | mnemonic | 인코딩 | rd | rs1 | funct12 | funct3 | inst[6:5] | inst[4:2] |
SRET | sret | I-type | 0 | 0 | 000100000010 | 000 | 11 | 100 |
MRET | mret | I-type | 0 | 0 | 001100000010 | 000 | 11 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rd | rs1 | funct12 | funct3 | inst[6:5] | inst[4:2] |
WFI | wfi | I-type | 0 | 0 | 000100000101 | 000 | 11 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rd | rs2 | rs1 | funct7 | funct3 | inst[6:5] | inst[4:2] |
SFENCE.VMA | sfence.vma rs1, rs2 | R-type | 0 | asid | vaddr | 0001001 | 000 | 11 | 100 |
SINVAL.VMA | sinval.vma rs1, rs2 | R-type | 0 | asid | vaddr | 0001011 | 000 | 11 | 100 |
SFENCE.W.INVAL | sfence.w.inval | R-type | 0 | 0 | 0 | 0001100 | 000 | 11 | 100 |
SFENCE.INVAL.IR | sfence.inval.ir | R-type | 0 | 1 | 0 | 0001100 | 000 | 11 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rd | rs2 | rs1 | funct7 | funct3 | inst[6:5] | inst[4:2] |
HFENCE.VVMA | hfence.vvma rs1, rs2 | R-type | 0 | asid | vaddr | 0010001 | 000 | 11 | 100 |
HFENCE.GVMA | hfence.gvma rs1, rs2 | R-type | 0 | vmid | gaddr | 0110001 | 000 | 11 | 100 |
HINVAL.VVMA | hinval.vvma rs1, rs2 | R-type | 0 | asid | vaddr | 0010011 | 000 | 11 | 100 |
HINVAL.GVMA | hinval.gvma rs1, rs2 | R-type | 0 | vmid | gaddr | 0110011 | 000 | 11 | 100 |
[각주]
2.11.5. 하이퍼바이저 가상머신 Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | rd | rs2 | funct7 | funct3 | inst[6:5] | inst[4:2] |
HLV.B | hlv.b rd, (rs1) | R-type | rd | 00000 | 0110000 | 100 | 11 | 100 |
HLV.BU | hlv.bu rd, (rs1) | R-type | rd | 00001 | 0110000 | 100 | 11 | 100 |
HLV.H | hlv.h rd, (rs1) | R-type | rd | 00000 | 0110010 | 100 | 11 | 100 |
HLV.HU | hlv.hu rd, (rs1) | R-type | rd | 00001 | 0110010 | 100 | 11 | 100 |
HLVX.HU | hlvx.hu rd, (rs1) | R-type | rd | 00011 | 0110010 | 100 | 11 | 100 |
HLV.W | hlv.w rd, (rs1) | R-type | rd | 00000 | 0110100 | 100 | 11 | 100 |
HLVX.WU | hlvx.wu rd, (rs1) | R-type | rd | 00011 | 0110100 | 100 | 11 | 100 |
HSV.B | hsv.b rs2, (rs1) | R-type | 0 | rs2 | 0110001 | 100 | 11 | 100 |
HSV.H | hsv.h rs2, (rs1) | R-type | 0 | rs2 | 0110011 | 100 | 11 | 100 |
HSV.W | hsv.w rs2, (rs1) | R-type | 0 | rs2 | 0110101 | 100 | 11 | 100 |
[각주]
명령어 | mnemonic | 인코딩 | rd | rs2 | funct7 | funct3 | inst[6:5] | inst[4:2] |
HLV.WU | hlv.wu rd, (rs1) | R-type | rd | 00001 | 0110100 | 100 | 11 | 100 |
HLV.D | hlv.d rd, (rs1) | R-type | rd | 00000 | 0110110 | 100 | 11 | 100 |
HSV.D | hsv.d rs2, (rs1) | R-type | 0 | rs2 | 0110111 | 100 | 11 | 100 |
[각주]
2.12.1. 스택 포인터 기반 Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[12] | inst[11:7] | inst[6:2] | op | 비고 |
C.LWSP | c.lwsp rd, offset(sp) | CI-type | 010 | offset[5] | rd | offset[4:2|7:6] | 10 | [4] |
C.LDSP | c.ldsp rd, offset(sp) | CI-type | 011 | offset[5] | rd | offset[4:3|8:6] | 10 | [5] RV64C/RV128C only. ld rd, offset(sp)로 확장된다. |
C.LQSP | c.lqsp rd, offset(sp) | CI-type | 001 | offset[5] | rd | offset[4|9:6] | 10 | [6] RV128C only. lq rd, offset(sp)로 확장된다. |
C.FLWSP | c.flwsp rd, offset(sp) | CI-type | 011 | offset[5] | rd | offset[4:2|7:6] | 10 | [7] |
C.FLDSP | c.fldsp rd, offset(sp) | CI-type | 001 | offset[5] | rd | offset[4:3|8:6] | 10 | [8] |
C.SWSP | c.swsp rs2, offset(sp) | CSS-type | 110 | offset[5:2|7:6] | rs2 | 10 | [9] sw rs2, offset(sp)로 확장된다. |
C.SDSP | c.sdsp rs2, offset(sp) | CSS-type | 111 | offset[5:3|8:6] | rs2 | 10 | [10] RV64C/RV128C only. sd rs2, offset(sp)로 확장된다. |
C.SQSP | c.sqsp rs2, offset(sp) | CSS-type | 101 | offset[5:4|9:6] | rs2 | 10 | [11] RV128C only. sq rs2, offset(sp)로 확장된다. |
C.FSWSP | c.fswsp rs2, offset(sp) | CSS-type | 111 | offset[5:2|7:6] | rs2 | 10 | [12] |
C.FSDSP | c.fsdsp rs2, offset(sp) | CSS-type | 101 | offset[5:3|8:6] | rs2 | 10 | [13] |
2.12.2. 레지스터 기반 Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | funct3 | inst[12:10] | inst[9:7] | inst[6:5] | inst[4:2] | op | 비고 |
C.LW | c.lw rd', offset(rs1') | CL-type | 010 | offset[5:3] | rs1' | offset[2|6] | rd' | 00 | [14] lw rd', offset(rs1')로 확장된다. |
C.LD | c.ld rd', offset(rs1') | CL-type | 011 | offset[5:3] | rs1' | offset[7:6] | rd' | 00 | [15] RV64C/RV128C only. ld rd', offset(rs1')로 확장된다. |
C.LQ | c.lq rd', offset(rs1') | CL-type | 001 | offset[5:4|8] | rs1' | offset[7:6] | rd' | 00 | [16] RV128C only. lq rd', offset(rs1')로 확장된다. |
C.FLW | c.flw rd', offset(rs1') | CL-type | 011 | offset[5:3] | rs1' | offset[2|6] | rd' | 00 | [17] |
C.FLD | c.fld rd', offset(rs1') | CL-type | 001 | offset[5:3] | rs1' | offset[7:6] | rd' | 00 | [18] |
C.SW | c.sw rs2', offset(rs1') | CS-type | 110 | offset[5:3] | rs1' | offset[2|6] | rs2' | 00 | [19] sw rs2', offset(rs1')로 확장된다. |
C.SD | c.sd rs2', offset(rs1') | CS-type | 111 | offset[5:3] | rs1' | offset[7:6] | rs2' | 00 | [20] RV64C/RV128C only. sd rs2', offset(rs1')로 확장된다. |
C.SQ | c.sq rs2', offset(rs1') | CS-type | 101 | offset[5:4|8] | rs1' | offset[7:6] | rs2' | 00 | [21] RV128C only. sq rs2', offset(rs1')로 확장된다. |
C.FSW | c.fsw rs2', offset(rs1') | CS-type | 111 | offset[5:3] | rs1' | offset[2|6] | rs2' | 00 | [22] |
C.FSD | c.fsd rs2', offset(rs1') | CS-type | 101 | offset[5:3] | rs1' | offset[7:6] | rs2' | 00 | [23] |
명령어 | mnemonic | 인코딩 | funct3 | inst[12] | inst[11:10] | inst[9:7] | inst[6:5] | inst[4:2] | op | 비고 |
C.J | c.j offset | CJ-type | 101 | offset[11|4|9:8|10|6|7|3:1|5] | 01 | [24] |
C.JAL | c.jal offset | CJ-type | 001 | offset[11|4|9:8|10|6|7|3:1|5] | 01 | [25] RV32C only. jal ra, offset으로 확장된다. |
C.JR | c.jr offset(rs1) | CR-type | 100 | 0 | rs1≠0 | 0 | 10 | [26] |
C.JALR | c.jalr offset(rs1) | CR-type | 100 | 1 | rs1≠0 | 0 | 10 | [27] |
C.BEQZ | c.beqz offset | CB-type | 110 | offset[8|4:3] | rs1' | offset[7:6|2:1|5] | 01 | [28] beq rs1', x0, offset으로 확장된다. |
C.BNEZ | c.bnez offset | CB-type | 111 | offset[8|4:3] | rs1' | offset[7:6|2:1|5] | 01 | [29] bne rs1', x0, offset으로 확장된다. |
명령어 | mnemonic | 인코딩 | funct3 | inst[12] | inst[11:7] | inst[6:2] | op | 비고 |
C.LI | c.li rd, imm | CI-type | 010 | imm[5] | rd≠0 | imm[4:0] | 01 | [30] |
C.LUI | c.lui rd, nzimm | CI-type | 011 | nzimm[17] | rd≠{0,2} | nzimm[16:12] | 01 | [31] |
명령어 | mnemonic | 인코딩 | funct3 | inst[12] | [11:10] | [9:7] | inst[6:5] | inst[4:2] | op | 비고 |
C.ADDI | c.addi rd, nzimm | CI-type | 000 | nzimm[5] | rd/rs1 | nzimm[4:0] | 01 | [32] addi rd, rd, nzimm으로 확장된다. |
C.ADDIW | c.addiw rd, imm | CI-type | 001 | imm[5] | rd/rs1≠0 | imm[4:0] | 01 | [33] RV64C/RV128C only. addiw rd, rd, imm으로 확장된다. |
C.ADDI4SPN | c.addi4spn rd, nzuimm | CIW-type | 000 | nzuimm[5:4|9:6|2|3] | rd' | 00 | [34] addi rd', sp, nzuimm으로 확장된다. |
C.ADDI16SP | c.addi16sp rd, nzimm | CI-type | 011 | nzimm[9] | 2 | nzimm[4|6|8:7|5] | 01 | [35] addi sp, sp, nzimm으로 확장된다. |
C.SLLI | c.slli rd, shamt | CI-type | 000 | shamt[5] | rd/rs1 | shamt[4:0] | 10 | [36] slli rd, rd, shamt로 확장된다. 단, RV128C에서 shamt=0은 slli rd, rd, 64를 의미한다. (C.SLLI64) |
C.SRLI | c.srli rd', shamt | CI-type | 100 | shamt[5] | 00 | rd'/rs1' | shamt[4:0] | 01 | [37] srli rd', rd', shamt로 확장된다. 단, RV128C에서 shamt=0은 srli rd, rd, 64를 의미한다. (C.SRLI64) |
C.SRAI | c.srai rd', shamt | CI-type | 100 | shamt[5] | 01 | rd'/rs1' | shamt[4:0] | 01 | [38] srai rd', rd', shamt로 확장된다. 단, RV128C에서 shamt=0은 srai rd, rd, 64를 의미한다. (C.SRAI64) |
C.ANDI | c.andi rd', imm | CI-type | 100 | imm[5] | 10 | rd'/rs1' | imm[4:0] | 01 | [39] andi rd', rd', imm으로 확장된다. |
NOP 연산은
C.ADDI x0, 0
으로 인코딩된다. C.ADDI에서 rd=0, nzimm≠0 또는 rd≠0, nzimm=0인 경우는 HINT 명령어를 인코딩하는 데 사용된다.
명령어 | mnemonic | 인코딩 | funct4 | inst[11:10] | [9:7] | inst[6:5] | [4:2] | op | 비고 |
C.MV | c.mv rd, rs2 | CR-type | 1000 | rd≠0 | rs2≠0 | 10 | [40] |
C.ADD | c.add rd, rs2 | CR-type | 1001 | rd/rs1≠0 | rs2≠0 | 10 | [41] |
C.SUB | c.sub rd', rs2' | CA-type | 1000 | 11 | rd'/rs1' | 00 | rs2' | 01 | [42] sub rd', rd', rs2'로 확장된다. |
C.XOR | c.xor rd', rs2' | CA-type | 1000 | 11 | rd'/rs1' | 01 | rs2' | 01 | [43] xor rd', rd', rs2'로 확장된다. |
C.OR | c.or rd', rs2' | CA-type | 1000 | 11 | rd'/rs1' | 10 | rs2' | 01 | [44] |
C.AND | c.and rd', rs2' | CA-type | 1000 | 11 | rd'/rs1' | 11 | rs2' | 01 | [45] and rd', rd', rs2'로 확장된다. |
C.ADDW | c.addw rd', rs2' | CA-type | 1001 | 11 | rd'/rs1' | 01 | rs2' | 01 | [46] addw rd', rd', rs2'로 확장된다. |
C.SUBW | c.subw rd', rs2' | CA-type | 1001 | 11 | rd'/rs1' | 00 | rs2' | 01 | [47] subw rd', rd', rs2'로 확장된다. |
명령어 | mnemonic | 인코딩 | funct4 | inst[11:7] | inst[6:2] | op | 비고 |
C.EBREAK | c.ebreak | CR-type | 1001 | 0 | 0 | 10 | |
C.ADD opcode에서 rd=rs2=0인 경우는 C.EBREAK 명령어를 인코딩하는 데 사용된다.
[각주]
명령어 | mnemonic | 인코딩 | funct3 | inst[12] | inst[11:7] | inst[6:2] | op | 비고 |
Illegal | - | CI-type | 000 | 0 | 0 | 0 | 00 | |
[각주]
[각주]
[각주]
2.15. "Zihintpause" 확장[편집]
[각주]
2.16. "Zfinx" / "Zdinx" / "Zhinx " / "Zhinxmin" 확장[편집]
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] | 비고 |
FLI.fmt | R-type | 1 | 11110 | fmt | 000 | 10 | 100 | |
FLI.S | fli.s rd, rs1 | R-type | 1 | 11110 | 00 | 000 | 10 | 100 | |
FLI.D | fli.d rd, rs1 | R-type | 1 | 11110 | 01 | 000 | 10 | 100 | |
FLI.H | fli.h rd, rs1 | R-type | 1 | 11110 | 10 | 000 | 10 | 100 | |
FLI.Q | fli.q rd, rs1 | R-type | 1 | 11110 | 11 | 000 | 10 | 100 | |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] | 비고 |
FMINM.S | fminm.s rd, rs1, rs2 | R-type | src2 | 00101 | 00 | 010 | 10 | 100 | |
FMINM.D | fminm.d rd, rs1, rs2 | R-type | src2 | 00101 | 01 | 010 | 10 | 100 | |
FMINM.H | fminm.h rd, rs1, rs2 | R-type | src2 | 00101 | 10 | 010 | 10 | 100 | |
FMINM.Q | fminm.q rd, rs1, rs2 | R-type | src2 | 00101 | 11 | 010 | 10 | 100 | |
FMAXM.S | fmaxm.s rd, rs1, rs2 | R-type | src2 | 00101 | 00 | 011 | 10 | 100 | |
FMAXM.D | fmaxm.d rd, rs1, rs2 | R-type | src2 | 00101 | 01 | 011 | 10 | 100 | |
FMAXM.H | fmaxm.h rd, rs1, rs2 | R-type | src2 | 00101 | 10 | 011 | 10 | 100 | |
FMAXM.Q | fmaxm.q rd, rs1, rs2 | R-type | src2 | 00101 | 11 | 011 | 10 | 100 | |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] | 비고 |
FROUND.S | fround.s rd, rs1 | R-type | 00100 | 01000 | 00 | rm | 10 | 100 | |
FROUNDNX.S | froundnx.s rd, rs1 | R-type | 00101 | 01000 | 00 | rm | 10 | 100 | |
FROUND.D | fround.d rd, rs1 | R-type | 00100 | 01000 | 01 | rm | 10 | 100 | |
FROUNDNX.D | froundnx.d rd, rs1 | R-type | 00101 | 01000 | 01 | rm | 10 | 100 | |
FROUND.H | fround.h rd, rs1 | R-type | 00100 | 01000 | 10 | rm | 10 | 100 | |
FROUNDNX.H | froundnx.h rd, rs1 | R-type | 00101 | 01000 | 10 | rm | 10 | 100 | |
FROUND.Q | fround.q rd, rs1 | R-type | 00100 | 01000 | 11 | rm | 10 | 100 | |
FROUNDNX.Q | froundnx.q rd, rs1 | R-type | 00101 | 01000 | 11 | rm | 10 | 100 | |
[각주]
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] | 비고 |
FCVTMOD.W.D | fcvtmod.w.d rd, rs1 | R-type | 01000 | 11000 | 01 | 001 | 10 | 100 | [48] |
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] | 비고 |
FMVH.X.D | fmvh.x.d rd, rs1 | R-type | 1 | 11100 | 01 | 000 | 10 | 100 | [49] |
FMVP.D.X | fmvp.d.x rd, rs1, rs2 | R-type | rs2 | 10110 | 01 | 000 | 10 | 100 | [50] |
FMVH.X.Q | fmvh.x.q rd, rs1 | R-type | 1 | 11100 | 11 | 000 | 10 | 100 | [51] |
FMVP.Q.X | fmvp.q.x rd, rs1, rs2 | R-type | rs2 | 10110 | 11 | 000 | 10 | 100 | [52] |
명령어 | mnemonic | 인코딩 | rs2 | funct5 | fmt | funct3 | inst[6:5] | inst[4:2] | 비고 |
FLEQ.S | fleq.s rd, rs1, rs2 | R-type | src2 | 10100 | 00 | 100 | 10 | 100 | |
FLTQ.S | fltq.s rd, rs1, rs2 | R-type | src2 | 10100 | 00 | 101 | 10 | 100 | |
FLEQ.D | fleq.d rd, rs1, rs2 | R-type | src2 | 10100 | 01 | 100 | 10 | 100 | |
FLTQ.D | fltq.d rd, rs1, rs2 | R-type | src2 | 10100 | 01 | 101 | 10 | 100 | |
FLEQ.H | fleq.h rd, rs1, rs2 | R-type | src2 | 10100 | 10 | 100 | 10 | 100 | |
FLTQ.H | fltq.h rd, rs1, rs2 | R-type | src2 | 10100 | 10 | 101 | 10 | 100 | |
FLEQ.Q | fleq.q rd, rs1, rs2 | R-type | src2 | 10100 | 11 | 100 | 10 | 100 | |
FLTQ.Q | fltq.q rd, rs1, rs2 | R-type | src2 | 10100 | 11 | 101 | 10 | 100 | |
[각주]
[각주]
[각주]
2.20.1.1. Unit-Stride Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | nf | mew | mop | vm | lumop | width | inst[6:5] | inst[4:2] | 비고 |
VLE8.V | vle8.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 00000 | 000 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLE16.V | vle16.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 00000 | 101 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLE32.V | vle32.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 00000 | 110 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLE64.V | vle64.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 00000 | 111 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLM.V | vlm.v vd, (rs1) | VL* | 000 | 0 | 00 | 1 | 01011 | 000 | 00 | 001 | |
VLE8FF.V | vle8ff.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 10000 | 000 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLE16FF.V | vle16ff.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 10000 | 101 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLE32FF.V | vle32ff.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 10000 | 110 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLE64FF.V | vle64ff.v vd, (rs1), vm | VL* | 000 | 0 | 00 | vm | 10000 | 111 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSE8.V | vse8.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 00000 | 000 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSE16.V | vse16.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 00000 | 101 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSE32.V | vse32.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 00000 | 110 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSE64.V | vse64.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 00000 | 111 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSM.V | vsm.v vs3, (rs1) | VS* | 000 | 0 | 00 | 1 | 01011 | 000 | 01 | 001 | |
VSE8FF.V | vse8ff.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 10000 | 000 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSE16FF.V | vse16ff.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 10000 | 101 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSE32FF.V | vse32ff.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 10000 | 110 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSE64FF.V | vse64ff.v vs3, (rs1), vm | VS* | 000 | 0 | 00 | vm | 10000 | 111 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
명령어 | mnemonic | 인코딩 | nf | mew | mop | vm | lumop | width | inst[6:5] | inst[4:2] | 비고 |
VLSE8.V | vlse8.v vd, (rs1), rs2, vm | VLS* | 000 | 0 | 10 | vm | - | 000 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSE16.V | vlse16.v vd, (rs1), rs2, vm | VLS* | 000 | 0 | 10 | vm | - | 101 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSE32.V | vlse32.v vd, (rs1), rs2, vm | VLS* | 000 | 0 | 10 | vm | - | 110 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSE64.V | vlse64.v vd, (rs1), rs2, vm | VLS* | 000 | 0 | 10 | vm | - | 111 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSE8.V | vsse8.v vs3, (rs1), rs2, vm | VSS* | 000 | 0 | 10 | vm | - | 000 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSE16.V | vsse16.v vs3, (rs1), rs2, vm | VSS* | 000 | 0 | 10 | vm | - | 101 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSE32.V | vsse32.v vs3, (rs1), rs2, vm | VSS* | 000 | 0 | 10 | vm | - | 110 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSE64.V | vsse64.v vs3, (rs1), rs2, vm | VSS* | 000 | 0 | 10 | vm | - | 111 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
2.20.1.3. Vector Indexed Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | nf | mew | mop | vm | lumop | width | inst[6:5] | inst[4:2] | 비고 |
VLUXEI8.V | vluxei8.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 01 | vm | - | 000 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLUXEI16.V | vluxei16.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 01 | vm | - | 101 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLUXEI32.V | vluxei32.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 01 | vm | - | 110 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLUXEI64.V | vluxei64.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 01 | vm | - | 111 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLOXEI8.V | vloxei8.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 11 | vm | - | 000 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLOXEI16.V | vloxei16.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 11 | vm | - | 101 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLOXEI32.V | vloxei32.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 11 | vm | - | 110 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLOXEI64.V | vloxei64.v vd, (rs1), vs2, vm | VLX* | 000 | 0 | 11 | vm | - | 111 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSUXEI8.V | vsuxei8.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 01 | vm | - | 000 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSUXEI16.V | vsuxei16.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 01 | vm | - | 101 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSUXEI32.V | vsuxei32.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 01 | vm | - | 110 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSUXEI64.V | vsuxei64.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 01 | vm | - | 111 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSOXEI8.V | vsoxei8.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 11 | vm | - | 000 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSOXEI16.V | vsoxei16.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 11 | vm | - | 101 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSOXEI32.V | vsoxei32.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 11 | vm | - | 110 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSOXEI64.V | vsoxei64.v vs3, (rs1), vs2, vm | VSX* | 000 | 0 | 11 | vm | - | 111 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
2.20.1.4. Unit-Stride Segment Load/Store 명령어[편집]
명령어 | mnemonic | 인코딩 | nf | mew | mop | vm | lumop | width | inst[6:5] | inst[4:2] | 비고 |
VLSEG<nf>E8.V | vlseg<nf>e8.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 00000 | 000 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSEG<nf>E16.V | vlseg<nf>e16.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 00000 | 101 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSEG<nf>E32.V | vlseg<nf>e32.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 00000 | 110 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSEG<nf>E64.V | vlseg<nf>e64.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 00000 | 111 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSEG<nf>E8FF.V | vlseg<nf>e8ff.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 10000 | 000 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSEG<nf>E16FF.V | vlseg<nf>e16ff.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 10000 | 101 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSEG<nf>E32FF.V | vlseg<nf>e32ff.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 10000 | 110 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VLSEG<nf>E64FF.V | vlseg<nf>e64ff.v vd, (rs1), vm | VL* | nf | 0 | 00 | vm | 10000 | 111 | 00 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E8.V | vsseg<nf>e8.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 00000 | 000 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E16.V | vsseg<nf>e16.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 00000 | 101 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E32.V | vsseg<nf>e32.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 00000 | 110 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E64.V | vsseg<nf>e64.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 00000 | 111 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E8FF.V | vsseg<nf>e8ff.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 10000 | 000 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E16FF.V | vsseg<nf>e16ff.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 10000 | 101 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E32FF.V | vsseg<nf>e32ff.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 10000 | 110 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
VSSEG<nf>E64FF.V | vsseg<nf>e64ff.v vs3, (rs1), vm | VS* | nf | 0 | 00 | vm | 10000 | 111 | 01 | 001 | [vm] vm 필드는 생략하거나 v0.t로 둘 수 있다. vm=0인 경우 v0.mask\[i\] 값을 사용하고 vm=1인 경우 unmasked. |
2.20.1.5. Strided Segment Load/Store 명령어[편집]
[각주]
2.20.1.6. Vector Indexed Segment Load/Store 명령어[편집]
[각주]
명령어 | mnemonic | 인코딩 | nf | mew | mop | vm | lumop | width | inst[6:5] | inst[4:2] | 비고 |
VL1RE8.V | vl1re8.v vd, (rs1) | VL* | 000 | 0 | 00 | 1 | 01000 | 000 | 00 | 001 | |
VL1RE16.V | vl1re16.v vd, (rs1) | VL* | 000 | 0 | 00 | 1 | 01000 | 101 | 00 | 001 | |
VL1RE32.V | vl1re32.v vd, (rs1) | VL* | 000 | 0 | 00 | 1 | 01000 | 110 | 00 | 001 | |
VL1RE64.V | vl1re64.v vd, (rs1) | VL* | 000 | 0 | 00 | 1 | 01000 | 111 | 00 | 001 | |
VL2RE8.V | vl2re8.v vd, (rs1) | VL* | 001 | 0 | 00 | 1 | 01000 | 000 | 00 | 001 | |
VL2RE16.V | vl2re16.v vd, (rs1) | VL* | 001 | 0 | 00 | 1 | 01000 | 101 | 00 | 001 | |
VL2RE32.V | vl2re32.v vd, (rs1) | VL* | 001 | 0 | 00 | 1 | 01000 | 111 | 00 | 001 | |
VL2RE64.V | vl2re64.v vd, (rs1) | VL* | 001 | 0 | 00 | 1 | 01000 | 111 | 00 | 001 | |
VL4RE8.V | vl4re8.v vd, (rs1) | VL* | 011 | 0 | 00 | 1 | 01000 | 000 | 00 | 001 | |
VL4RE16.V | vl4re16.v vd, (rs1) | VL* | 011 | 0 | 00 | 1 | 01000 | 101 | 00 | 001 | |
VL4RE32.V | vl4re32.v vd, (rs1) | VL* | 011 | 0 | 00 | 1 | 01000 | 110 | 00 | 001 | |
VL4RE64.V | vl4re64.v vd, (rs1) | VL* | 011 | 0 | 00 | 1 | 01000 | 111 | 00 | 001 | |
VL8RE8.V | vl8re8.v vd, (rs1) | VL* | 111 | 0 | 00 | 1 | 01000 | 000 | 00 | 001 | |
VL8RE16.V | vl8re16.v vd, (rs1) | VL* | 111 | 0 | 00 | 1 | 01000 | 101 | 00 | 001 | |
VL8RE32.V | vl8re32.v vd, (rs1) | VL* | 111 | 0 | 00 | 1 | 01000 | 110 | 00 | 001 | |
VL8RE64.V | vl8re64.v vd, (rs1) | VL* | 111 | 0 | 00 | 1 | 01000 | 111 | 00 | 001 | |
VS1RE8.V | vs1re8.v vs3, (rs1) | VS* | 000 | 0 | 00 | 1 | 01000 | 000 | 01 | 001 | |
VS1RE16.V | vs1re16.v vs3, (rs1) | VS* | 000 | 0 | 00 | 1 | 01000 | 101 | 01 | 001 | |
VS1RE32.V | vs1re32.v vs3, (rs1) | VS* | 000 | 0 | 00 | 1 | 01000 | 110 | 01 | 001 | |
VS1RE64.V | vs1re64.v vs3, (rs1) | VS* | 000 | 0 | 00 | 1 | 01000 | 111 | 01 | 001 | |
VS2RE8.V | vs2re8.v vs3, (rs1) | VS* | 001 | 0 | 00 | 1 | 01000 | 000 | 01 | 001 | |
VS2RE16.V | vs2re16.v vs3, (rs1) | VS* | 001 | 0 | 00 | 1 | 01000 | 101 | 01 | 001 | |
VS2RE32.V | vs2re32.v vs3, (rs1) | VS* | 001 | 0 | 00 | 1 | 01000 | 111 | 01 | 001 | |
VS2RE64.V | vs2re64.v vs3, (rs1) | VS* | 001 | 0 | 00 | 1 | 01000 | 111 | 01 | 001 | |
VS4RE8.V | vs4re8.v vs3, (rs1) | VS* | 011 | 0 | 00 | 1 | 01000 | 000 | 01 | 001 | |
VS4RE16.V | vs4re16.v vs3, (rs1) | VS* | 011 | 0 | 00 | 1 | 01000 | 101 | 01 | 001 | |
VS4RE32.V | vs4re32.v vs3, (rs1) | VS* | 011 | 0 | 00 | 1 | 01000 | 110 | 01 | 001 | |
VS4RE64.V | vs4re64.v vs3, (rs1) | VS* | 011 | 0 | 00 | 1 | 01000 | 111 | 01 | 001 | |
VS8RE8.V | vs8re8.v vs3, (rs1) | VS* | 111 | 0 | 00 | 1 | 01000 | 000 | 01 | 001 | |
VS8RE16.V | vs8re16.v vs3, (rs1) | VS* | 111 | 0 | 00 | 1 | 01000 | 101 | 01 | 001 | |
VS8RE32.V | vs8re32.v vs3, (rs1) | VS* | 111 | 0 | 00 | 1 | 01000 | 110 | 01 | 001 | |
VS8RE64.V | vs8re64.v vs3, (rs1) | VS* | 111 | 0 | 00 | 1 | 01000 | 111 | 01 | 001 | |
[각주]
[각주]
[각주]
[각주]
2.20.5. 벡터 Reduction 연산 명령어[편집]
[각주]
[각주]
2.20.7. 벡터 Permutation 연산 명령어[편집]
[각주]
[각주]
[각주]
[각주]
[각주]
[각주]
[각주]
이 문서의 내용 중 전체 또는 일부는 2023-11-02 13:00:29에 나무위키
RISC-V/명령어 목록 문서에서 가져왔습니다.