MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / spvInstructionCopy

Function spvInstructionCopy

source/opcode.cpp:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void spvInstructionCopy(const uint32_t* words, const spv::Op opcode,
74 const uint16_t wordCount, const spv_endianness_t endian,
75 spv_instruction_t* pInst) {
76 pInst->opcode = opcode;
77 pInst->words.resize(wordCount);
78 for (uint16_t wordIndex = 0; wordIndex < wordCount; ++wordIndex) {
79 pInst->words[wordIndex] = spvFixWord(words[wordIndex], endian);
80 if (!wordIndex) {
81 uint16_t thisWordCount;
82 uint16_t thisOpcode;
83 spvOpcodeSplit(pInst->words[wordIndex], &thisWordCount, &thisOpcode);
84 assert(opcode == static_cast<spv::Op>(thisOpcode) &&
85 wordCount == thisWordCount && "Endianness failed!");
86 }
87 }
88}
89
90const char* spvOpcodeString(const uint32_t opcode) {
91 const spvtools::InstructionDesc* desc = nullptr;

Callers

nothing calls this directly

Calls 3

spvFixWordFunction · 0.85
spvOpcodeSplitFunction · 0.85
resizeMethod · 0.80

Tested by

no test coverage detected