pub enum SpirVOp {
Show 101 variants
Variable(StorageClass),
Load,
Store,
AccessChain,
CopyObject,
IAdd,
ISub,
IMul,
SDiv,
UDiv,
SMod,
UMod,
SNegate,
FAdd,
FSub,
FMul,
FDiv,
FMod,
FNegate,
FRem,
IEqual,
INotEqual,
SLessThan,
SLessThanEqual,
SGreaterThan,
ULessThan,
FOrdEqual,
FOrdLessThan,
FOrdGreaterThan,
LogicalAnd,
LogicalOr,
LogicalNot,
LogicalEqual,
BitwiseAnd,
BitwiseOr,
BitwiseXor,
Not,
ShiftLeftLogical,
ShiftRightLogical,
ShiftRightArithmetic,
ConvertFToS,
ConvertFToU,
ConvertSToF,
ConvertUToF,
FConvert,
SConvert,
UConvert,
Bitcast,
CompositeConstruct,
CompositeExtract,
CompositeInsert,
VectorShuffle,
VectorExtractDynamic,
VectorInsertDynamic,
MatrixTimesVector,
VectorTimesMatrix,
MatrixTimesMatrix,
MatrixTimesScalar,
Dot,
OuterProduct,
Transpose,
Label,
Branch,
BranchConditional,
Switch,
Return,
ReturnValue,
Unreachable,
Phi,
LoopMerge,
SelectionMerge,
Function,
FunctionParameter,
FunctionEnd,
FunctionCall,
ImageSampleImplicitLod,
ImageSampleExplicitLod,
ImageLoad,
ImageStore,
AtomicLoad,
AtomicStore,
AtomicIAdd,
AtomicISub,
AtomicCompareExchange,
ExtInstGlsl(GlslStd450Op),
Capability(SpirVCapability),
Extension(String),
ExtInstImport(String),
MemoryModel(AddressingModel, MemoryModel),
EntryPoint(ExecutionModel, String),
ExecutionMode(ExecutionMode),
Decorate(Decoration),
MemberDecorate(u32, Decoration),
Name(String),
Constant(u64),
ConstantComposite,
ConstantTrue,
ConstantFalse,
TypeForwardPointer(StorageClass),
ControlBarrier,
MemoryBarrier,
}Expand description
SPIR-V opcodes (a representative subset).
Each variant corresponds to a SPIR-V instruction from the specification. Numeric opcode values follow the SPIR-V 1.6 spec (Table 1).
Variants§
Variable(StorageClass)
OpVariable: declare a variable with storage class
Load
OpLoad: load from a pointer
Store
OpStore: store to a pointer
AccessChain
OpAccessChain: compute a pointer into a composite
CopyObject
OpCopyObject: copy a value
IAdd
OpIAdd: integer addition
ISub
OpISub: integer subtraction
IMul
OpIMul: integer multiplication
SDiv
OpSDiv: signed integer division
UDiv
OpUDiv: unsigned integer division
SMod
OpSMod: signed modulo
UMod
OpUMod: unsigned modulo
SNegate
OpSNegate: signed negation
FAdd
OpFAdd: float addition
FSub
OpFSub: float subtraction
FMul
OpFMul: float multiplication
FDiv
OpFDiv: float division
FMod
OpFMod: float modulo
FNegate
OpFNegate: float negation
FRem
OpFRem: float remainder
IEqual
OpIEqual: integer equality
INotEqual
OpINotEqual: integer inequality
SLessThan
OpSLessThan: signed less-than
SLessThanEqual
OpSLessThanEqual: signed less-than-or-equal
SGreaterThan
OpSGreaterThan: signed greater-than
ULessThan
OpULessThan: unsigned less-than
FOrdEqual
OpFOrdEqual: float ordered equal
FOrdLessThan
OpFOrdLessThan: float ordered less-than
FOrdGreaterThan
OpFOrdGreaterThan: float ordered greater-than
LogicalAnd
OpLogicalAnd: logical and
LogicalOr
OpLogicalOr: logical or
LogicalNot
OpLogicalNot: logical not
LogicalEqual
OpLogicalEqual: logical equality
BitwiseAnd
OpBitwiseAnd: bitwise and
BitwiseOr
OpBitwiseOr: bitwise or
BitwiseXor
OpBitwiseXor: bitwise xor
Not
OpNot: bitwise not
ShiftLeftLogical
OpShiftLeftLogical: logical shift left
ShiftRightLogical
OpShiftRightLogical: logical shift right
ShiftRightArithmetic
OpShiftRightArithmetic: arithmetic shift right
ConvertFToS
OpConvertFToS: float-to-signed-int
ConvertFToU
OpConvertFToU: float-to-unsigned-int
ConvertSToF
OpConvertSToF: signed-int-to-float
ConvertUToF
OpConvertUToF: unsigned-int-to-float
FConvert
OpFConvert: float-to-float conversion
SConvert
OpSConvert: signed integer bit-width conversion
UConvert
OpUConvert: unsigned integer bit-width conversion
Bitcast
OpBitcast: reinterpret bits as another type
CompositeConstruct
OpCompositeConstruct: build a vector/matrix/struct/array
CompositeExtract
OpCompositeExtract: extract a component from a composite
CompositeInsert
OpCompositeInsert: insert a value into a composite
VectorShuffle
OpVectorShuffle: permute vector components
VectorExtractDynamic
OpVectorExtractDynamic: extract at runtime index
VectorInsertDynamic
OpVectorInsertDynamic: insert at runtime index
MatrixTimesVector
OpMatrixTimesVector: mat * vec
VectorTimesMatrix
OpVectorTimesMatrix: vec * mat
MatrixTimesMatrix
OpMatrixTimesMatrix: mat * mat
MatrixTimesScalar
OpMatrixTimesScalar: mat * scalar
Dot
OpDot: dot product of two vectors
OuterProduct
OpOuterProduct: outer product of two vectors
Transpose
OpTranspose: matrix transpose
Label
OpLabel: basic block label
Branch
OpBranch: unconditional branch
BranchConditional
OpBranchConditional: conditional branch
Switch
OpSwitch: switch on integer
Return
OpReturn: return from function with void
ReturnValue
OpReturnValue: return a value
Unreachable
OpUnreachable: mark unreachable code
Phi
OpPhi: SSA phi node
LoopMerge
OpLoopMerge: loop structure hint
SelectionMerge
OpSelectionMerge: selection structure hint
Function
OpFunction: begin a function definition
FunctionParameter
OpFunctionParameter: declare a parameter
FunctionEnd
OpFunctionEnd: end a function definition
FunctionCall
OpFunctionCall: call a function
ImageSampleImplicitLod
OpImageSampleImplicitLod: sample image with implicit LOD
ImageSampleExplicitLod
OpImageSampleExplicitLod: sample image with explicit LOD
ImageLoad
OpImageLoad: load from a storage image
ImageStore
OpImageStore: store to a storage image
AtomicLoad
OpAtomicLoad: atomic load
AtomicStore
OpAtomicStore: atomic store
AtomicIAdd
OpAtomicIAdd: atomic integer add
AtomicISub
OpAtomicISub: atomic integer subtract
AtomicCompareExchange
OpAtomicCompareExchange: compare and swap
ExtInstGlsl(GlslStd450Op)
OpExtInst (GLSLstd450) — standard math functions
Capability(SpirVCapability)
OpCapability: declare a SPIR-V capability
Extension(String)
OpExtension: import a SPIR-V extension
ExtInstImport(String)
OpExtInstImport: import extended instruction set
MemoryModel(AddressingModel, MemoryModel)
OpMemoryModel: set addressing + memory model
EntryPoint(ExecutionModel, String)
OpEntryPoint: declare a shader entry point
ExecutionMode(ExecutionMode)
OpExecutionMode: declare execution mode for entry point
Decorate(Decoration)
OpDecorate: decorate an ID with metadata
MemberDecorate(u32, Decoration)
OpMemberDecorate: decorate a struct member
Name(String)
OpName: assign debug name to an ID
Constant(u64)
OpConstant: scalar constant value
ConstantComposite
OpConstantComposite: composite constant
ConstantTrue
OpConstantTrue: boolean true
ConstantFalse
OpConstantFalse: boolean false
TypeForwardPointer(StorageClass)
OpTypeForwardPointer: forward declaration of pointer type
ControlBarrier
OpControlBarrier: synchronization barrier
MemoryBarrier
OpMemoryBarrier: memory barrier