package core:rexcode/isa/riscv

⌘K
Ctrl+K
or
/

    Overview

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    rexcode · Brendan Punsky (dotbmp@github), original author

    Index

    Procedures (827)
    Procedure Groups (0)

    This section is empty.

    Types

    Decode_Entry ¶

    Decode_Entry :: struct #packed {
    	mnemonic: Mnemonic,
    	// 2
    	ops:      [4]Operand_Type,
    	// 4
    	enc:      [4]Operand_Encoding,
    	// 4
    	bits:     u32,
    	// 4
    	mask:     u32,
    	// 4
    	feature:  Feature,
    	// 1
    	flags:    Encoding_Flags,
    }

    Decode_Index ¶

    Decode_Index :: struct #packed {
    	start: u16,
    	count: u16,
    }

    Encode_Run ¶

    Encode_Run :: struct {
    	start: u32,
    	count: u32,
    }
     

    Companion run index: ENCODE_RUNS[mnemonic] -> contiguous run in ENCODE_FORMS.

    Encoding ¶

    Encoding :: struct #packed {
    	mnemonic: Mnemonic,
    	// 2
    	ops:      [4]Operand_Type,
    	// 4
    	enc:      [4]Operand_Encoding,
    	// 4
    	bits:     u32,
    	// 4
    	mask:     u32,
    	// 4
    	feature:  Feature,
    	// 1
    	flags:    Encoding_Flags,
    }

    Encoding_Flags ¶

    Encoding_Flags :: distinct bit_field u8 {
    	rv32_only: bool | 1,
    	rv64_only: bool | 1,
    	branch:    bool | 1,
    	fp_round:  bool | 1,
    	_:         u8 | 4,
    }

    Error ¶

    Error :: rexcode_isa.Error

    Error_Code ¶

    Error_Code :: rexcode_isa.Error_Code

    FPR ¶

    FPR :: enum u8 {
    	FT0  = 0, 
    	FT1  = 1, 
    	FT2  = 2, 
    	FT3  = 3, 
    	FT4  = 4, 
    	FT5  = 5, 
    	FT6  = 6, 
    	FT7  = 7, 
    	FS0  = 8, 
    	FS1  = 9, 
    	FA0  = 10, 
    	FA1  = 11, 
    	FA2  = 12, 
    	FA3  = 13, 
    	FA4  = 14, 
    	FA5  = 15, 
    	FA6  = 16, 
    	FA7  = 17, 
    	FS2  = 18, 
    	FS3  = 19, 
    	FS4  = 20, 
    	FS5  = 21, 
    	FS6  = 22, 
    	FS7  = 23, 
    	FS8  = 24, 
    	FS9  = 25, 
    	FS10 = 26, 
    	FS11 = 27, 
    	FT8  = 28, 
    	FT9  = 29, 
    	FT10 = 30, 
    	FT11 = 31, 
    }
    Related Procedures With Parameters

    Feature ¶

    Feature :: enum u8 {
    	I,        // RV32I / RV64I base integer
    	M,        // multiply / divide
    	A,        // atomics
    	F,        // single-precision FP
    	D,        // double-precision FP
    	ZICSR,    // CSR access (CSRRW/S/C + immediate forms)
    	ZIFENCEI, // FENCE.I (instruction-fetch fence)
    	C,        // 16-bit compressed instructions
    }
     

    Extension this entry belongs to (metadata, not used by the matcher).

    GPR ¶

    GPR :: enum u8 {
    	ZERO = 0, 
    	RA   = 1, 
    	SP   = 2, 
    	GP   = 3, 
    	TP   = 4, 
    	T0   = 5, 
    	T1   = 6, 
    	T2   = 7, 
    	S0   = 8, 
    	S1   = 9, 
    	A0   = 10, 
    	A1   = 11, 
    	A2   = 12, 
    	A3   = 13, 
    	A4   = 14, 
    	A5   = 15, 
    	A6   = 16, 
    	A7   = 17, 
    	S2   = 18, 
    	S3   = 19, 
    	S4   = 20, 
    	S5   = 21, 
    	S6   = 22, 
    	S7   = 23, 
    	S8   = 24, 
    	S9   = 25, 
    	S10  = 26, 
    	S11  = 27, 
    	T3   = 28, 
    	T4   = 29, 
    	T5   = 30, 
    	T6   = 31, 
    }
    Related Procedures With Parameters
    Related Constants

    Instruction ¶

    Instruction :: struct #packed {
    	ops:           [4]Operand `fmt:"v,operand_count"`,
    	// 40 bytes
    	mnemonic:      Mnemonic,
    	// 2
    	operand_count: u8,
    	// 1
    	flags:         Instruction_Flags,
    	// 1
    	length:        u8,
    	// 1 -- always 4 for non-C
    	_:             [3]u8,
    }
    Related Procedures With Returns

    Instruction_Flags ¶

    Instruction_Flags :: distinct bit_field u8 {
    	_: u8 | 8,
    }

    Instruction_Info ¶

    Instruction_Info :: struct {
    	offset:       u32,
    	decode_entry: u16,
    	_:            u16,
    }

    Label_Definition ¶

    Label_Definition :: rexcode_isa.Label_Definition
    Related Constants

    Label_Map ¶

    Label_Map :: rexcode_isa.Label_Map

    Memory ¶

    Memory :: struct #packed {
    	base: Register,
    	// GPR base
    	_:    u16,
    	disp: i32,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Mnemonic ¶

    Mnemonic :: enum u16 {
    	INVALID    = 0, 
    	// Upper-immediate
    	LUI, 
    	AUIPC, 
    	// Jumps
    	JAL, 
    	JALR, 
    	// Branches
    	BEQ, 
    	BNE, 
    	BLT, 
    	BGE, 
    	BLTU, 
    	BGEU, 
    	// Loads / stores
    	LB, 
    	LH, 
    	LW, 
    	LBU, 
    	LHU, 
    	SB, 
    	SH, 
    	SW, 
    	LWU, 
    	LD,             // RV64-only
    	SD,             // RV64-only
    	// Integer reg-imm
    	ADDI, 
    	SLTI, 
    	SLTIU, 
    	XORI, 
    	ORI, 
    	ANDI, 
    	SLLI, 
    	SRLI, 
    	SRAI,           // shift-immediate (5-bit shamt RV32; 6-bit RV64)
    	ADDIW, 
    	SLLIW, 
    	SRLIW, 
    	SRAIW,          // RV64-only (32-bit ops)
    	// Integer reg-reg
    	ADD, 
    	SUB, 
    	SLL, 
    	SLT, 
    	SLTU, 
    	XOR, 
    	SRL, 
    	SRA, 
    	OR, 
    	AND, 
    	ADDW, 
    	SUBW, 
    	SLLW, 
    	SRLW, 
    	SRAW,           // RV64-only
    	// Memory ordering
    	FENCE, 
    	FENCE_I, 
    	// System
    	ECALL, 
    	EBREAK, 
    	CSRRW, 
    	CSRRS, 
    	CSRRC, 
    	CSRRWI, 
    	CSRRSI, 
    	CSRRCI, 
    	MUL, 
    	MULH, 
    	MULHSU, 
    	MULHU, 
    	DIV, 
    	DIVU, 
    	REM, 
    	REMU, 
    	MULW, 
    	DIVW, 
    	DIVUW, 
    	REMW, 
    	REMUW,          // RV64-only
    	LR_W, 
    	SC_W, 
    	AMOSWAP_W, 
    	AMOADD_W, 
    	AMOXOR_W, 
    	AMOAND_W, 
    	AMOOR_W, 
    	AMOMIN_W, 
    	AMOMAX_W, 
    	AMOMINU_W, 
    	AMOMAXU_W, 
    	LR_D, 
    	SC_D,           // RV64-only
    	AMOSWAP_D, 
    	AMOADD_D, 
    	AMOXOR_D, 
    	AMOAND_D, 
    	AMOOR_D, 
    	AMOMIN_D, 
    	AMOMAX_D, 
    	AMOMINU_D, 
    	AMOMAXU_D, 
    	FLW, 
    	FSW, 
    	FMADD_S, 
    	FMSUB_S, 
    	FNMSUB_S, 
    	FNMADD_S, 
    	FADD_S, 
    	FSUB_S, 
    	FMUL_S, 
    	FDIV_S, 
    	FSQRT_S, 
    	FSGNJ_S, 
    	FSGNJN_S, 
    	FSGNJX_S, 
    	FMIN_S, 
    	FMAX_S, 
    	FCVT_W_S, 
    	FCVT_WU_S, 
    	FMV_X_W, 
    	FEQ_S, 
    	FLT_S, 
    	FLE_S, 
    	FCLASS_S, 
    	FCVT_S_W, 
    	FCVT_S_WU, 
    	FMV_W_X, 
    	FCVT_L_S, 
    	FCVT_LU_S, 
    	FCVT_S_L, 
    	FCVT_S_LU,      // RV64F
    	FLD, 
    	FSD, 
    	FMADD_D, 
    	FMSUB_D, 
    	FNMSUB_D, 
    	FNMADD_D, 
    	FADD_D, 
    	FSUB_D, 
    	FMUL_D, 
    	FDIV_D, 
    	FSQRT_D, 
    	FSGNJ_D, 
    	FSGNJN_D, 
    	FSGNJX_D, 
    	FMIN_D, 
    	FMAX_D, 
    	FCVT_S_D, 
    	FCVT_D_S, 
    	FEQ_D, 
    	FLT_D, 
    	FLE_D, 
    	FCLASS_D, 
    	FCVT_W_D, 
    	FCVT_WU_D, 
    	FCVT_D_W, 
    	FCVT_D_WU, 
    	FCVT_L_D, 
    	FCVT_LU_D, 
    	FCVT_D_L, 
    	FCVT_D_LU,      // RV64D
    	FMV_X_D, 
    	FMV_D_X,        // RV64D
    	// -------------------------------------------------------------------------
    	// C extension (16-bit compressed). Each C.* mnemonic expands semantically
    	// to a 32-bit base ISA instruction; the encoder picks the compressed
    	// form by mnemonic.
    	// -------------------------------------------------------------------------
    	C_NOP, 
    	C_EBREAK, 
    	C_ADDI4SPN,     // rd', sp, imm
    	C_LW, 
    	C_LD, 
    	C_SW, 
    	C_SD,           // (RV64 LD/SD; RV32 has LW/SW)
    	C_FLD, 
    	C_FSD,          // double-precision FP load/store
    	C_ADDI, 
    	C_ADDIW, 
    	C_LI, 
    	C_LUI, 
    	C_ADDI16SP,     // sp, imm
    	C_SRLI, 
    	C_SRAI, 
    	C_ANDI, 
    	C_SUB, 
    	C_XOR, 
    	C_OR, 
    	C_AND, 
    	C_SUBW, 
    	C_ADDW,         // RV64-only
    	C_J, 
    	C_JAL,          // C.JAL is RV32-only; RV64 has C.ADDIW
    	C_BEQZ, 
    	C_BNEZ, 
    	C_SLLI, 
    	C_LWSP, 
    	C_LDSP, 
    	C_SWSP, 
    	C_SDSP, 
    	C_FLDSP, 
    	C_FSDSP, 
    	C_JR, 
    	C_JALR, 
    	C_MV, 
    	C_ADD, 
    }
    Related Procedures With Parameters

    Operand ¶

    Operand :: struct #packed {
    	using _: struct #raw_union {
    		reg:       Register,
    		// REGISTER (int or FP)
    		mem:       Memory,
    		immediate: i64,
    		relative:  i64,
    	},
    	kind: Operand_Kind,
    	size: u8,
    }
    Related Procedures With Returns

    Operand_Encoding ¶

    Operand_Encoding :: enum u8 {
    	NONE, 
    	RD,              // bits 11-7   (any register, int or FP)
    	RS1,             // bits 19-15
    	RS2,             // bits 24-20
    	RS3,             // bits 31-27  (R4-type, FMADD/FMSUB/FNMADD/FNMSUB)
    	SHAMT5,          // bits 24-20  (5-bit shift)
    	SHAMT6,          // bits 25-20  (6-bit shift, RV64 long shifts)
    	IMM_I,           // bits 31-20  (signed I-type 12-bit)
    	IMM_S,           // bits 31-25 || 11-7  (S-type scatter)
    	IMM_B,           // B-type scatter: imm[12] @31, [10:5] @30-25, [4:1] @11-8, [11] @7
    	IMM_U,           // bits 31-12  (U-type 20-bit upper)
    	IMM_J,           // J-type scatter: imm[20] @31, [10:1] @30-21, [11] @20, [19:12] @19-12
    	OFFSET_BASE_I,   // memory: rs1 @bits 19-15 + IMM_I disp (loads, JALR, FLW, FLD)
    	OFFSET_BASE_S,   // memory: rs1 @bits 19-15 + IMM_S disp (stores, FSW, FSD)
    	OFFSET_BASE_A,   // memory: rs1 @bits 19-15 only (atomics; disp must be 0)
    	CSR_FIELD,       // bits 31-20  (12-bit CSR address)
    	ZIMM_FIELD,      // bits 19-15  (zero-extended 5-bit imm; replaces rs1 in CSRRxI)
    	FENCE_PRED,      // bits 27-24
    	FENCE_SUCC,      // bits 23-20
    	ROUND_FIELD,     // bits 14-12  (funct3 doubles as rm)
    	AQRL,            // bits 26-25  (atomic acquire/release)
    	// ---- C extension (compressed; bits fit in low 16 of the word) ----
    	C_RD_RS1,        // bits 11-7  (CR/CI shared rd/rs1 slot)
    	C_RS2,           // bits  6-2  (CR rs2)
    	C_RD_PRIMED,     // bits  4-2  (CIW/CL/CB rd' encoded as x8+field)
    	C_RS1_PRIMED,    // bits  9-7  (CL/CS/CA/CB rs1' encoded as x8+field)
    	C_RS2_PRIMED,    // bits  4-2  (CS/CA rs2' encoded as x8+field)
    	C_RD_RS1_PRIMED, // bits  9-7  (CA rd'/rs1' encoded as x8+field)
    	C_IMM_CI_S,      // bits 12 || 6-2  (signed 6-bit CI imm)
    	C_IMM_CI_U,      // bits 12 || 6-2  (unsigned 6-bit CI imm; SLLI shamt)
    	C_IMM_CIW,       // bits 12-5  (C.ADDI4SPN: scrambled to imm[9:2])
    	C_IMM_LUI,       // bits 12 || 6-2 (C.LUI: imm[17] || imm[16:12])
    	C_IMM_ADDI16SP,  // bits 12,4,3,5,2,6  -> imm[9,4,6,8:7,5]
    	C_IMM_CSS_W,     // bits 12-7  -> imm[5:2,7:6] (C.SWSP scaled by 4)
    	C_IMM_CSS_D,     // bits 12-7  -> imm[5:3,8:6] (C.SDSP scaled by 8)
    	C_IMM_CL_W,      // bits 12-10 || 6-5 -> imm[5:3,2,6] (C.LW/C.SW scaled by 4)
    	C_IMM_CL_D,      // bits 12-10 || 6-5 -> imm[5:3,7:6] (C.LD/C.SD scaled by 8)
    	C_BRANCH9,       // C.BEQZ/BNEZ: scatter to bits 12 || 10:9,2,7:6,5:4 || 11
    	C_BRANCH12,      // C.J/C.JAL: scatter to bits 12 || 8 || 10:9 || 6 || 7 || 2 || 11 || 5:3 -> imm[11,4,9:8,10,6,7,3:1,5]
    	C_OFFSET_BASE_W, // memory: rs1' at 9-7 + scaled-by-4 imm at 12-10 || 6-5
    	C_OFFSET_BASE_D, // memory: rs1' at 9-7 + scaled-by-8 imm at 12-10 || 6-5
    	C_SP_OFFSET_W,   // SP-relative: rd at 11-7 + scaled-by-4 imm at 12 || 6:4 || 3:2 -> imm[5,4:2,7:6]
    	C_SP_OFFSET_D,   // SP-relative: rd at 11-7 + scaled-by-8 imm at 12 || 6:5 || 4:2 -> imm[5,4:3,8:6]
    }
     

    Where the operand's bits land in the 32-bit instruction word.

    Operand_Kind ¶

    Operand_Kind :: enum u8 {
    	NONE, 
    	REGISTER,  // mostly used for `A` in `ROL A` (implicit; rarely needed)
    	IMMEDIATE, 
    	MEMORY, 
    	RELATIVE,  // PC-relative target (label or raw byte offset)
    }

    Operand_Type ¶

    Operand_Type :: enum u8 {
    	NONE, 
    	GPR, 
    	FPR, 
    	IMM12,       // signed 12-bit I-type immediate (ADDI/LOADS/JALR/...)
    	IMM12U,      // unsigned 12-bit (CSR address; some pseudo-uses)
    	IMM5,        // 5-bit shift amount (RV32 shifts; SLLIW/SRLIW/SRAIW)
    	IMM6,        // 6-bit shift amount (RV64 SLLI/SRLI/SRAI)
    	IMM20,       // 20-bit U-type immediate (LUI, AUIPC)
    	REL13,       // 13-bit branch target (label or signed byte offset)
    	REL21,       // 21-bit jump target (label or signed byte offset)
    	MEM,         // base + signed 12-bit displacement
    	CSR,         // 12-bit CSR address
    	FENCE_FLAGS, // 4-bit pred or succ mask (for FENCE)
    	ROUND_MODE,  // 3-bit FP rounding mode
    	ZIMM5,       // 5-bit zero-extended immediate (CSRRWI/SI/CI)
    	// ---- C extension (compressed) ----
    	GPR_C,       // "primed" 3-bit register (x8..x15 only)
    	GPR_SP,      // hardwired SP (x2) for C.ADDI16SP / C.LWSP / C.SWSP
    	GPR_NONZERO, // GPR with hw != 0 (C.ADDI/C.LI/C.MV/etc. forbid x0)
    	FPR_C,       // primed FP register (f8..f15 only)
    	IMM_C6S,     // CI-form signed 6-bit (C.ADDI/C.LI)
    	IMM_C6U,     // CI-form unsigned 6-bit (C.SLLI/SRLI/SRAI shamt)
    	IMM_C8U,     // CIW-form 8-bit unsigned scaled (C.ADDI4SPN)
    	IMM_C10S,    // C.ADDI16SP 10-bit signed scaled by 16
    	IMM_C18S,    // C.LUI 18-bit signed scaled by 4096
    	REL9,        // 9-bit signed PC-rel branch (C.BEQZ/BNEZ)
    	REL12,       // 12-bit signed PC-rel jump (C.J/C.JAL)
    	MEM_C_W,     // memory for C.LW/C.SW (rs1' + scaled imm by 4)
    	MEM_C_D,     // memory for C.LD/C.SD (rs1' + scaled imm by 8)
    	MEM_C_SP_W,  // SP-relative for C.LWSP/C.SWSP (scaled by 4)
    	MEM_C_SP_D,  // SP-relative for C.LDSP/C.SDSP (scaled by 8)
    }
     

    What the user passes in.

    Print_Result :: rexcode_isa.Print_Result

    Relocation ¶

    Relocation :: struct #packed {
    	offset:   u32,
    	label_id: u32,
    	addend:   i32,
    	type:     Relocation_Type,
    	size:     u8,
    	inst_idx: u16,
    }

    Relocation_Type ¶

    Relocation_Type :: enum u8 {
    	NONE         = 0, 
    	// PC-relative branches and jumps
    	BRANCH,           // 13-bit signed PC-rel, B-type scatter (BEQ/BNE/...)
    	JAL,              // 21-bit signed PC-rel, J-type scatter (JAL)
    	// PC-relative paired (AUIPC + ADDI/load/store)
    	PCREL_HI20,       // upper 20 bits of (sym - pc), U-type
    	PCREL_LO12_I,     // lower 12 bits, I-type form
    	PCREL_LO12_S,     // lower 12 bits, S-type form
    	// Absolute paired (LUI + ADDI/load/store)
    	HI20,             // upper 20 of absolute, U-type
    	LO12_I,           // lower 12, I-type
    	LO12_S,           // lower 12, S-type
    	// Helpful aggregate forms (the assembler can expand)
    	CALL,             // AUIPC + JALR pair to call a far symbol
    	// ---- C extension PC-relative ----
    	C_BRANCH,         // 9-bit signed PC-rel for C.BEQZ / C.BNEZ
    	C_JUMP,           // 12-bit signed PC-rel for C.J / C.JAL
    }

    Token ¶

    Token :: rexcode_isa.Token

    Token_Kind ¶

    Token_Kind :: rexcode_isa.Token_Kind

    XLEN ¶

    XLEN :: enum u8 {
    	RV32, 
    	RV64, 
    }
    Related Procedures With Parameters

    Constants

    A0 ¶

    A0 :: Register(REG_GPR | 10)

    A1 ¶

    A1 :: Register(REG_GPR | 11)

    A2 ¶

    A2 :: Register(REG_GPR | 12)

    A3 ¶

    A3 :: Register(REG_GPR | 13)

    A4 ¶

    A4 :: Register(REG_GPR | 14)

    A5 ¶

    A5 :: Register(REG_GPR | 15)

    A6 ¶

    A6 :: Register(REG_GPR | 16)

    A7 ¶

    A7 :: Register(REG_GPR | 17)

    DEFAULT_PRINT_OPTIONS ¶

    DEFAULT_PRINT_OPTIONS: rexcode_isa.Print_Options : isa.DEFAULT_PRINT_OPTIONS

    FA0 ¶

    FA0 :: Register(REG_FPR | 10)

    FA1 ¶

    FA1 :: Register(REG_FPR | 11)

    FA2 ¶

    FA2 :: Register(REG_FPR | 12)

    FA3 ¶

    FA3 :: Register(REG_FPR | 13)

    FA4 ¶

    FA4 :: Register(REG_FPR | 14)

    FA5 ¶

    FA5 :: Register(REG_FPR | 15)

    FA6 ¶

    FA6 :: Register(REG_FPR | 16)

    FA7 ¶

    FA7 :: Register(REG_FPR | 17)

    FP ¶

    FP :: GPR(8)
     

    S0 doubles as frame pointer in the ABI

    FS0 ¶

    FS0 :: Register(REG_FPR | 8)

    FS1 ¶

    FS1 :: Register(REG_FPR | 9)

    FS10 ¶

    FS10 :: Register(REG_FPR | 26)

    FS11 ¶

    FS11 :: Register(REG_FPR | 27)

    FS2 ¶

    FS2 :: Register(REG_FPR | 18)

    FS3 ¶

    FS3 :: Register(REG_FPR | 19)

    FS4 ¶

    FS4 :: Register(REG_FPR | 20)

    FS5 ¶

    FS5 :: Register(REG_FPR | 21)

    FS6 ¶

    FS6 :: Register(REG_FPR | 22)

    FS7 ¶

    FS7 :: Register(REG_FPR | 23)

    FS8 ¶

    FS8 :: Register(REG_FPR | 24)

    FS9 ¶

    FS9 :: Register(REG_FPR | 25)

    FT0 ¶

    FT0 :: Register(REG_FPR | 0)

    FT1 ¶

    FT1 :: Register(REG_FPR | 1)

    FT10 ¶

    FT10 :: Register(REG_FPR | 30)

    FT11 ¶

    FT11 :: Register(REG_FPR | 31)

    FT2 ¶

    FT2 :: Register(REG_FPR | 2)

    FT3 ¶

    FT3 :: Register(REG_FPR | 3)

    FT4 ¶

    FT4 :: Register(REG_FPR | 4)

    FT5 ¶

    FT5 :: Register(REG_FPR | 5)

    FT6 ¶

    FT6 :: Register(REG_FPR | 6)

    FT7 ¶

    FT7 :: Register(REG_FPR | 7)

    FT8 ¶

    FT8 :: Register(REG_FPR | 28)

    FT9 ¶

    FT9 :: Register(REG_FPR | 29)

    GP ¶

    GP :: Register(REG_GPR | 3)

    LABEL_UNDEFINED ¶

    LABEL_UNDEFINED: rexcode_isa.Label_Definition : isa.LABEL_UNDEFINED

    MASK_B ¶

    MASK_B: u32 : MASK_OPCODE | MASK_FUNCT3

    MASK_FUNCT3 ¶

    MASK_FUNCT3 :: u32(0x00007000)
     

    bits 14-12

    MASK_FUNCT7 ¶

    MASK_FUNCT7 :: u32(0xFE000000)
     

    bits 31-25

    MASK_I ¶

    MASK_I: u32 : MASK_OPCODE | MASK_FUNCT3

    MASK_IMM_I ¶

    MASK_IMM_I :: u32(0xFFF00000)
     

    bits 31-20

    MASK_I_SHIFT ¶

    MASK_I_SHIFT: u32 : MASK_OPCODE | MASK_FUNCT3 | (MASK_FUNCT7 &~ MASK_SHAMT6)
     

    ignore shamt

    MASK_J ¶

    MASK_J: u32 : MASK_OPCODE

    MASK_OPCODE ¶

    MASK_OPCODE :: u32(0x0000007F)
     

    Static field masks for handy reference in the table.

    MASK_R ¶

    MASK_R: u32 : MASK_OPCODE | MASK_FUNCT3 | MASK_FUNCT7
     

    Convenience composites

    MASK_RD ¶

    MASK_RD :: u32(0x00000F80)
     

    bits 11-7

    MASK_RS1 ¶

    MASK_RS1 :: u32(0x000F8000)
     

    bits 19-15

    MASK_RS2 ¶

    MASK_RS2 :: u32(0x01F00000)
     

    bits 24-20

    MASK_S ¶

    MASK_S: u32 : MASK_OPCODE | MASK_FUNCT3

    MASK_SHAMT5 ¶

    MASK_SHAMT5 :: u32(0x01F00000)
     

    bits 24-20

    MASK_SHAMT6 ¶

    MASK_SHAMT6 :: u32(0x03F00000)
     

    bits 25-20 (RV64)

    MASK_U ¶

    MASK_U: u32 : MASK_OPCODE

    MAX_INST_SIZE ¶

    MAX_INST_SIZE :: 4

    NONE ¶

    NONE :: Register(0xFFFF)

    RA ¶

    RA :: Register(REG_GPR | 1)

    REG_FPR ¶

    REG_FPR :: 0x0200
     

    f0..f31

    REG_GPR ¶

    REG_GPR :: 0x0100
     

    x0..x31

    REG_NONE ¶

    REG_NONE :: 0x0000

    S0 ¶

    S0 :: Register(REG_GPR | 8)

    S1 ¶

    S1 :: Register(REG_GPR | 9)

    S10 ¶

    S10 :: Register(REG_GPR | 26)

    S11 ¶

    S11 :: Register(REG_GPR | 27)

    S2 ¶

    S2 :: Register(REG_GPR | 18)

    S3 ¶

    S3 :: Register(REG_GPR | 19)

    S4 ¶

    S4 :: Register(REG_GPR | 20)

    S5 ¶

    S5 :: Register(REG_GPR | 21)

    S6 ¶

    S6 :: Register(REG_GPR | 22)

    S7 ¶

    S7 :: Register(REG_GPR | 23)

    S8 ¶

    S8 :: Register(REG_GPR | 24)

    S9 ¶

    S9 :: Register(REG_GPR | 25)

    SP ¶

    SP :: Register(REG_GPR | 2)

    T0 ¶

    T0 :: Register(REG_GPR | 5)

    T1 ¶

    T1 :: Register(REG_GPR | 6)

    T2 ¶

    T2 :: Register(REG_GPR | 7)

    T3 ¶

    T3 :: Register(REG_GPR | 28)

    T4 ¶

    T4 :: Register(REG_GPR | 29)

    T5 ¶

    T5 :: Register(REG_GPR | 30)

    T6 ¶

    T6 :: Register(REG_GPR | 31)

    TP ¶

    TP :: Register(REG_GPR | 4)

    ZERO ¶

    ZERO :: Register(REG_GPR | 0)

    Variables

    DECODE_ENTRIES ¶

    @(rodata)
    DECODE_ENTRIES: []Decode_Entry = …

    DECODE_INDEX_OPCODE ¶

    @(rodata)
    DECODE_INDEX_OPCODE: []Decode_Index = …

    DECODE_INDEX_OP_FP ¶

    @(rodata)
    DECODE_INDEX_OP_FP: []Decode_Index = …

    DECODE_INDEX_RVC ¶

    @(rodata)
    DECODE_INDEX_RVC: []Decode_Index = …

    ENCODE_FORMS ¶

    @(rodata)
    ENCODE_FORMS: []Encoding = …

    ENCODE_RUNS ¶

    @(rodata)
    ENCODE_RUNS: []Encode_Run = …

    Procedures

    aprint ¶

    aprint :: proc(
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    	allocator := context.allocator, 
    ) -> string {…}

    aprintln ¶

    aprintln :: proc(
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    	allocator := context.allocator, 
    ) -> string {…}

    bprint ¶

    bprint :: proc(
    	buf:          []u8, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) -> string {…}

    bprintln ¶

    bprintln :: proc(
    	buf:          []u8, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) -> string {…}

    decode ¶

    decode :: proc(
    	data:         []u8, 
    	relocs:       []Relocation, 
    	instructions: ^[dynamic]Instruction, 
    	inst_info:    ^[dynamic]Instruction_Info, 
    	label_defs:   ^[dynamic]rexcode_isa.Label_Definition, 
    	errors:       ^[dynamic]rexcode_isa.Error, 
    	xlen:         XLEN = .RV64, 
    ) -> (byte_count: u32, ok: bool) {…}

    decode_estimate_instruction_count ¶

    decode_estimate_instruction_count :: proc "contextless" (data: []u8) -> int {…}
     

    Typical-case estimate of the instruction count for data.

    decode_max_instruction_count ¶

    decode_max_instruction_count :: proc "contextless" (data: []u8) -> int {…}
     

    Instruction-count ceiling for data (base is 4 bytes, compressed (C) 2; minimum 2).

    decode_reserve ¶

    decode_reserve :: proc(instructions: ^[dynamic]Instruction, inst_info: ^[dynamic]Instruction_Info, label_defs: ^[dynamic]rexcode_isa.Label_Definition, data: []u8, exact: bool = false) {…}
     

    Pre-size the caller's decode output arrays for data (reserves on top of any existing elements; nil to skip; exact=true for the ceiling, else the estimate).

    emit_add_gpr_gpr_gpr ¶

    emit_add_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_addi_gpr_gpr_imm12 ¶

    emit_addi_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_addiw_gpr_gpr_imm12 ¶

    emit_addiw_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_addw_gpr_gpr_gpr ¶

    emit_addw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_amoadd_d_gpr_gpr_mem ¶

    emit_amoadd_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoadd_w_gpr_gpr_mem ¶

    emit_amoadd_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoand_d_gpr_gpr_mem ¶

    emit_amoand_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoand_w_gpr_gpr_mem ¶

    emit_amoand_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amomax_d_gpr_gpr_mem ¶

    emit_amomax_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amomax_w_gpr_gpr_mem ¶

    emit_amomax_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amomaxu_d_gpr_gpr_mem ¶

    emit_amomaxu_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amomaxu_w_gpr_gpr_mem ¶

    emit_amomaxu_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amomin_d_gpr_gpr_mem ¶

    emit_amomin_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amomin_w_gpr_gpr_mem ¶

    emit_amomin_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amominu_d_gpr_gpr_mem ¶

    emit_amominu_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amominu_w_gpr_gpr_mem ¶

    emit_amominu_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoor_d_gpr_gpr_mem ¶

    emit_amoor_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoor_w_gpr_gpr_mem ¶

    emit_amoor_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoswap_d_gpr_gpr_mem ¶

    emit_amoswap_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoswap_w_gpr_gpr_mem ¶

    emit_amoswap_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoxor_d_gpr_gpr_mem ¶

    emit_amoxor_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_amoxor_w_gpr_gpr_mem ¶

    emit_amoxor_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_and_gpr_gpr_gpr ¶

    emit_and_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_andi_gpr_gpr_imm12 ¶

    emit_andi_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_auipc_gpr_imm20 ¶

    emit_auipc_gpr_imm20 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_beq_gpr_gpr_label ¶

    emit_beq_gpr_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, label: u32) {…}

    emit_bge_gpr_gpr_label ¶

    emit_bge_gpr_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, label: u32) {…}

    emit_bgeu_gpr_gpr_label ¶

    emit_bgeu_gpr_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, label: u32) {…}

    emit_blt_gpr_gpr_label ¶

    emit_blt_gpr_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, label: u32) {…}

    emit_bltu_gpr_gpr_label ¶

    emit_bltu_gpr_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, label: u32) {…}

    emit_bne_gpr_gpr_label ¶

    emit_bne_gpr_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, label: u32) {…}

    emit_c_add_gpr_gpr ¶

    emit_c_add_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_c_addi16sp_gpr_imm10s ¶

    emit_c_addi16sp_gpr_imm10s :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_addi4spn_gpr_gpr_imm8u ¶

    emit_c_addi4spn_gpr_gpr_imm8u :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_c_addi_gpr_imm6s ¶

    emit_c_addi_gpr_imm6s :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_addiw_gpr_imm6s ¶

    emit_c_addiw_gpr_imm6s :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_addw_gpr_gpr ¶

    emit_c_addw_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_c_and_gpr_gpr ¶

    emit_c_and_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_c_andi_gpr_imm6s ¶

    emit_c_andi_gpr_imm6s :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_beqz_gpr_label ¶

    emit_c_beqz_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, label: u32) {…}

    emit_c_bnez_gpr_label ¶

    emit_c_bnez_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, label: u32) {…}

    emit_c_ebreak_none ¶

    emit_c_ebreak_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_c_fld_fpr_mem ¶

    emit_c_fld_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_c_fldsp_fpr_mem ¶

    emit_c_fldsp_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_c_fsd_fpr_mem ¶

    emit_c_fsd_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_c_fsdsp_fpr_mem ¶

    emit_c_fsdsp_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_c_j_label ¶

    emit_c_j_label :: proc(instructions: ^[dynamic]Instruction, label: u32) {…}

    emit_c_jal_label ¶

    emit_c_jal_label :: proc(instructions: ^[dynamic]Instruction, label: u32) {…}

    emit_c_jalr_gpr ¶

    emit_c_jalr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR) {…}

    emit_c_jr_gpr ¶

    emit_c_jr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR) {…}

    emit_c_ld_gpr_mem ¶

    emit_c_ld_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_ldsp_gpr_mem ¶

    emit_c_ldsp_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_li_gpr_imm6s ¶

    emit_c_li_gpr_imm6s :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_lui_gpr_imm18s ¶

    emit_c_lui_gpr_imm18s :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_lw_gpr_mem ¶

    emit_c_lw_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_lwsp_gpr_mem ¶

    emit_c_lwsp_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_mv_gpr_gpr ¶

    emit_c_mv_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_c_nop_none ¶

    emit_c_nop_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_c_or_gpr_gpr ¶

    emit_c_or_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_c_sd_gpr_mem ¶

    emit_c_sd_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_sdsp_gpr_mem ¶

    emit_c_sdsp_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_slli_gpr_imm6u ¶

    emit_c_slli_gpr_imm6u :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_srai_gpr_imm6u ¶

    emit_c_srai_gpr_imm6u :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_srli_gpr_imm6u ¶

    emit_c_srli_gpr_imm6u :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_c_sub_gpr_gpr ¶

    emit_c_sub_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_c_subw_gpr_gpr ¶

    emit_c_subw_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_c_sw_gpr_mem ¶

    emit_c_sw_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_swsp_gpr_mem ¶

    emit_c_swsp_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_c_xor_gpr_gpr ¶

    emit_c_xor_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR) {…}

    emit_csrrc_gpr_csr_gpr ¶

    emit_csrrc_gpr_csr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64, rs1: GPR) {…}

    emit_csrrci_gpr_csr_zimm5 ¶

    emit_csrrci_gpr_csr_zimm5 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64, imm2: i64) {…}

    emit_csrrs_gpr_csr_gpr ¶

    emit_csrrs_gpr_csr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64, rs1: GPR) {…}

    emit_csrrsi_gpr_csr_zimm5 ¶

    emit_csrrsi_gpr_csr_zimm5 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64, imm2: i64) {…}

    emit_csrrw_gpr_csr_gpr ¶

    emit_csrrw_gpr_csr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64, rs1: GPR) {…}

    emit_csrrwi_gpr_csr_zimm5 ¶

    emit_csrrwi_gpr_csr_zimm5 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64, imm2: i64) {…}

    emit_div_gpr_gpr_gpr ¶

    emit_div_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_divu_gpr_gpr_gpr ¶

    emit_divu_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_divuw_gpr_gpr_gpr ¶

    emit_divuw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_divw_gpr_gpr_gpr ¶

    emit_divw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_ebreak_none ¶

    emit_ebreak_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_ecall_none ¶

    emit_ecall_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_fadd_d_fpr_fpr_fpr ¶

    emit_fadd_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fadd_s_fpr_fpr_fpr ¶

    emit_fadd_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fclass_d_gpr_fpr ¶

    emit_fclass_d_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fclass_s_gpr_fpr ¶

    emit_fclass_s_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_d_l_fpr_gpr ¶

    emit_fcvt_d_l_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_d_lu_fpr_gpr ¶

    emit_fcvt_d_lu_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_d_s_fpr_fpr ¶

    emit_fcvt_d_s_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR) {…}

    emit_fcvt_d_w_fpr_gpr ¶

    emit_fcvt_d_w_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_d_wu_fpr_gpr ¶

    emit_fcvt_d_wu_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_l_d_gpr_fpr ¶

    emit_fcvt_l_d_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_l_s_gpr_fpr ¶

    emit_fcvt_l_s_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_lu_d_gpr_fpr ¶

    emit_fcvt_lu_d_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_lu_s_gpr_fpr ¶

    emit_fcvt_lu_s_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_s_d_fpr_fpr ¶

    emit_fcvt_s_d_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR) {…}

    emit_fcvt_s_l_fpr_gpr ¶

    emit_fcvt_s_l_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_s_lu_fpr_gpr ¶

    emit_fcvt_s_lu_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_s_w_fpr_gpr ¶

    emit_fcvt_s_w_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_s_wu_fpr_gpr ¶

    emit_fcvt_s_wu_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fcvt_w_d_gpr_fpr ¶

    emit_fcvt_w_d_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_w_s_gpr_fpr ¶

    emit_fcvt_w_s_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_wu_d_gpr_fpr ¶

    emit_fcvt_wu_d_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fcvt_wu_s_gpr_fpr ¶

    emit_fcvt_wu_s_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fdiv_d_fpr_fpr_fpr ¶

    emit_fdiv_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fdiv_s_fpr_fpr_fpr ¶

    emit_fdiv_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fence_fence_fence ¶

    emit_fence_fence_fence :: proc(instructions: ^[dynamic]Instruction, imm: i64, imm2: i64) {…}

    emit_fence_i_none ¶

    emit_fence_i_none :: proc(instructions: ^[dynamic]Instruction) {…}

    emit_feq_d_gpr_fpr_fpr ¶

    emit_feq_d_gpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR, rs2: FPR) {…}

    emit_feq_s_gpr_fpr_fpr ¶

    emit_feq_s_gpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR, rs2: FPR) {…}

    emit_fld_fpr_mem ¶

    emit_fld_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_fle_d_gpr_fpr_fpr ¶

    emit_fle_d_gpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR, rs2: FPR) {…}

    emit_fle_s_gpr_fpr_fpr ¶

    emit_fle_s_gpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR, rs2: FPR) {…}

    emit_flt_d_gpr_fpr_fpr ¶

    emit_flt_d_gpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR, rs2: FPR) {…}

    emit_flt_s_gpr_fpr_fpr ¶

    emit_flt_s_gpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR, rs2: FPR) {…}

    emit_flw_fpr_mem ¶

    emit_flw_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_fmadd_d_fpr_fpr_fpr_fpr ¶

    emit_fmadd_d_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fmadd_s_fpr_fpr_fpr_fpr ¶

    emit_fmadd_s_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fmax_d_fpr_fpr_fpr ¶

    emit_fmax_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fmax_s_fpr_fpr_fpr ¶

    emit_fmax_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fmin_d_fpr_fpr_fpr ¶

    emit_fmin_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fmin_s_fpr_fpr_fpr ¶

    emit_fmin_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fmsub_d_fpr_fpr_fpr_fpr ¶

    emit_fmsub_d_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fmsub_s_fpr_fpr_fpr_fpr ¶

    emit_fmsub_s_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fmul_d_fpr_fpr_fpr ¶

    emit_fmul_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fmul_s_fpr_fpr_fpr ¶

    emit_fmul_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fmv_d_x_fpr_gpr ¶

    emit_fmv_d_x_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fmv_w_x_fpr_gpr ¶

    emit_fmv_w_x_fpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: GPR) {…}

    emit_fmv_x_d_gpr_fpr ¶

    emit_fmv_x_d_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fmv_x_w_gpr_fpr ¶

    emit_fmv_x_w_gpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: FPR) {…}

    emit_fnmadd_d_fpr_fpr_fpr_fpr ¶

    emit_fnmadd_d_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fnmadd_s_fpr_fpr_fpr_fpr ¶

    emit_fnmadd_s_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fnmsub_d_fpr_fpr_fpr_fpr ¶

    emit_fnmsub_d_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fnmsub_s_fpr_fpr_fpr_fpr ¶

    emit_fnmsub_s_fpr_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) {…}

    emit_fsd_fpr_mem ¶

    emit_fsd_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_fsgnj_d_fpr_fpr_fpr ¶

    emit_fsgnj_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsgnj_s_fpr_fpr_fpr ¶

    emit_fsgnj_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsgnjn_d_fpr_fpr_fpr ¶

    emit_fsgnjn_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsgnjn_s_fpr_fpr_fpr ¶

    emit_fsgnjn_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsgnjx_d_fpr_fpr_fpr ¶

    emit_fsgnjx_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsgnjx_s_fpr_fpr_fpr ¶

    emit_fsgnjx_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsqrt_d_fpr_fpr ¶

    emit_fsqrt_d_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR) {…}

    emit_fsqrt_s_fpr_fpr ¶

    emit_fsqrt_s_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR) {…}

    emit_fsub_d_fpr_fpr_fpr ¶

    emit_fsub_d_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsub_s_fpr_fpr_fpr ¶

    emit_fsub_s_fpr_fpr_fpr :: proc(instructions: ^[dynamic]Instruction, rd: FPR, rs1: FPR, rs2: FPR) {…}

    emit_fsw_fpr_mem ¶

    emit_fsw_fpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: FPR, mem: Memory) {…}

    emit_jal_gpr_label ¶

    emit_jal_gpr_label :: proc(instructions: ^[dynamic]Instruction, rd: GPR, label: u32) {…}

    emit_jalr_gpr_gpr_imm12 ¶

    emit_jalr_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_lb_gpr_mem ¶

    emit_lb_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_lbu_gpr_mem ¶

    emit_lbu_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_ld_gpr_mem ¶

    emit_ld_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_lh_gpr_mem ¶

    emit_lh_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_lhu_gpr_mem ¶

    emit_lhu_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_lr_d_gpr_mem ¶

    emit_lr_d_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_lr_w_gpr_mem ¶

    emit_lr_w_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_lui_gpr_imm20 ¶

    emit_lui_gpr_imm20 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, imm: i64) {…}

    emit_lw_gpr_mem ¶

    emit_lw_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_lwu_gpr_mem ¶

    emit_lwu_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_mul_gpr_gpr_gpr ¶

    emit_mul_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_mulh_gpr_gpr_gpr ¶

    emit_mulh_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_mulhsu_gpr_gpr_gpr ¶

    emit_mulhsu_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_mulhu_gpr_gpr_gpr ¶

    emit_mulhu_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_mulw_gpr_gpr_gpr ¶

    emit_mulw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_or_gpr_gpr_gpr ¶

    emit_or_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_ori_gpr_gpr_imm12 ¶

    emit_ori_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_rem_gpr_gpr_gpr ¶

    emit_rem_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_remu_gpr_gpr_gpr ¶

    emit_remu_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_remuw_gpr_gpr_gpr ¶

    emit_remuw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_remw_gpr_gpr_gpr ¶

    emit_remw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_sb_gpr_mem ¶

    emit_sb_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_sc_d_gpr_gpr_mem ¶

    emit_sc_d_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_sc_w_gpr_gpr_mem ¶

    emit_sc_w_gpr_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, mem: Memory) {…}

    emit_sd_gpr_mem ¶

    emit_sd_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_sh_gpr_mem ¶

    emit_sh_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_sll_gpr_gpr_gpr ¶

    emit_sll_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_slli_gpr_gpr_imm6 ¶

    emit_slli_gpr_gpr_imm6 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_slliw_gpr_gpr_imm5 ¶

    emit_slliw_gpr_gpr_imm5 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_sllw_gpr_gpr_gpr ¶

    emit_sllw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_slt_gpr_gpr_gpr ¶

    emit_slt_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_slti_gpr_gpr_imm12 ¶

    emit_slti_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_sltiu_gpr_gpr_imm12 ¶

    emit_sltiu_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_sltu_gpr_gpr_gpr ¶

    emit_sltu_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_sra_gpr_gpr_gpr ¶

    emit_sra_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_srai_gpr_gpr_imm6 ¶

    emit_srai_gpr_gpr_imm6 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_sraiw_gpr_gpr_imm5 ¶

    emit_sraiw_gpr_gpr_imm5 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_sraw_gpr_gpr_gpr ¶

    emit_sraw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_srl_gpr_gpr_gpr ¶

    emit_srl_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_srli_gpr_gpr_imm6 ¶

    emit_srli_gpr_gpr_imm6 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_srliw_gpr_gpr_imm5 ¶

    emit_srliw_gpr_gpr_imm5 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    emit_srlw_gpr_gpr_gpr ¶

    emit_srlw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_sub_gpr_gpr_gpr ¶

    emit_sub_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_subw_gpr_gpr_gpr ¶

    emit_subw_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_sw_gpr_mem ¶

    emit_sw_gpr_mem :: proc(instructions: ^[dynamic]Instruction, rd: GPR, mem: Memory) {…}

    emit_xor_gpr_gpr_gpr ¶

    emit_xor_gpr_gpr_gpr :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, rs2: GPR) {…}

    emit_xori_gpr_gpr_imm12 ¶

    emit_xori_gpr_gpr_imm12 :: proc(instructions: ^[dynamic]Instruction, rd: GPR, rs1: GPR, imm: i64) {…}

    encode ¶

    encode :: proc(
    	instructions: []Instruction, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	code:         []u8, 
    	relocs:       ^[dynamic]Relocation, 
    	errors:       ^[dynamic]rexcode_isa.Error, 
    	resolve:      bool = true, 
    	base_address: u64 = 0, 
    ) -> (byte_count: u32, ok: bool) {…}

    encode_max_code_size ¶

    encode_max_code_size :: proc "contextless" (instructions: []Instruction) -> int {…}

    encode_max_relocation_count ¶

    encode_max_relocation_count :: proc "contextless" (instructions: []Instruction) -> int {…}

    encode_reserve ¶

    encode_reserve :: proc(code: ^[dynamic]u8, relocs: ^[dynamic]Relocation, instructions: []Instruction) {…}
     

    Pre-size the caller's encode outputs (code grown by length so code[:] is a valid emit target; relocs reserved by capacity) so the encode hot path never reallocates. Allocates no new buffers; pass nil to skip either array.

    fpr_from_num ¶

    fpr_from_num :: proc "contextless" (n: u8) -> Register {…}

    fprint ¶

    fprint :: proc(
    	fd:           ^os.File, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    fprintln ¶

    fprintln :: proc(
    	fd:           ^os.File, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    gpr_from_num ¶

    gpr_from_num :: proc "contextless" (n: u8) -> Register {…}

    inst_add_gpr_gpr_gpr ¶

    inst_add_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_addi_gpr_gpr_imm12 ¶

    inst_addi_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_addiw_gpr_gpr_imm12 ¶

    inst_addiw_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_addw_gpr_gpr_gpr ¶

    inst_addw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_amoadd_d_gpr_gpr_mem ¶

    inst_amoadd_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoadd_w_gpr_gpr_mem ¶

    inst_amoadd_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoand_d_gpr_gpr_mem ¶

    inst_amoand_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoand_w_gpr_gpr_mem ¶

    inst_amoand_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amomax_d_gpr_gpr_mem ¶

    inst_amomax_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amomax_w_gpr_gpr_mem ¶

    inst_amomax_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amomaxu_d_gpr_gpr_mem ¶

    inst_amomaxu_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amomaxu_w_gpr_gpr_mem ¶

    inst_amomaxu_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amomin_d_gpr_gpr_mem ¶

    inst_amomin_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amomin_w_gpr_gpr_mem ¶

    inst_amomin_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amominu_d_gpr_gpr_mem ¶

    inst_amominu_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amominu_w_gpr_gpr_mem ¶

    inst_amominu_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoor_d_gpr_gpr_mem ¶

    inst_amoor_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoor_w_gpr_gpr_mem ¶

    inst_amoor_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoswap_d_gpr_gpr_mem ¶

    inst_amoswap_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoswap_w_gpr_gpr_mem ¶

    inst_amoswap_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoxor_d_gpr_gpr_mem ¶

    inst_amoxor_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_amoxor_w_gpr_gpr_mem ¶

    inst_amoxor_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_and_gpr_gpr_gpr ¶

    inst_and_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_andi_gpr_gpr_imm12 ¶

    inst_andi_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_auipc_gpr_imm20 ¶

    inst_auipc_gpr_imm20 :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_beq_gpr_gpr_label ¶

    inst_beq_gpr_gpr_label :: proc "contextless" (rd: GPR, rs1: GPR, label: u32) -> Instruction {…}

    inst_bge_gpr_gpr_label ¶

    inst_bge_gpr_gpr_label :: proc "contextless" (rd: GPR, rs1: GPR, label: u32) -> Instruction {…}

    inst_bgeu_gpr_gpr_label ¶

    inst_bgeu_gpr_gpr_label :: proc "contextless" (rd: GPR, rs1: GPR, label: u32) -> Instruction {…}

    inst_blt_gpr_gpr_label ¶

    inst_blt_gpr_gpr_label :: proc "contextless" (rd: GPR, rs1: GPR, label: u32) -> Instruction {…}

    inst_bltu_gpr_gpr_label ¶

    inst_bltu_gpr_gpr_label :: proc "contextless" (rd: GPR, rs1: GPR, label: u32) -> Instruction {…}

    inst_bne_gpr_gpr_label ¶

    inst_bne_gpr_gpr_label :: proc "contextless" (rd: GPR, rs1: GPR, label: u32) -> Instruction {…}

    inst_branch ¶

    inst_branch :: proc "contextless" (m: Mnemonic, rs1, rs2: Register, label_id: u32) -> Instruction {…}
     

    B-type branch: rs1, rs2, label

    inst_c_add_gpr_gpr ¶

    inst_c_add_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_c_addi16sp_gpr_imm10s ¶

    inst_c_addi16sp_gpr_imm10s :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_addi4spn_gpr_gpr_imm8u ¶

    inst_c_addi4spn_gpr_gpr_imm8u :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_c_addi_gpr_imm6s ¶

    inst_c_addi_gpr_imm6s :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_addiw_gpr_imm6s ¶

    inst_c_addiw_gpr_imm6s :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_addw_gpr_gpr ¶

    inst_c_addw_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_c_and_gpr_gpr ¶

    inst_c_and_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_c_andi_gpr_imm6s ¶

    inst_c_andi_gpr_imm6s :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_beqz_gpr_label ¶

    inst_c_beqz_gpr_label :: proc "contextless" (rd: GPR, label: u32) -> Instruction {…}

    inst_c_bnez_gpr_label ¶

    inst_c_bnez_gpr_label :: proc "contextless" (rd: GPR, label: u32) -> Instruction {…}

    inst_c_ebreak_none ¶

    inst_c_ebreak_none :: proc "contextless" () -> Instruction {…}

    inst_c_fld_fpr_mem ¶

    inst_c_fld_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_c_fldsp_fpr_mem ¶

    inst_c_fldsp_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_c_fsd_fpr_mem ¶

    inst_c_fsd_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_c_fsdsp_fpr_mem ¶

    inst_c_fsdsp_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_c_j_label ¶

    inst_c_j_label :: proc "contextless" (label: u32) -> Instruction {…}

    inst_c_jal_label ¶

    inst_c_jal_label :: proc "contextless" (label: u32) -> Instruction {…}

    inst_c_jalr_gpr ¶

    inst_c_jalr_gpr :: proc "contextless" (rd: GPR) -> Instruction {…}

    inst_c_jr_gpr ¶

    inst_c_jr_gpr :: proc "contextless" (rd: GPR) -> Instruction {…}

    inst_c_ld_gpr_mem ¶

    inst_c_ld_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_ldsp_gpr_mem ¶

    inst_c_ldsp_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_li_gpr_imm6s ¶

    inst_c_li_gpr_imm6s :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_lui_gpr_imm18s ¶

    inst_c_lui_gpr_imm18s :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_lw_gpr_mem ¶

    inst_c_lw_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_lwsp_gpr_mem ¶

    inst_c_lwsp_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_mv_gpr_gpr ¶

    inst_c_mv_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_c_nop_none ¶

    inst_c_nop_none :: proc "contextless" () -> Instruction {…}

    inst_c_or_gpr_gpr ¶

    inst_c_or_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_c_sd_gpr_mem ¶

    inst_c_sd_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_sdsp_gpr_mem ¶

    inst_c_sdsp_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_slli_gpr_imm6u ¶

    inst_c_slli_gpr_imm6u :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_srai_gpr_imm6u ¶

    inst_c_srai_gpr_imm6u :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_srli_gpr_imm6u ¶

    inst_c_srli_gpr_imm6u :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_c_sub_gpr_gpr ¶

    inst_c_sub_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_c_subw_gpr_gpr ¶

    inst_c_subw_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_c_sw_gpr_mem ¶

    inst_c_sw_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_swsp_gpr_mem ¶

    inst_c_swsp_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_c_xor_gpr_gpr ¶

    inst_c_xor_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR) -> Instruction {…}

    inst_csr ¶

    inst_csr :: proc "contextless" (m: Mnemonic, rd: Register, csr: u16, rs1: Register) -> Instruction {…}
     

    CSR ops: rd, csr, rs1

    inst_csr_i ¶

    inst_csr_i :: proc "contextless" (m: Mnemonic, rd: Register, csr: u16, zimm5: u8) -> Instruction {…}
     

    CSR immediate ops: rd, csr, zimm5

    inst_csrrc_gpr_csr_gpr ¶

    inst_csrrc_gpr_csr_gpr :: proc "contextless" (rd: GPR, imm: i64, rs1: GPR) -> Instruction {…}

    inst_csrrci_gpr_csr_zimm5 ¶

    inst_csrrci_gpr_csr_zimm5 :: proc "contextless" (rd: GPR, imm: i64, imm2: i64) -> Instruction {…}

    inst_csrrs_gpr_csr_gpr ¶

    inst_csrrs_gpr_csr_gpr :: proc "contextless" (rd: GPR, imm: i64, rs1: GPR) -> Instruction {…}

    inst_csrrsi_gpr_csr_zimm5 ¶

    inst_csrrsi_gpr_csr_zimm5 :: proc "contextless" (rd: GPR, imm: i64, imm2: i64) -> Instruction {…}

    inst_csrrw_gpr_csr_gpr ¶

    inst_csrrw_gpr_csr_gpr :: proc "contextless" (rd: GPR, imm: i64, rs1: GPR) -> Instruction {…}

    inst_csrrwi_gpr_csr_zimm5 ¶

    inst_csrrwi_gpr_csr_zimm5 :: proc "contextless" (rd: GPR, imm: i64, imm2: i64) -> Instruction {…}

    inst_div_gpr_gpr_gpr ¶

    inst_div_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_divu_gpr_gpr_gpr ¶

    inst_divu_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_divuw_gpr_gpr_gpr ¶

    inst_divuw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_divw_gpr_gpr_gpr ¶

    inst_divw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_ebreak_none ¶

    inst_ebreak_none :: proc "contextless" () -> Instruction {…}

    inst_ecall_none ¶

    inst_ecall_none :: proc "contextless" () -> Instruction {…}

    inst_fadd_d_fpr_fpr_fpr ¶

    inst_fadd_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fadd_s_fpr_fpr_fpr ¶

    inst_fadd_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fclass_d_gpr_fpr ¶

    inst_fclass_d_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fclass_s_gpr_fpr ¶

    inst_fclass_s_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_d_l_fpr_gpr ¶

    inst_fcvt_d_l_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_d_lu_fpr_gpr ¶

    inst_fcvt_d_lu_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_d_s_fpr_fpr ¶

    inst_fcvt_d_s_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_d_w_fpr_gpr ¶

    inst_fcvt_d_w_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_d_wu_fpr_gpr ¶

    inst_fcvt_d_wu_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_l_d_gpr_fpr ¶

    inst_fcvt_l_d_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_l_s_gpr_fpr ¶

    inst_fcvt_l_s_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_lu_d_gpr_fpr ¶

    inst_fcvt_lu_d_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_lu_s_gpr_fpr ¶

    inst_fcvt_lu_s_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_s_d_fpr_fpr ¶

    inst_fcvt_s_d_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_s_l_fpr_gpr ¶

    inst_fcvt_s_l_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_s_lu_fpr_gpr ¶

    inst_fcvt_s_lu_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_s_w_fpr_gpr ¶

    inst_fcvt_s_w_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_s_wu_fpr_gpr ¶

    inst_fcvt_s_wu_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fcvt_w_d_gpr_fpr ¶

    inst_fcvt_w_d_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_w_s_gpr_fpr ¶

    inst_fcvt_w_s_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_wu_d_gpr_fpr ¶

    inst_fcvt_wu_d_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fcvt_wu_s_gpr_fpr ¶

    inst_fcvt_wu_s_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fdiv_d_fpr_fpr_fpr ¶

    inst_fdiv_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fdiv_s_fpr_fpr_fpr ¶

    inst_fdiv_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fence_fence_fence ¶

    inst_fence_fence_fence :: proc "contextless" (imm: i64, imm2: i64) -> Instruction {…}

    inst_fence_i_none ¶

    inst_fence_i_none :: proc "contextless" () -> Instruction {…}

    inst_feq_d_gpr_fpr_fpr ¶

    inst_feq_d_gpr_fpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_feq_s_gpr_fpr_fpr ¶

    inst_feq_s_gpr_fpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fld_fpr_mem ¶

    inst_fld_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_fle_d_gpr_fpr_fpr ¶

    inst_fle_d_gpr_fpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fle_s_gpr_fpr_fpr ¶

    inst_fle_s_gpr_fpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_flt_d_gpr_fpr_fpr ¶

    inst_flt_d_gpr_fpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_flt_s_gpr_fpr_fpr ¶

    inst_flt_s_gpr_fpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_flw_fpr_mem ¶

    inst_flw_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_fmadd_d_fpr_fpr_fpr_fpr ¶

    inst_fmadd_d_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fmadd_s_fpr_fpr_fpr_fpr ¶

    inst_fmadd_s_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fmax_d_fpr_fpr_fpr ¶

    inst_fmax_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fmax_s_fpr_fpr_fpr ¶

    inst_fmax_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fmin_d_fpr_fpr_fpr ¶

    inst_fmin_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fmin_s_fpr_fpr_fpr ¶

    inst_fmin_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fmsub_d_fpr_fpr_fpr_fpr ¶

    inst_fmsub_d_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fmsub_s_fpr_fpr_fpr_fpr ¶

    inst_fmsub_s_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fmul_d_fpr_fpr_fpr ¶

    inst_fmul_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fmul_s_fpr_fpr_fpr ¶

    inst_fmul_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fmv_d_x_fpr_gpr ¶

    inst_fmv_d_x_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fmv_w_x_fpr_gpr ¶

    inst_fmv_w_x_fpr_gpr :: proc "contextless" (rd: FPR, rs1: GPR) -> Instruction {…}

    inst_fmv_x_d_gpr_fpr ¶

    inst_fmv_x_d_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fmv_x_w_gpr_fpr ¶

    inst_fmv_x_w_gpr_fpr :: proc "contextless" (rd: GPR, rs1: FPR) -> Instruction {…}

    inst_fnmadd_d_fpr_fpr_fpr_fpr ¶

    inst_fnmadd_d_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fnmadd_s_fpr_fpr_fpr_fpr ¶

    inst_fnmadd_s_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fnmsub_d_fpr_fpr_fpr_fpr ¶

    inst_fnmsub_d_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fnmsub_s_fpr_fpr_fpr_fpr ¶

    inst_fnmsub_s_fpr_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR, rs3: FPR) -> Instruction {…}

    inst_fsd_fpr_mem ¶

    inst_fsd_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_fsgnj_d_fpr_fpr_fpr ¶

    inst_fsgnj_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsgnj_s_fpr_fpr_fpr ¶

    inst_fsgnj_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsgnjn_d_fpr_fpr_fpr ¶

    inst_fsgnjn_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsgnjn_s_fpr_fpr_fpr ¶

    inst_fsgnjn_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsgnjx_d_fpr_fpr_fpr ¶

    inst_fsgnjx_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsgnjx_s_fpr_fpr_fpr ¶

    inst_fsgnjx_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsqrt_d_fpr_fpr ¶

    inst_fsqrt_d_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR) -> Instruction {…}

    inst_fsqrt_s_fpr_fpr ¶

    inst_fsqrt_s_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR) -> Instruction {…}

    inst_fsub_d_fpr_fpr_fpr ¶

    inst_fsub_d_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsub_s_fpr_fpr_fpr ¶

    inst_fsub_s_fpr_fpr_fpr :: proc "contextless" (rd: FPR, rs1: FPR, rs2: FPR) -> Instruction {…}

    inst_fsw_fpr_mem ¶

    inst_fsw_fpr_mem :: proc "contextless" (rd: FPR, mem: Memory) -> Instruction {…}

    inst_jal_gpr_label ¶

    inst_jal_gpr_label :: proc "contextless" (rd: GPR, label: u32) -> Instruction {…}

    inst_jalr_gpr_gpr_imm12 ¶

    inst_jalr_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_lb_gpr_mem ¶

    inst_lb_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_lbu_gpr_mem ¶

    inst_lbu_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_ld_gpr_mem ¶

    inst_ld_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_lh_gpr_mem ¶

    inst_lh_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_lhu_gpr_mem ¶

    inst_lhu_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_load ¶

    inst_load :: proc "contextless" (m: Mnemonic, rd: Register, mm: Memory) -> Instruction {…}
     

    I-type load: rd, disp(base)

    inst_lr_d_gpr_mem ¶

    inst_lr_d_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_lr_w_gpr_mem ¶

    inst_lr_w_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_lui_gpr_imm20 ¶

    inst_lui_gpr_imm20 :: proc "contextless" (rd: GPR, imm: i64) -> Instruction {…}

    inst_lw_gpr_mem ¶

    inst_lw_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_lwu_gpr_mem ¶

    inst_lwu_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_mul_gpr_gpr_gpr ¶

    inst_mul_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_mulh_gpr_gpr_gpr ¶

    inst_mulh_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_mulhsu_gpr_gpr_gpr ¶

    inst_mulhsu_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_mulhu_gpr_gpr_gpr ¶

    inst_mulhu_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_mulw_gpr_gpr_gpr ¶

    inst_mulw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_none ¶

    inst_none :: proc "contextless" (m: Mnemonic) -> Instruction {…}

    inst_or_gpr_gpr_gpr ¶

    inst_or_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_ori_gpr_gpr_imm12 ¶

    inst_ori_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_r4 ¶

    inst_r4 :: proc "contextless" (m: Mnemonic, rd, rs1, rs2, rs3: Register) -> Instruction {…}
     

    FP R4-type: rd, rs1, rs2, rs3 (FMADD/FMSUB/FNMADD/FNMSUB)

    inst_r_r ¶

    inst_r_r :: proc "contextless" (m: Mnemonic, rd, rs1: Register) -> Instruction {…}
     

    FP R-type with 2 regs: rd, rs1 (FSQRT, FCVT, FMV, FCLASS, ...)

    inst_r_r_i ¶

    inst_r_r_i :: proc "contextless" (m: Mnemonic, rd, rs1: Register, imm: i64) -> Instruction {…}
     

    I-type (ALU): rd, rs1, imm12

    inst_r_r_r ¶

    inst_r_r_r :: proc "contextless" (m: Mnemonic, rd, rs1, rs2: Register) -> Instruction {…}
     

    R-type: rd, rs1, rs2

    inst_rem_gpr_gpr_gpr ¶

    inst_rem_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_remu_gpr_gpr_gpr ¶

    inst_remu_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_remuw_gpr_gpr_gpr ¶

    inst_remuw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_remw_gpr_gpr_gpr ¶

    inst_remw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_sb_gpr_mem ¶

    inst_sb_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_sc_d_gpr_gpr_mem ¶

    inst_sc_d_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_sc_w_gpr_gpr_mem ¶

    inst_sc_w_gpr_gpr_mem :: proc "contextless" (rd: GPR, rs1: GPR, mem: Memory) -> Instruction {…}

    inst_sd_gpr_mem ¶

    inst_sd_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_sh_gpr_mem ¶

    inst_sh_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_shift ¶

    inst_shift :: proc "contextless" (m: Mnemonic, rd, rs1: Register, shamt: u8) -> Instruction {…}
     

    I-type (shift): rd, rs1, shamt

    inst_size_from_bits ¶

    inst_size_from_bits :: proc "contextless" (bits: u32) -> u8 {…}
     

    inst_size_from_bits returns 2 for compressed (RVC) instructions, 4 for the standard 32-bit base ISA. RISC-V uses a length-encoding convention where the low 2 bits of the first halfword identify the instruction length: 11 = 32-bit (the standard base ISA), anything else = 16-bit (compressed).

    inst_sll_gpr_gpr_gpr ¶

    inst_sll_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_slli_gpr_gpr_imm6 ¶

    inst_slli_gpr_gpr_imm6 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_slliw_gpr_gpr_imm5 ¶

    inst_slliw_gpr_gpr_imm5 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_sllw_gpr_gpr_gpr ¶

    inst_sllw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_slt_gpr_gpr_gpr ¶

    inst_slt_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_slti_gpr_gpr_imm12 ¶

    inst_slti_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_sltiu_gpr_gpr_imm12 ¶

    inst_sltiu_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_sltu_gpr_gpr_gpr ¶

    inst_sltu_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_sra_gpr_gpr_gpr ¶

    inst_sra_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_srai_gpr_gpr_imm6 ¶

    inst_srai_gpr_gpr_imm6 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_sraiw_gpr_gpr_imm5 ¶

    inst_sraiw_gpr_gpr_imm5 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_sraw_gpr_gpr_gpr ¶

    inst_sraw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_srl_gpr_gpr_gpr ¶

    inst_srl_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_srli_gpr_gpr_imm6 ¶

    inst_srli_gpr_gpr_imm6 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_srliw_gpr_gpr_imm5 ¶

    inst_srliw_gpr_gpr_imm5 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    inst_srlw_gpr_gpr_gpr ¶

    inst_srlw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_store ¶

    inst_store :: proc "contextless" (m: Mnemonic, rs2: Register, mm: Memory) -> Instruction {…}
     

    S-type store: rs2 (data), disp(base)

    inst_sub_gpr_gpr_gpr ¶

    inst_sub_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_subw_gpr_gpr_gpr ¶

    inst_subw_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_sw_gpr_mem ¶

    inst_sw_gpr_mem :: proc "contextless" (rd: GPR, mem: Memory) -> Instruction {…}

    inst_u ¶

    inst_u :: proc "contextless" (m: Mnemonic, rd: Register, imm: i64) -> Instruction {…}
     

    U-type: rd, imm20

    inst_xor_gpr_gpr_gpr ¶

    inst_xor_gpr_gpr_gpr :: proc "contextless" (rd: GPR, rs1: GPR, rs2: GPR) -> Instruction {…}

    inst_xori_gpr_gpr_imm12 ¶

    inst_xori_gpr_gpr_imm12 :: proc "contextless" (rd: GPR, rs1: GPR, imm: i64) -> Instruction {…}

    mem ¶

    mem :: proc "contextless" (base: Register, disp: i32) -> Memory {…}

    mnemonic_to_string ¶

    mnemonic_to_string :: proc(m: Mnemonic, lowercase: bool = true, allocator := context.temp_allocator) -> string {…}

    op_fpr ¶

    op_fpr :: proc "contextless" (f: FPR) -> Operand {…}

    op_gpr ¶

    op_gpr :: proc "contextless" (g: GPR) -> Operand {…}
     

    Typed constructors

    op_imm ¶

    op_imm :: proc "contextless" (v: i64, size: u8) -> Operand {…}

    op_label ¶

    op_label :: proc "contextless" (label_id: u32, size: u8 = 2) -> Operand {…}

    op_mem ¶

    op_mem :: proc "contextless" (m: Memory) -> Operand {…}

    op_reg ¶

    op_reg :: proc "contextless" (r: Register) -> Operand {…}

    op_rel_offset ¶

    op_rel_offset :: proc "contextless" (off: i64) -> Operand {…}

    print ¶

    print :: proc(
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    println ¶

    println :: proc(
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    reg_class ¶

    reg_class :: proc "contextless" (r: Register) -> u16 {…}

    reg_hw ¶

    reg_hw :: proc "contextless" (r: Register) -> u8 {…}

    reg_is_fpr ¶

    reg_is_fpr :: proc "contextless" (r: Register) -> bool {…}

    reg_is_gpr ¶

    reg_is_gpr :: proc "contextless" (r: Register) -> bool {…}

    register_name ¶

    register_name :: proc(r: Register, lowercase: bool = true, allocator := context.temp_allocator) -> string {…}

    sbprint ¶

    sbprint :: proc(
    	sb:           ^strings.Builder, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    sbprintln ¶

    sbprintln :: proc(
    	sb:           ^strings.Builder, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    tprint ¶

    tprint :: proc(
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) -> string {…}

    tprintln ¶

    tprintln :: proc(
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) -> string {…}

    wprint ¶

    wprint :: proc(
    	w:            io.Stream, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    wprintln ¶

    wprintln :: proc(
    	w:            io.Stream, 
    	instructions: []Instruction, 
    	inst_info:    []Instruction_Info, 
    	label_defs:   []rexcode_isa.Label_Definition, 
    	tokens:       ^[dynamic]rexcode_isa.Token = nil, 
    	options:      ^rexcode_isa.Print_Options = nil, 
    	label_names:  ^map[u32]string = nil, 
    ) {…}

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2026-07 (vendor "odin") Windows_amd64 @ 2026-07-20 21:55:41.506051800 +0000 UTC