enum Extended [src]

Rarer instructions are here; ones that do not fit in the 8-bit Tag enum. noreturn instructions may not go here; they must be part of the main Tag enum.

Fields

struct_declA struct type definition. Contains references to ZIR instructions for the field types, defaults, and alignments. operand is payload index to StructDecl. small is StructDecl.Small.
enum_declAn enum type definition. Contains references to ZIR instructions for the field value expressions and optional type tag expression. operand is payload index to EnumDecl. small is EnumDecl.Small.
union_declA union type definition. Contains references to ZIR instructions for the field types and optional type tag expression. operand is payload index to UnionDecl. small is UnionDecl.Small.
opaque_declAn opaque type definition. Contains references to decls and captures. operand is payload index to OpaqueDecl. small is OpaqueDecl.Small.
tuple_declA tuple type. Note that tuples are not namespace/container types. operand is payload index to TupleDecl. small is fields_len: u16.
thisImplements the @This builtin. operand is src_node: Ast.Node.Offset.
ret_addrImplements the @returnAddress builtin. operand is src_node: Ast.Node.Offset.
builtin_srcImplements the @src builtin. operand is payload index to LineColumn.
error_return_traceImplements the @errorReturnTrace builtin. operand is src_node: Ast.Node.Offset.
frameImplements the @frame builtin. operand is src_node: Ast.Node.Offset.
frame_addressImplements the @frameAddress builtin. operand is src_node: Ast.Node.Offset.
allocSame as alloc from Tag but may contain an alignment instruction. operand is payload index to AllocExtended. small: 0b000X - has type 0b00X0 - has alignment 0b0X00 - 1=const, 0=var 0bX000 - is comptime
builtin_externThe @extern builtin. operand is payload index to BinNode.
@"asm"Inline assembly. small: 0b00000000_000XXXXX - outputs_len. 0b000000XX_XXX00000 - inputs_len. 0b0XXXXX00_00000000 - clobbers_len. 0bX0000000_00000000 - is volatile operand is payload index to Asm.
asm_exprSame as asm except the assembly template is not a string literal but a comptime expression. The asm_source field of the Asm is not a null-terminated string but instead a Ref.
compile_logLog compile time variables and emit an error message. operand is payload index to NodeMultiOp. small is operands_len. The AST node is the compile log builtin call.
typeof_peerThe builtin @TypeOf which returns the type after Peer Type Resolution of one or more params. operand is payload index to TypeOfPeer. small is operands_len. The AST node is the builtin call.
min_multiImplements the @min builtin for more than 2 args. operand is payload index to NodeMultiOp. small is operands_len. The AST node is the builtin call.
max_multiImplements the @max builtin for more than 2 args. operand is payload index to NodeMultiOp. small is operands_len. The AST node is the builtin call.
add_with_overflowImplements the @addWithOverflow builtin. operand is payload index to BinNode. small is unused.
sub_with_overflowImplements the @subWithOverflow builtin. operand is payload index to BinNode. small is unused.
mul_with_overflowImplements the @mulWithOverflow builtin. operand is payload index to BinNode. small is unused.
shl_with_overflowImplements the @shlWithOverflow builtin. operand is payload index to BinNode. small is unused.
c_undefoperand is payload index to UnNode.
c_includeoperand is payload index to UnNode.
c_defineoperand is payload index to BinNode.
wasm_memory_sizeoperand is payload index to UnNode.
wasm_memory_growoperand is payload index to BinNode.
prefetchThe @prefetch builtin. operand is payload index to BinNode.
set_float_modeImplement builtin @setFloatMode. operand is payload index to UnNode.
error_castImplements the @errorCast builtin. operand is payload index to BinNode. lhs is dest type, rhs is operand.
await_nosuspendoperand is payload index to UnNode.
breakpointImplements @breakpoint. operand is src_node: Ast.Node.Offset.
disable_instrumentationImplement builtin @disableInstrumentation. operand is src_node: Ast.Node.Offset.
disable_intrinsicsImplement builtin @disableIntrinsics. operand is src_node: i32.
selectImplements the @select builtin. operand is payload index to Select.
int_from_errorImplement builtin @errToInt. operand is payload index to UnNode.
error_from_intImplement builtin @errorFromInt. operand is payload index to UnNode.
reifyImplement builtin @Type. operand is payload index to Reify. small contains NameStrategy.
builtin_async_callImplements the @asyncCall builtin. operand is payload index to AsyncCall.
cmpxchgImplements the @cmpxchgStrong and @cmpxchgWeak builtins. small 0=>weak 1=>strong operand is payload index to Cmpxchg.
c_va_argImplement builtin @cVaArg. operand is payload index to BinNode.
c_va_copyImplement builtin @cVaCopy. operand is payload index to UnNode.
c_va_endImplement builtin @cVaEnd. operand is payload index to UnNode.
c_va_startImplement builtin @cVaStart. operand is src_node: Ast.Node.Offset.
ptr_cast_fullImplements the following builtins: @ptrCast, @alignCast, @addrSpaceCast, @constCast, @volatileCast. Represents an arbitrary nesting of the above builtins. Such a nesting is treated as a single operation which can modify multiple components of a pointer type. operand is payload index to BinNode. small contains FullPtrCastFlags. AST node is the root of the nested casts. lhs is dest type, rhs is operand.
ptr_cast_no_destoperand is payload index to UnNode. small contains FullPtrCastFlags. Guaranteed to only have flags where no explicit destination type is required (const_cast and volatile_cast). AST node is the root of the nested casts.
work_item_idImplements the @workItemId builtin. operand is payload index to UnNode.
work_group_sizeImplements the @workGroupSize builtin. operand is payload index to UnNode.
work_group_idImplements the @workGroupId builtin. operand is payload index to UnNode.
in_comptimeImplements the @inComptime builtin. operand is src_node: Ast.Node.Offset.
restore_err_ret_indexRestores the error return index to its last saved state in a given block. If the block is .none, restores to the state from the point of function entry. If the operand is not .none, the restore is conditional on the operand value not being an error. operand is payload index to RestoreErrRetIndex. small is undefined.
closure_getRetrieves a value from the current type declaration scope's closure. operand is src_node: Ast.Node.Offset. small is closure index.
value_placeholderUsed as a placeholder instruction which is just a dummy index for Sema to replace with a specific value. For instance, this is used for the capture of an errdefer. This should never appear in a body.
field_parent_ptrImplements the @fieldParentPtr builtin. operand is payload index to FieldParentPtr. small contains FullPtrCastFlags. Guaranteed to not have the ptr_cast flag. Uses the pl_node union field with payload FieldParentPtr.
builtin_valueGet a type or value from std.builtin. operand is src_node: Ast.Node.Offset. small is an Inst.BuiltinValue.
branch_hintProvide a @branchHint for the current block. operand is payload index to UnNode. small is unused.
inplace_arith_result_tyCompute the result type for in-place arithmetic, e.g. +=. operand is Zir.Inst.Ref of the loaded LHS (not its type). small is an Inst.InplaceOp.
dbg_empty_stmtMarks a statement that can be stepped to but produces no code. operand and small are ignored.
astgen_errorAt this point, AstGen encountered a fatal error which terminated ZIR lowering for this body. A file-level error has been reported. Sema should terminate semantic analysis. operand and small are ignored. This instruction is always noreturn, however, it is not considered as such by ZIR-level queries. This allows AstGen to assume that any code may have gone here, avoiding false-positive "unreachable code" errors.

Members

Source

pub const Extended = enum(u16) { /// A struct type definition. Contains references to ZIR instructions for /// the field types, defaults, and alignments. /// `operand` is payload index to `StructDecl`. /// `small` is `StructDecl.Small`. struct_decl, /// An enum type definition. Contains references to ZIR instructions for /// the field value expressions and optional type tag expression. /// `operand` is payload index to `EnumDecl`. /// `small` is `EnumDecl.Small`. enum_decl, /// A union type definition. Contains references to ZIR instructions for /// the field types and optional type tag expression. /// `operand` is payload index to `UnionDecl`. /// `small` is `UnionDecl.Small`. union_decl, /// An opaque type definition. Contains references to decls and captures. /// `operand` is payload index to `OpaqueDecl`. /// `small` is `OpaqueDecl.Small`. opaque_decl, /// A tuple type. Note that tuples are not namespace/container types. /// `operand` is payload index to `TupleDecl`. /// `small` is `fields_len: u16`. tuple_decl, /// Implements the `@This` builtin. /// `operand` is `src_node: Ast.Node.Offset`. this, /// Implements the `@returnAddress` builtin. /// `operand` is `src_node: Ast.Node.Offset`. ret_addr, /// Implements the `@src` builtin. /// `operand` is payload index to `LineColumn`. builtin_src, /// Implements the `@errorReturnTrace` builtin. /// `operand` is `src_node: Ast.Node.Offset`. error_return_trace, /// Implements the `@frame` builtin. /// `operand` is `src_node: Ast.Node.Offset`. frame, /// Implements the `@frameAddress` builtin. /// `operand` is `src_node: Ast.Node.Offset`. frame_address, /// Same as `alloc` from `Tag` but may contain an alignment instruction. /// `operand` is payload index to `AllocExtended`. /// `small`: /// * 0b000X - has type /// * 0b00X0 - has alignment /// * 0b0X00 - 1=const, 0=var /// * 0bX000 - is comptime alloc, /// The `@extern` builtin. /// `operand` is payload index to `BinNode`. builtin_extern, /// Inline assembly. /// `small`: /// * 0b00000000_000XXXXX - `outputs_len`. /// * 0b000000XX_XXX00000 - `inputs_len`. /// * 0b0XXXXX00_00000000 - `clobbers_len`. /// * 0bX0000000_00000000 - is volatile /// `operand` is payload index to `Asm`. @"asm", /// Same as `asm` except the assembly template is not a string literal but a comptime /// expression. /// The `asm_source` field of the Asm is not a null-terminated string /// but instead a Ref. asm_expr, /// Log compile time variables and emit an error message. /// `operand` is payload index to `NodeMultiOp`. /// `small` is `operands_len`. /// The AST node is the compile log builtin call. compile_log, /// The builtin `@TypeOf` which returns the type after Peer Type Resolution /// of one or more params. /// `operand` is payload index to `TypeOfPeer`. /// `small` is `operands_len`. /// The AST node is the builtin call. typeof_peer, /// Implements the `@min` builtin for more than 2 args. /// `operand` is payload index to `NodeMultiOp`. /// `small` is `operands_len`. /// The AST node is the builtin call. min_multi, /// Implements the `@max` builtin for more than 2 args. /// `operand` is payload index to `NodeMultiOp`. /// `small` is `operands_len`. /// The AST node is the builtin call. max_multi, /// Implements the `@addWithOverflow` builtin. /// `operand` is payload index to `BinNode`. /// `small` is unused. add_with_overflow, /// Implements the `@subWithOverflow` builtin. /// `operand` is payload index to `BinNode`. /// `small` is unused. sub_with_overflow, /// Implements the `@mulWithOverflow` builtin. /// `operand` is payload index to `BinNode`. /// `small` is unused. mul_with_overflow, /// Implements the `@shlWithOverflow` builtin. /// `operand` is payload index to `BinNode`. /// `small` is unused. shl_with_overflow, /// `operand` is payload index to `UnNode`. c_undef, /// `operand` is payload index to `UnNode`. c_include, /// `operand` is payload index to `BinNode`. c_define, /// `operand` is payload index to `UnNode`. wasm_memory_size, /// `operand` is payload index to `BinNode`. wasm_memory_grow, /// The `@prefetch` builtin. /// `operand` is payload index to `BinNode`. prefetch, /// Implement builtin `@setFloatMode`. /// `operand` is payload index to `UnNode`. set_float_mode, /// Implements the `@errorCast` builtin. /// `operand` is payload index to `BinNode`. `lhs` is dest type, `rhs` is operand. error_cast, /// `operand` is payload index to `UnNode`. await_nosuspend, /// Implements `@breakpoint`. /// `operand` is `src_node: Ast.Node.Offset`. breakpoint, /// Implement builtin `@disableInstrumentation`. `operand` is `src_node: Ast.Node.Offset`. disable_instrumentation, /// Implement builtin `@disableIntrinsics`. `operand` is `src_node: i32`. disable_intrinsics, /// Implements the `@select` builtin. /// `operand` is payload index to `Select`. select, /// Implement builtin `@errToInt`. /// `operand` is payload index to `UnNode`. int_from_error, /// Implement builtin `@errorFromInt`. /// `operand` is payload index to `UnNode`. error_from_int, /// Implement builtin `@Type`. /// `operand` is payload index to `Reify`. /// `small` contains `NameStrategy`. reify, /// Implements the `@asyncCall` builtin. /// `operand` is payload index to `AsyncCall`. builtin_async_call, /// Implements the `@cmpxchgStrong` and `@cmpxchgWeak` builtins. /// `small` 0=>weak 1=>strong /// `operand` is payload index to `Cmpxchg`. cmpxchg, /// Implement builtin `@cVaArg`. /// `operand` is payload index to `BinNode`. c_va_arg, /// Implement builtin `@cVaCopy`. /// `operand` is payload index to `UnNode`. c_va_copy, /// Implement builtin `@cVaEnd`. /// `operand` is payload index to `UnNode`. c_va_end, /// Implement builtin `@cVaStart`. /// `operand` is `src_node: Ast.Node.Offset`. c_va_start, /// Implements the following builtins: /// `@ptrCast`, `@alignCast`, `@addrSpaceCast`, `@constCast`, `@volatileCast`. /// Represents an arbitrary nesting of the above builtins. Such a nesting is treated as a /// single operation which can modify multiple components of a pointer type. /// `operand` is payload index to `BinNode`. /// `small` contains `FullPtrCastFlags`. /// AST node is the root of the nested casts. /// `lhs` is dest type, `rhs` is operand. ptr_cast_full, /// `operand` is payload index to `UnNode`. /// `small` contains `FullPtrCastFlags`. /// Guaranteed to only have flags where no explicit destination type is /// required (const_cast and volatile_cast). /// AST node is the root of the nested casts. ptr_cast_no_dest, /// Implements the `@workItemId` builtin. /// `operand` is payload index to `UnNode`. work_item_id, /// Implements the `@workGroupSize` builtin. /// `operand` is payload index to `UnNode`. work_group_size, /// Implements the `@workGroupId` builtin. /// `operand` is payload index to `UnNode`. work_group_id, /// Implements the `@inComptime` builtin. /// `operand` is `src_node: Ast.Node.Offset`. in_comptime, /// Restores the error return index to its last saved state in a given /// block. If the block is `.none`, restores to the state from the point /// of function entry. If the operand is not `.none`, the restore is /// conditional on the operand value not being an error. /// `operand` is payload index to `RestoreErrRetIndex`. /// `small` is undefined. restore_err_ret_index, /// Retrieves a value from the current type declaration scope's closure. /// `operand` is `src_node: Ast.Node.Offset`. /// `small` is closure index. closure_get, /// Used as a placeholder instruction which is just a dummy index for Sema to replace /// with a specific value. For instance, this is used for the capture of an `errdefer`. /// This should never appear in a body. value_placeholder, /// Implements the `@fieldParentPtr` builtin. /// `operand` is payload index to `FieldParentPtr`. /// `small` contains `FullPtrCastFlags`. /// Guaranteed to not have the `ptr_cast` flag. /// Uses the `pl_node` union field with payload `FieldParentPtr`. field_parent_ptr, /// Get a type or value from `std.builtin`. /// `operand` is `src_node: Ast.Node.Offset`. /// `small` is an `Inst.BuiltinValue`. builtin_value, /// Provide a `@branchHint` for the current block. /// `operand` is payload index to `UnNode`. /// `small` is unused. branch_hint, /// Compute the result type for in-place arithmetic, e.g. `+=`. /// `operand` is `Zir.Inst.Ref` of the loaded LHS (*not* its type). /// `small` is an `Inst.InplaceOp`. inplace_arith_result_ty, /// Marks a statement that can be stepped to but produces no code. /// `operand` and `small` are ignored. dbg_empty_stmt, /// At this point, AstGen encountered a fatal error which terminated ZIR lowering for this body. /// A file-level error has been reported. Sema should terminate semantic analysis. /// `operand` and `small` are ignored. /// This instruction is always `noreturn`, however, it is not considered as such by ZIR-level queries. This allows AstGen to assume that /// any code may have gone here, avoiding false-positive "unreachable code" errors. astgen_error, pub const InstData = struct { opcode: Extended, small: u16, operand: u32, }; }