| 412 | } |
| 413 | |
| 414 | spv_result_t ValidateSatConvertInt(ValidationState_t& _, |
| 415 | const Instruction* inst) { |
| 416 | const spv::Op opcode = inst->opcode(); |
| 417 | const uint32_t result_type = inst->type_id(); |
| 418 | if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) |
| 419 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 420 | << "Expected int scalar or vector type as Result Type: " |
| 421 | << spvOpcodeString(opcode); |
| 422 | |
| 423 | const uint32_t input_type = _.GetOperandTypeId(inst, 2); |
| 424 | if (!input_type || |
| 425 | (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type))) |
| 426 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 427 | << "Expected int scalar or vector as input: " |
| 428 | << spvOpcodeString(opcode); |
| 429 | |
| 430 | if (_.GetDimension(result_type) != _.GetDimension(input_type)) |
| 431 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 432 | << "Expected input to have the same dimension as Result Type: " |
| 433 | << spvOpcodeString(opcode); |
| 434 | return SPV_SUCCESS; |
| 435 | } |
| 436 | |
| 437 | spv_result_t ValidateConvertUToPtr(ValidationState_t& _, |
| 438 | const Instruction* inst, |
no test coverage detected