aboutsummaryrefslogtreecommitdiff
path: root/source/opcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/opcode.h')
-rw-r--r--source/opcode.h65
1 files changed, 31 insertions, 34 deletions
diff --git a/source/opcode.h b/source/opcode.h
index 217aeb2b..77a0bed2 100644
--- a/source/opcode.h
+++ b/source/opcode.h
@@ -29,7 +29,7 @@
const char* spvGeneratorStr(uint32_t generator);
// Combines word_count and opcode enumerant in single word.
-uint32_t spvOpcodeMake(uint16_t word_count, spv::Op opcode);
+uint32_t spvOpcodeMake(uint16_t word_count, SpvOp opcode);
// Splits word into into two constituent parts: word_count and opcode.
void spvOpcodeSplit(const uint32_t word, uint16_t* word_count,
@@ -45,118 +45,115 @@ spv_result_t spvOpcodeTableNameLookup(spv_target_env,
// SPV_SUCCESS and writes a handle of the table entry into *entry.
spv_result_t spvOpcodeTableValueLookup(spv_target_env,
const spv_opcode_table table,
- const spv::Op opcode,
+ const SpvOp opcode,
spv_opcode_desc* entry);
// Copies an instruction's word and fixes the endianness to host native. The
// source instruction's stream/opcode/endianness is in the words/opcode/endian
// parameter. The word_count parameter specifies the number of words to copy.
// Writes copied instruction into *inst.
-void spvInstructionCopy(const uint32_t* words, const spv::Op opcode,
+void spvInstructionCopy(const uint32_t* words, const SpvOp opcode,
const uint16_t word_count,
const spv_endianness_t endian, spv_instruction_t* inst);
// Determine if the given opcode is a scalar type. Returns zero if false,
// non-zero otherwise.
-int32_t spvOpcodeIsScalarType(const spv::Op opcode);
+int32_t spvOpcodeIsScalarType(const SpvOp opcode);
// Determines if the given opcode is a specialization constant. Returns zero if
// false, non-zero otherwise.
-int32_t spvOpcodeIsSpecConstant(const spv::Op opcode);
+int32_t spvOpcodeIsSpecConstant(const SpvOp opcode);
// Determines if the given opcode is a constant. Returns zero if false, non-zero
// otherwise.
-int32_t spvOpcodeIsConstant(const spv::Op opcode);
+int32_t spvOpcodeIsConstant(const SpvOp opcode);
// Returns true if the given opcode is a constant or undef.
-bool spvOpcodeIsConstantOrUndef(const spv::Op opcode);
+bool spvOpcodeIsConstantOrUndef(const SpvOp opcode);
// Returns true if the given opcode is a scalar specialization constant.
-bool spvOpcodeIsScalarSpecConstant(const spv::Op opcode);
+bool spvOpcodeIsScalarSpecConstant(const SpvOp opcode);
// Determines if the given opcode is a composite type. Returns zero if false,
// non-zero otherwise.
-int32_t spvOpcodeIsComposite(const spv::Op opcode);
+int32_t spvOpcodeIsComposite(const SpvOp opcode);
// Determines if the given opcode results in a pointer when using the logical
// addressing model. Returns zero if false, non-zero otherwise.
-int32_t spvOpcodeReturnsLogicalPointer(const spv::Op opcode);
+int32_t spvOpcodeReturnsLogicalPointer(const SpvOp opcode);
// Returns whether the given opcode could result in a pointer or a variable
// pointer when using the logical addressing model.
-bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode);
+bool spvOpcodeReturnsLogicalVariablePointer(const SpvOp opcode);
// Determines if the given opcode generates a type. Returns zero if false,
// non-zero otherwise.
-int32_t spvOpcodeGeneratesType(spv::Op opcode);
+int32_t spvOpcodeGeneratesType(SpvOp opcode);
// Returns true if the opcode adds a decoration to an id.
-bool spvOpcodeIsDecoration(const spv::Op opcode);
+bool spvOpcodeIsDecoration(const SpvOp opcode);
// Returns true if the opcode is a load from memory into a result id. This
// function only considers core instructions.
-bool spvOpcodeIsLoad(const spv::Op opcode);
+bool spvOpcodeIsLoad(const SpvOp opcode);
// Returns true if the opcode is an atomic operation that uses the original
// value.
-bool spvOpcodeIsAtomicWithLoad(const spv::Op opcode);
+bool spvOpcodeIsAtomicWithLoad(const SpvOp opcode);
// Returns true if the opcode is an atomic operation.
-bool spvOpcodeIsAtomicOp(const spv::Op opcode);
+bool spvOpcodeIsAtomicOp(const SpvOp opcode);
// Returns true if the given opcode is a branch instruction.
-bool spvOpcodeIsBranch(spv::Op opcode);
+bool spvOpcodeIsBranch(SpvOp opcode);
// Returns true if the given opcode is a return instruction.
-bool spvOpcodeIsReturn(spv::Op opcode);
+bool spvOpcodeIsReturn(SpvOp opcode);
// Returns true if the given opcode aborts execution. To abort means that after
// executing that instruction, no other instructions will be executed regardless
// of the context in which the instruction appears. Note that `OpUnreachable`
// is considered an abort even if its behaviour is undefined.
-bool spvOpcodeIsAbort(spv::Op opcode);
+bool spvOpcodeIsAbort(SpvOp opcode);
// Returns true if the given opcode is a return instruction or it aborts
// execution.
-bool spvOpcodeIsReturnOrAbort(spv::Op opcode);
+bool spvOpcodeIsReturnOrAbort(SpvOp opcode);
// Returns true if the given opcode is a basic block terminator.
-bool spvOpcodeIsBlockTerminator(spv::Op opcode);
+bool spvOpcodeIsBlockTerminator(SpvOp opcode);
// Returns true if the given opcode always defines an opaque type.
-bool spvOpcodeIsBaseOpaqueType(spv::Op opcode);
+bool spvOpcodeIsBaseOpaqueType(SpvOp opcode);
// Returns true if the given opcode is a non-uniform group operation.
-bool spvOpcodeIsNonUniformGroupOperation(spv::Op opcode);
+bool spvOpcodeIsNonUniformGroupOperation(SpvOp opcode);
// Returns true if the opcode with vector inputs could be divided into a series
// of independent scalar operations that would give the same result.
-bool spvOpcodeIsScalarizable(spv::Op opcode);
+bool spvOpcodeIsScalarizable(SpvOp opcode);
// Returns true if the given opcode is a debug instruction.
-bool spvOpcodeIsDebug(spv::Op opcode);
+bool spvOpcodeIsDebug(SpvOp opcode);
// Returns true for opcodes that are binary operators,
// where the order of the operands is irrelevant.
-bool spvOpcodeIsCommutativeBinaryOperator(spv::Op opcode);
+bool spvOpcodeIsCommutativeBinaryOperator(SpvOp opcode);
// Returns true for opcodes that represent linear algebra instructions.
-bool spvOpcodeIsLinearAlgebra(spv::Op opcode);
+bool spvOpcodeIsLinearAlgebra(SpvOp opcode);
// Returns true for opcodes that represent image sample instructions.
-bool spvOpcodeIsImageSample(spv::Op opcode);
+bool spvOpcodeIsImageSample(SpvOp opcode);
// Returns a vector containing the indices of the memory semantics <id>
// operands for |opcode|.
-std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(spv::Op opcode);
+std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(SpvOp opcode);
// Returns true for opcodes that represent access chain instructions.
-bool spvOpcodeIsAccessChain(spv::Op opcode);
+bool spvOpcodeIsAccessChain(SpvOp opcode);
// Returns true for opcodes that represent bit instructions.
-bool spvOpcodeIsBit(spv::Op opcode);
-
-// Gets the name of an instruction, without the "Op" prefix.
-const char* spvOpcodeString(const spv::Op opcode);
+bool spvOpcodeIsBit(SpvOp opcode);
#endif // SOURCE_OPCODE_H_