Lines Matching refs:pInst
163 const char* text, spv_instruction_t* pInst) { in encodeImmediate() argument
170 context->binaryEncodeU32(parse_result, pInst); in encodeImmediate()
191 spv_instruction_t* pInst, in spvTextEncodeOperand() argument
195 if (auto error = encodeImmediate(context, textValue, pInst)) { in spvTextEncodeOperand()
225 if (type == SPV_OPERAND_TYPE_TYPE_ID) pInst->resultTypeId = id; in spvTextEncodeOperand()
226 spvInstructionAddWord(pInst, id); in spvTextEncodeOperand()
230 if (pInst->opcode == SpvOpExtInst && pInst->words.size() == 4) { in spvTextEncodeOperand()
231 auto ext_inst_type = context->getExtInstTypeForId(pInst->words[3]); in spvTextEncodeOperand()
235 << pInst->words[2]; in spvTextEncodeOperand()
237 pInst->extInstType = ext_inst_type; in spvTextEncodeOperand()
245 if (grammar.lookupExtInst(pInst->extInstType, textValue, &extInst)) { in spvTextEncodeOperand()
249 spvInstructionAddWord(pInst, extInst->ext_inst); in spvTextEncodeOperand()
269 spvInstructionAddWord(pInst, uint32_t(opcodeEntry->opcode)); in spvTextEncodeOperand()
286 textValue, error_code_for_literals, expected_type, pInst)) { in spvTextEncodeOperand()
296 pInst)) { in spvTextEncodeOperand()
307 if (SpvOpConstant == pInst->opcode || in spvTextEncodeOperand()
308 SpvOpSpecConstant == pInst->opcode) { in spvTextEncodeOperand()
312 context->getTypeOfTypeGeneratingValue(pInst->resultTypeId); in spvTextEncodeOperand()
317 if (SPV_SUCCESS == grammar.lookupOpcode(pInst->opcode, &d)) { in spvTextEncodeOperand()
324 } else if (pInst->opcode == SpvOpSwitch) { in spvTextEncodeOperand()
326 expected_type = context->getTypeOfValueInstruction(pInst->words[1]); in spvTextEncodeOperand()
334 textValue, error_code_for_literals, expected_type, pInst)) { in spvTextEncodeOperand()
355 if (SpvOpExtInstImport == pInst->opcode) { in spvTextEncodeOperand()
363 if ((error = context->recordIdAsExtInstImport(pInst->words[1], in spvTextEncodeOperand()
368 if (context->binaryEncodeString(literal.str.c_str(), pInst)) in spvTextEncodeOperand()
386 if (auto error = context->binaryEncodeU32(value, pInst)) return error; in spvTextEncodeOperand()
393 pInst, pExpectedOperands); in spvTextEncodeOperand()
398 textValue, pInst, pExpectedOperands); in spvTextEncodeOperand()
404 textValue, pInst, pExpectedOperands); in spvTextEncodeOperand()
422 if (context->binaryEncodeU32(entry->value, pInst)) { in spvTextEncodeOperand()
443 spvtools::AssemblyContext* context, spv_instruction_t* pInst) { in encodeInstructionStartingWithImmediate() argument
449 if ((error = encodeImmediate(context, firstWord.c_str(), pInst))) { in encodeInstructionStartingWithImmediate()
470 pInst, &dummyExpectedOperands); in encodeInstructionStartingWithImmediate()
488 spv_instruction_t* pInst) { in spvTextEncodeOpcode() argument
491 return encodeInstructionStartingWithImmediate(grammar, context, pInst); in spvTextEncodeOpcode()
549 pInst->opcode = opcodeEntry->opcode; in spvTextEncodeOpcode()
552 spvInstructionAddWord(pInst, 0); in spvTextEncodeOpcode()
580 result_id.c_str(), pInst, nullptr); in spvTextEncodeOpcode()
615 pInst, &expectedOperands); in spvTextEncodeOpcode()
626 if (spvOpcodeGeneratesType(pInst->opcode)) { in spvTextEncodeOpcode()
627 if (context->recordTypeDefinition(pInst) != SPV_SUCCESS) { in spvTextEncodeOpcode()
635 context->recordTypeIdForValue(pInst->words[2], pInst->words[1]); in spvTextEncodeOpcode()
638 if (pInst->words.size() > SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX) { in spvTextEncodeOpcode()
640 << "Instruction too long: " << pInst->words.size() in spvTextEncodeOpcode()
645 pInst->words[0] = in spvTextEncodeOpcode()
646 spvOpcodeMake(uint16_t(pInst->words.size()), opcodeEntry->opcode); in spvTextEncodeOpcode()