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

Function ValidateSingleStatus

source/val/validate_logicals.cpp:40–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40spv_result_t ValidateSingleStatus(ValidationState_t& _,
41 const Instruction* inst) {
42 const spv::Op opcode = inst->opcode();
43 const uint32_t result_type = inst->type_id();
44 if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type))
45 return _.diag(SPV_ERROR_INVALID_DATA, inst)
46 << "Expected bool scalar or vector type as Result Type: "
47 << spvOpcodeString(opcode);
48
49 const uint32_t operand_type = _.GetOperandTypeId(inst, 2);
50 if (!operand_type || (!_.IsFloatScalarType(operand_type) &&
51 !_.IsFloatVectorType(operand_type)))
52 return _.diag(SPV_ERROR_INVALID_DATA, inst)
53 << "Expected operand to be scalar or vector float: "
54 << spvOpcodeString(opcode);
55
56 if (_.GetDimension(result_type) != _.GetDimension(operand_type))
57 return _.diag(SPV_ERROR_INVALID_DATA, inst)
58 << "Expected vector sizes of Result Type and the operand to be "
59 "equal: "
60 << spvOpcodeString(opcode);
61
62 return SPV_SUCCESS;
63}
64
65spv_result_t ValidateFloatCompare(ValidationState_t& _,
66 const Instruction* inst) {

Callers 1

LogicalsPassFunction · 0.85

Calls 10

spvOpcodeStringFunction · 0.85
IsBoolScalarTypeMethod · 0.80
IsBoolVectorTypeMethod · 0.80
diagMethod · 0.80
GetOperandTypeIdMethod · 0.80
IsFloatScalarTypeMethod · 0.80
IsFloatVectorTypeMethod · 0.80
GetDimensionMethod · 0.80
opcodeMethod · 0.45
type_idMethod · 0.45

Tested by

no test coverage detected