|
Talvos
0.1
SPIR-V interpreter and dynamic analysis framework
|
This class represents a single execution of a SPIR-V entry point. More...
#include <talvos/Invocation.h>
Classes | |
| struct | StackEntry |
| A data structure holding information for a function call. More... | |
Public Types | |
| enum | State { READY, BARRIER, FINISHED } |
| Used to indicate whether an invocation is ready to execute, waiting at a barrier, or complete. More... | |
Private Member Functions | |
| Memory & | getMemory (uint32_t StorageClass) |
Returns the memory instance associated with StorageClass. More... | |
| void | moveToBlock (uint32_t Id) |
Move this invocation to the block with ID Id. More... | |
| template<typename OpTy , unsigned N, unsigned Offset = 2, typename F > | |
| void | executeOp (const Instruction *Inst, const F &Op) |
| Helper functions to execute simple instructions that can either operate on scalars or component-wise for vectors. More... | |
| template<unsigned N, unsigned Offset = 2, typename F > | |
| void | executeOpFP (const Instruction *Inst, const F &&Op) |
| template<unsigned N, unsigned Offset = 2, typename F > | |
| void | executeOpSInt (const Instruction *Inst, const F &&Op) |
| template<unsigned N, unsigned Offset = 2, typename F > | |
| void | executeOpUInt (const Instruction *Inst, const F &&Op) |
Private Attributes | |
| std::shared_ptr< const Module > | CurrentModule |
| The current module. More... | |
| const Function * | CurrentFunction |
| The current function. More... | |
| const Instruction * | CurrentInstruction |
| The current instruction. More... | |
| uint32_t | CurrentBlock |
| The current block. More... | |
| uint32_t | PreviousBlock |
| The previous block (for OpPhi). More... | |
| bool | AtBarrier |
| True when at a barrier. More... | |
| bool | Discarded |
| True when fragment was discarded. More... | |
| std::vector< StackEntry > | CallStack |
| The function call stack. More... | |
| std::vector< Object > | Objects |
| Set of result objects. More... | |
| Device & | Dev |
| The device this invocation is executing on. More... | |
| Workgroup * | Group |
| The workgroup this invocation belongs to. More... | |
| Dim3 | GlobalId |
| The GlobalInvocationID. More... | |
| Memory * | PrivateMemory |
| The private memory instance. More... | |
| std::shared_ptr< Memory > | PipelineMemory |
| Memory used for input and output storage classes. More... | |
| std::vector< std::pair < uint32_t, Object > > | PhiTemps |
| Temporary OpPhi results to be applied when we reach first non-OpPhi. More... | |
This class represents a single execution of a SPIR-V entry point.
Instances of this class have a current instruction, block, and function, as well as their own Memory object used for private memory allocations. They also have a set of Objects used to hold instruction results.
Definition at line 33 of file Invocation.h.
Used to indicate whether an invocation is ready to execute, waiting at a barrier, or complete.
| Enumerator | |
|---|---|
| READY | |
| BARRIER | |
| FINISHED | |
Definition at line 38 of file Invocation.h.
Create a standalone invocation for a device, with an initial set of result objects.
Definition at line 38 of file Invocation.cpp.
| talvos::Invocation::Invocation | ( | Device & | Dev, |
| const PipelineStage & | Stage, | ||
| const std::vector< Object > & | InitialObjects, | ||
| std::shared_ptr< Memory > | PipelineMemory, | ||
| Workgroup * | Group, | ||
| Dim3 | GlobalId | ||
| ) |
Create an invocation for Stage on Dev.
Initial result object values are provided in InitialObjects, and PipelineMemory provides storage for input and output memory accesses.
Definition at line 47 of file Invocation.cpp.
| talvos::Invocation::~Invocation | ( | ) |
Destroy this invocation.
Definition at line 89 of file Invocation.cpp.
|
delete |
|
inline |
Clear the barrier state, allowing the invocation to continue.
Definition at line 68 of file Invocation.h.
| void talvos::Invocation::execute | ( | const Instruction * | Inst | ) |
Execute Inst in this invocation.
Definition at line 91 of file Invocation.cpp.
| void talvos::Invocation::executeAccessChain | ( | const Instruction * | Inst | ) |
Definition at line 238 of file Invocation.cpp.
| void talvos::Invocation::executeAll | ( | const Instruction * | Inst | ) |
Definition at line 396 of file Invocation.cpp.
| void talvos::Invocation::executeAny | ( | const Instruction * | Inst | ) |
Definition at line 412 of file Invocation.cpp.
| void talvos::Invocation::executeAtomicCompareExchange | ( | const Instruction * | Inst | ) |
Definition at line 454 of file Invocation.cpp.
| void talvos::Invocation::executeAtomicOp | ( | const Instruction * | Inst | ) |
Definition at line 428 of file Invocation.cpp.
| void talvos::Invocation::executeBitcast | ( | const Instruction * | Inst | ) |
Definition at line 470 of file Invocation.cpp.
| void talvos::Invocation::executeBitwiseAnd | ( | const Instruction * | Inst | ) |
Definition at line 477 of file Invocation.cpp.
| void talvos::Invocation::executeBitwiseOr | ( | const Instruction * | Inst | ) |
Definition at line 482 of file Invocation.cpp.
| void talvos::Invocation::executeBitwiseXor | ( | const Instruction * | Inst | ) |
Definition at line 487 of file Invocation.cpp.
| void talvos::Invocation::executeBranch | ( | const Instruction * | Inst | ) |
Definition at line 492 of file Invocation.cpp.
| void talvos::Invocation::executeBranchConditional | ( | const Instruction * | Inst | ) |
Definition at line 497 of file Invocation.cpp.
| void talvos::Invocation::executeCompositeConstruct | ( | const Instruction * | Inst | ) |
Definition at line 503 of file Invocation.cpp.
| void talvos::Invocation::executeCompositeExtract | ( | const Instruction * | Inst | ) |
Definition at line 519 of file Invocation.cpp.
| void talvos::Invocation::executeCompositeInsert | ( | const Instruction * | Inst | ) |
Definition at line 528 of file Invocation.cpp.
| void talvos::Invocation::executeControlBarrier | ( | const Instruction * | Inst | ) |
Definition at line 540 of file Invocation.cpp.
| void talvos::Invocation::executeConvertFToS | ( | const Instruction * | Inst | ) |
Definition at line 547 of file Invocation.cpp.
| void talvos::Invocation::executeConvertFToU | ( | const Instruction * | Inst | ) |
Definition at line 565 of file Invocation.cpp.
| void talvos::Invocation::executeConvertSToF | ( | const Instruction * | Inst | ) |
Definition at line 583 of file Invocation.cpp.
| void talvos::Invocation::executeConvertUToF | ( | const Instruction * | Inst | ) |
Definition at line 598 of file Invocation.cpp.
| void talvos::Invocation::executeCopyMemory | ( | const Instruction * | Inst | ) |
Definition at line 613 of file Invocation.cpp.
| void talvos::Invocation::executeCopyObject | ( | const Instruction * | Inst | ) |
Definition at line 631 of file Invocation.cpp.
| void talvos::Invocation::executeDot | ( | const Instruction * | Inst | ) |
Definition at line 636 of file Invocation.cpp.
| void talvos::Invocation::executeExtInst | ( | const Instruction * | Inst | ) |
Definition at line 663 of file Invocation.cpp.
| void talvos::Invocation::executeFAdd | ( | const Instruction * | Inst | ) |
Definition at line 748 of file Invocation.cpp.
| void talvos::Invocation::executeFConvert | ( | const Instruction * | Inst | ) |
Definition at line 753 of file Invocation.cpp.
| void talvos::Invocation::executeFDiv | ( | const Instruction * | Inst | ) |
Definition at line 768 of file Invocation.cpp.
| void talvos::Invocation::executeFMod | ( | const Instruction * | Inst | ) |
Definition at line 773 of file Invocation.cpp.
| void talvos::Invocation::executeFMul | ( | const Instruction * | Inst | ) |
Definition at line 780 of file Invocation.cpp.
| void talvos::Invocation::executeFNegate | ( | const Instruction * | Inst | ) |
Definition at line 785 of file Invocation.cpp.
| void talvos::Invocation::executeFOrdEqual | ( | const Instruction * | Inst | ) |
Definition at line 790 of file Invocation.cpp.
| void talvos::Invocation::executeFOrdGreaterThan | ( | const Instruction * | Inst | ) |
Definition at line 797 of file Invocation.cpp.
| void talvos::Invocation::executeFOrdGreaterThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 804 of file Invocation.cpp.
| void talvos::Invocation::executeFOrdLessThan | ( | const Instruction * | Inst | ) |
Definition at line 811 of file Invocation.cpp.
| void talvos::Invocation::executeFOrdLessThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 818 of file Invocation.cpp.
| void talvos::Invocation::executeFOrdNotEqual | ( | const Instruction * | Inst | ) |
Definition at line 825 of file Invocation.cpp.
| void talvos::Invocation::executeFRem | ( | const Instruction * | Inst | ) |
Definition at line 832 of file Invocation.cpp.
| void talvos::Invocation::executeFSub | ( | const Instruction * | Inst | ) |
Definition at line 838 of file Invocation.cpp.
| void talvos::Invocation::executeFunctionCall | ( | const Instruction * | Inst | ) |
Definition at line 843 of file Invocation.cpp.
| void talvos::Invocation::executeFUnordEqual | ( | const Instruction * | Inst | ) |
Definition at line 864 of file Invocation.cpp.
| void talvos::Invocation::executeFUnordGreaterThan | ( | const Instruction * | Inst | ) |
Definition at line 871 of file Invocation.cpp.
| void talvos::Invocation::executeFUnordGreaterThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 878 of file Invocation.cpp.
| void talvos::Invocation::executeFUnordLessThan | ( | const Instruction * | Inst | ) |
Definition at line 885 of file Invocation.cpp.
| void talvos::Invocation::executeFUnordLessThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 892 of file Invocation.cpp.
| void talvos::Invocation::executeFUnordNotEqual | ( | const Instruction * | Inst | ) |
Definition at line 899 of file Invocation.cpp.
| void talvos::Invocation::executeIAdd | ( | const Instruction * | Inst | ) |
Definition at line 906 of file Invocation.cpp.
| void talvos::Invocation::executeIEqual | ( | const Instruction * | Inst | ) |
Definition at line 911 of file Invocation.cpp.
| void talvos::Invocation::executeImage | ( | const Instruction * | Inst | ) |
Definition at line 916 of file Invocation.cpp.
| void talvos::Invocation::executeImageQuerySize | ( | const Instruction * | Inst | ) |
Definition at line 926 of file Invocation.cpp.
| void talvos::Invocation::executeImageRead | ( | const Instruction * | Inst | ) |
Definition at line 979 of file Invocation.cpp.
| void talvos::Invocation::executeImageSampleExplicitLod | ( | const Instruction * | Inst | ) |
Definition at line 1030 of file Invocation.cpp.
| void talvos::Invocation::executeImageWrite | ( | const Instruction * | Inst | ) |
Definition at line 1069 of file Invocation.cpp.
| void talvos::Invocation::executeIMul | ( | const Instruction * | Inst | ) |
Definition at line 1100 of file Invocation.cpp.
| void talvos::Invocation::executeINotEqual | ( | const Instruction * | Inst | ) |
Definition at line 1105 of file Invocation.cpp.
| void talvos::Invocation::executeIsInf | ( | const Instruction * | Inst | ) |
Definition at line 1110 of file Invocation.cpp.
| void talvos::Invocation::executeIsNan | ( | const Instruction * | Inst | ) |
Definition at line 1115 of file Invocation.cpp.
| void talvos::Invocation::executeISub | ( | const Instruction * | Inst | ) |
Definition at line 1120 of file Invocation.cpp.
| void talvos::Invocation::executeKill | ( | const Instruction * | Inst | ) |
Definition at line 1125 of file Invocation.cpp.
| void talvos::Invocation::executeLoad | ( | const Instruction * | Inst | ) |
Definition at line 1131 of file Invocation.cpp.
| void talvos::Invocation::executeLogicalAnd | ( | const Instruction * | Inst | ) |
Definition at line 1139 of file Invocation.cpp.
| void talvos::Invocation::executeLogicalEqual | ( | const Instruction * | Inst | ) |
Definition at line 1144 of file Invocation.cpp.
| void talvos::Invocation::executeLogicalNot | ( | const Instruction * | Inst | ) |
Definition at line 1149 of file Invocation.cpp.
| void talvos::Invocation::executeLogicalNotEqual | ( | const Instruction * | Inst | ) |
Definition at line 1154 of file Invocation.cpp.
| void talvos::Invocation::executeLogicalOr | ( | const Instruction * | Inst | ) |
Definition at line 1159 of file Invocation.cpp.
| void talvos::Invocation::executeMatrixTimesScalar | ( | const Instruction * | Inst | ) |
Definition at line 1164 of file Invocation.cpp.
| void talvos::Invocation::executeMatrixTimesVector | ( | const Instruction * | Inst | ) |
Definition at line 1197 of file Invocation.cpp.
| void talvos::Invocation::executeNot | ( | const Instruction * | Inst | ) |
Definition at line 1235 of file Invocation.cpp.
|
private |
Helper functions to execute simple instructions that can either operate on scalars or component-wise for vectors.
OpTy is the C++ scalar type of each operand. N is the number of operands. Offset is the operand offset of the first value. Op is a lambda that takes N operand values and returns a result.
Definition at line 1744 of file Invocation.cpp.
|
private |
Definition at line 1790 of file Invocation.cpp.
|
private |
Definition at line 1765 of file Invocation.cpp.
|
private |
Definition at line 1809 of file Invocation.cpp.
| void talvos::Invocation::executePhi | ( | const Instruction * | Inst | ) |
Definition at line 1240 of file Invocation.cpp.
| void talvos::Invocation::executeReturn | ( | const Instruction * | Inst | ) |
Definition at line 1257 of file Invocation.cpp.
| void talvos::Invocation::executeReturnValue | ( | const Instruction * | Inst | ) |
Definition at line 1276 of file Invocation.cpp.
| void talvos::Invocation::executeSampledImage | ( | const Instruction * | Inst | ) |
Definition at line 1296 of file Invocation.cpp.
| void talvos::Invocation::executeSConvert | ( | const Instruction * | Inst | ) |
Definition at line 1313 of file Invocation.cpp.
| void talvos::Invocation::executeSDiv | ( | const Instruction * | Inst | ) |
Definition at line 1331 of file Invocation.cpp.
| void talvos::Invocation::executeSelect | ( | const Instruction * | Inst | ) |
Definition at line 1336 of file Invocation.cpp.
| void talvos::Invocation::executeSGreaterThan | ( | const Instruction * | Inst | ) |
Definition at line 1359 of file Invocation.cpp.
| void talvos::Invocation::executeSGreaterThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 1364 of file Invocation.cpp.
| void talvos::Invocation::executeShiftLeftLogical | ( | const Instruction * | Inst | ) |
Definition at line 1369 of file Invocation.cpp.
| void talvos::Invocation::executeShiftRightArithmetic | ( | const Instruction * | Inst | ) |
Definition at line 1374 of file Invocation.cpp.
| void talvos::Invocation::executeShiftRightLogical | ( | const Instruction * | Inst | ) |
Definition at line 1379 of file Invocation.cpp.
| void talvos::Invocation::executeSLessThan | ( | const Instruction * | Inst | ) |
Definition at line 1384 of file Invocation.cpp.
| void talvos::Invocation::executeSLessThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 1389 of file Invocation.cpp.
| void talvos::Invocation::executeSMod | ( | const Instruction * | Inst | ) |
Definition at line 1394 of file Invocation.cpp.
| void talvos::Invocation::executeSNegate | ( | const Instruction * | Inst | ) |
Definition at line 1401 of file Invocation.cpp.
| void talvos::Invocation::executeSRem | ( | const Instruction * | Inst | ) |
Definition at line 1406 of file Invocation.cpp.
| void talvos::Invocation::executeStore | ( | const Instruction * | Inst | ) |
Definition at line 1411 of file Invocation.cpp.
| void talvos::Invocation::executeSwitch | ( | const Instruction * | Inst | ) |
Definition at line 1419 of file Invocation.cpp.
| void talvos::Invocation::executeUConvert | ( | const Instruction * | Inst | ) |
Definition at line 1438 of file Invocation.cpp.
| void talvos::Invocation::executeUDiv | ( | const Instruction * | Inst | ) |
Definition at line 1456 of file Invocation.cpp.
| void talvos::Invocation::executeUGreaterThan | ( | const Instruction * | Inst | ) |
Definition at line 1461 of file Invocation.cpp.
| void talvos::Invocation::executeUGreaterThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 1466 of file Invocation.cpp.
| void talvos::Invocation::executeULessThan | ( | const Instruction * | Inst | ) |
Definition at line 1471 of file Invocation.cpp.
| void talvos::Invocation::executeULessThanEqual | ( | const Instruction * | Inst | ) |
Definition at line 1476 of file Invocation.cpp.
| void talvos::Invocation::executeUMod | ( | const Instruction * | Inst | ) |
Definition at line 1491 of file Invocation.cpp.
| void talvos::Invocation::executeUndef | ( | const Instruction * | Inst | ) |
Definition at line 1481 of file Invocation.cpp.
| void talvos::Invocation::executeUnreachable | ( | const Instruction * | Inst | ) |
Definition at line 1486 of file Invocation.cpp.
| void talvos::Invocation::executeVariable | ( | const Instruction * | Inst | ) |
Definition at line 1496 of file Invocation.cpp.
| void talvos::Invocation::executeVectorExtractDynamic | ( | const Instruction * | Inst | ) |
Definition at line 1514 of file Invocation.cpp.
| void talvos::Invocation::executeVectorInsertDynamic | ( | const Instruction * | Inst | ) |
Definition at line 1539 of file Invocation.cpp.
| void talvos::Invocation::executeVectorShuffle | ( | const Instruction * | Inst | ) |
Definition at line 1566 of file Invocation.cpp.
| void talvos::Invocation::executeVectorTimesMatrix | ( | const Instruction * | Inst | ) |
Definition at line 1589 of file Invocation.cpp.
| void talvos::Invocation::executeVectorTimesScalar | ( | const Instruction * | Inst | ) |
Definition at line 1627 of file Invocation.cpp.
|
inline |
Returns the instruction that this invocation is executing.
Definition at line 74 of file Invocation.h.
|
inline |
Returns the global invocation ID.
Definition at line 80 of file Invocation.h.
|
private |
Returns the memory instance associated with StorageClass.
Definition at line 1648 of file Invocation.cpp.
| Object talvos::Invocation::getObject | ( | uint32_t | Id | ) | const |
Returns the object with the specified ID.
Returns a null object if no object with this ID has been defined.
Definition at line 1672 of file Invocation.cpp.
| Invocation::State talvos::Invocation::getState | ( | ) | const |
Returns the state of this invocation.
Definition at line 1680 of file Invocation.cpp.
|
private |
Move this invocation to the block with ID Id.
Definition at line 1687 of file Invocation.cpp.
|
delete |
| void talvos::Invocation::step | ( | ) |
Step this invocation by executing the next instruction.
Definition at line 1695 of file Invocation.cpp.
|
inline |
Returns true if this invocation has been discarded with OpKill.
Definition at line 93 of file Invocation.h.
|
private |
True when at a barrier.
Definition at line 207 of file Invocation.h.
|
private |
The function call stack.
Definition at line 222 of file Invocation.h.
|
private |
The current block.
Definition at line 205 of file Invocation.h.
|
private |
The current function.
Definition at line 203 of file Invocation.h.
|
private |
The current instruction.
Definition at line 204 of file Invocation.h.
|
private |
The current module.
Definition at line 201 of file Invocation.h.
|
private |
The device this invocation is executing on.
Definition at line 226 of file Invocation.h.
|
private |
True when fragment was discarded.
Definition at line 208 of file Invocation.h.
|
private |
The GlobalInvocationID.
Definition at line 228 of file Invocation.h.
|
private |
The workgroup this invocation belongs to.
Definition at line 227 of file Invocation.h.
|
private |
Set of result objects.
Definition at line 224 of file Invocation.h.
|
private |
Temporary OpPhi results to be applied when we reach first non-OpPhi.
Definition at line 235 of file Invocation.h.
|
private |
Memory used for input and output storage classes.
Definition at line 232 of file Invocation.h.
|
private |
The previous block (for OpPhi).
Definition at line 206 of file Invocation.h.
|
private |
The private memory instance.
Definition at line 229 of file Invocation.h.
1.8.6