| 241 | } |
| 242 | |
| 243 | spv_result_t ValidateVectorTimesScalar(ValidationState_t& _, |
| 244 | const Instruction* inst) { |
| 245 | const spv::Op opcode = inst->opcode(); |
| 246 | const uint32_t result_type = inst->type_id(); |
| 247 | if (!_.IsFloatVectorType(result_type) && |
| 248 | !_.IsFloatCooperativeVectorNVType(result_type)) |
| 249 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 250 | << "Expected float vector type as Result Type: " |
| 251 | << spvOpcodeString(opcode); |
| 252 | |
| 253 | const uint32_t vector_type_id = _.GetOperandTypeId(inst, 2); |
| 254 | if (result_type != vector_type_id) |
| 255 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 256 | << "Expected vector operand type to be equal to Result Type: " |
| 257 | << spvOpcodeString(opcode); |
| 258 | |
| 259 | const uint32_t component_type = _.GetComponentType(vector_type_id); |
| 260 | |
| 261 | const uint32_t scalar_type_id = _.GetOperandTypeId(inst, 3); |
| 262 | if (component_type != scalar_type_id) |
| 263 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 264 | << "Expected scalar operand type to be equal to the component " |
| 265 | << "type of the vector operand: " << spvOpcodeString(opcode); |
| 266 | |
| 267 | return SPV_SUCCESS; |
| 268 | } |
| 269 | |
| 270 | spv_result_t ValidateMatrixTimesScalar(ValidationState_t& _, |
| 271 | const Instruction* inst) { |
no test coverage detected