| 38 | } |
| 39 | |
| 40 | spv_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 | |
| 65 | spv_result_t ValidateFloatCompare(ValidationState_t& _, |
| 66 | const Instruction* inst) { |
no test coverage detected