| 308 | } |
| 309 | |
| 310 | spv_result_t ValidateQuantizeToF16(ValidationState_t& _, |
| 311 | const Instruction* inst, |
| 312 | uint32_t operand_index = 2) { |
| 313 | const spv::Op opcode = inst->opcode(); |
| 314 | const uint32_t result_type = inst->type_id(); |
| 315 | if ((!_.IsFloatScalarType(result_type) && |
| 316 | !_.IsFloatVectorType(result_type)) || |
| 317 | _.GetBitWidth(result_type) != 32) |
| 318 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 319 | << "Expected 32-bit float scalar or vector type as Result Type: " |
| 320 | << spvOpcodeString(opcode); |
| 321 | |
| 322 | const uint32_t input_type = _.GetOperandTypeId(inst, operand_index); |
| 323 | if (input_type != result_type) |
| 324 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 325 | << "Expected input type to be equal to Result Type: " |
| 326 | << spvOpcodeString(opcode); |
| 327 | return SPV_SUCCESS; |
| 328 | } |
| 329 | |
| 330 | spv_result_t ValidateConvertPtrToU(ValidationState_t& _, |
| 331 | const Instruction* inst, |
no test coverage detected