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

Function ValidateInt32Or64Operand

source/val/validate_memory.cpp:2984–2999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2982}
2983
2984spv_result_t ValidateInt32Or64Operand(ValidationState_t& _,
2985 const Instruction* inst,
2986 uint32_t operand_index,
2987 const char* opcode_name,
2988 const char* operand_name) {
2989 const auto type_id =
2990 _.FindDef(inst->GetOperandAs<uint32_t>(operand_index))->type_id();
2991 if (!_.IsIntScalarType(type_id) ||
2992 !(_.GetBitWidth(type_id) == 32 || _.GetBitWidth(type_id) == 64)) {
2993 return _.diag(SPV_ERROR_INVALID_ID, inst)
2994 << opcode_name << " " << operand_name << " type <id> "
2995 << _.getIdName(type_id) << " is not a 32 or 64 bit integer.";
2996 }
2997
2998 return SPV_SUCCESS;
2999}
3000
3001spv_result_t ValidateCooperativeVectorPointer(ValidationState_t& _,
3002 const Instruction* inst,

Calls 6

FindDefMethod · 0.80
IsIntScalarTypeMethod · 0.80
GetBitWidthMethod · 0.80
diagMethod · 0.80
getIdNameMethod · 0.80
type_idMethod · 0.45

Tested by

no test coverage detected