Lines Matching refs:_
29 spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { in ConversionPass() argument
35 if (!_.IsUnsignedIntScalarType(result_type) && in ConversionPass()
36 !_.IsUnsignedIntVectorType(result_type) && in ConversionPass()
37 !_.IsUnsignedIntCooperativeMatrixType(result_type)) in ConversionPass()
38 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
42 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
43 if (!input_type || (!_.IsFloatScalarType(input_type) && in ConversionPass()
44 !_.IsFloatVectorType(input_type) && in ConversionPass()
45 !_.IsFloatCooperativeMatrixType(input_type))) in ConversionPass()
46 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
50 if (_.IsCooperativeMatrixType(result_type) || in ConversionPass()
51 _.IsCooperativeMatrixType(input_type)) { in ConversionPass()
53 _.CooperativeMatrixShapesMatch(inst, result_type, input_type); in ConversionPass()
56 if (_.GetDimension(result_type) != _.GetDimension(input_type)) in ConversionPass()
57 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
66 if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) && in ConversionPass()
67 !_.IsIntCooperativeMatrixType(result_type)) in ConversionPass()
68 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
72 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
73 if (!input_type || (!_.IsFloatScalarType(input_type) && in ConversionPass()
74 !_.IsFloatVectorType(input_type) && in ConversionPass()
75 !_.IsFloatCooperativeMatrixType(input_type))) in ConversionPass()
76 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
80 if (_.IsCooperativeMatrixType(result_type) || in ConversionPass()
81 _.IsCooperativeMatrixType(input_type)) { in ConversionPass()
83 _.CooperativeMatrixShapesMatch(inst, result_type, input_type); in ConversionPass()
86 if (_.GetDimension(result_type) != _.GetDimension(input_type)) in ConversionPass()
87 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
97 if (!_.IsFloatScalarType(result_type) && in ConversionPass()
98 !_.IsFloatVectorType(result_type) && in ConversionPass()
99 !_.IsFloatCooperativeMatrixType(result_type)) in ConversionPass()
100 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
104 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
106 (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type) && in ConversionPass()
107 !_.IsIntCooperativeMatrixType(input_type))) in ConversionPass()
108 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
112 if (_.IsCooperativeMatrixType(result_type) || in ConversionPass()
113 _.IsCooperativeMatrixType(input_type)) { in ConversionPass()
115 _.CooperativeMatrixShapesMatch(inst, result_type, input_type); in ConversionPass()
118 if (_.GetDimension(result_type) != _.GetDimension(input_type)) in ConversionPass()
119 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
128 if (!_.IsUnsignedIntScalarType(result_type) && in ConversionPass()
129 !_.IsUnsignedIntVectorType(result_type) && in ConversionPass()
130 !_.IsUnsignedIntCooperativeMatrixType(result_type)) in ConversionPass()
131 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
135 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
137 (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type) && in ConversionPass()
138 !_.IsIntCooperativeMatrixType(input_type))) in ConversionPass()
139 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
143 if (_.IsCooperativeMatrixType(result_type) || in ConversionPass()
144 _.IsCooperativeMatrixType(input_type)) { in ConversionPass()
146 _.CooperativeMatrixShapesMatch(inst, result_type, input_type); in ConversionPass()
149 if (_.GetDimension(result_type) != _.GetDimension(input_type)) in ConversionPass()
150 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
155 if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) in ConversionPass()
156 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
164 if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) && in ConversionPass()
165 !_.IsIntCooperativeMatrixType(result_type)) in ConversionPass()
166 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
170 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
172 (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type) && in ConversionPass()
173 !_.IsIntCooperativeMatrixType(input_type))) in ConversionPass()
174 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
178 if (_.IsCooperativeMatrixType(result_type) || in ConversionPass()
179 _.IsCooperativeMatrixType(input_type)) { in ConversionPass()
181 _.CooperativeMatrixShapesMatch(inst, result_type, input_type); in ConversionPass()
184 if (_.GetDimension(result_type) != _.GetDimension(input_type)) in ConversionPass()
185 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
190 if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) in ConversionPass()
191 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
199 if (!_.IsFloatScalarType(result_type) && in ConversionPass()
200 !_.IsFloatVectorType(result_type) && in ConversionPass()
201 !_.IsFloatCooperativeMatrixType(result_type)) in ConversionPass()
202 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
206 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
207 if (!input_type || (!_.IsFloatScalarType(input_type) && in ConversionPass()
208 !_.IsFloatVectorType(input_type) && in ConversionPass()
209 !_.IsFloatCooperativeMatrixType(input_type))) in ConversionPass()
210 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
214 if (_.IsCooperativeMatrixType(result_type) || in ConversionPass()
215 _.IsCooperativeMatrixType(input_type)) { in ConversionPass()
217 _.CooperativeMatrixShapesMatch(inst, result_type, input_type); in ConversionPass()
220 if (_.GetDimension(result_type) != _.GetDimension(input_type)) in ConversionPass()
221 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
226 if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) in ConversionPass()
227 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
235 if ((!_.IsFloatScalarType(result_type) && in ConversionPass()
236 !_.IsFloatVectorType(result_type)) || in ConversionPass()
237 _.GetBitWidth(result_type) != 32) in ConversionPass()
238 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
242 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
244 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
251 if (!_.IsUnsignedIntScalarType(result_type)) in ConversionPass()
252 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
256 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
257 if (!_.IsPointerType(input_type)) in ConversionPass()
258 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
261 if (_.addressing_model() == SpvAddressingModelLogical) in ConversionPass()
262 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
266 if (_.addressing_model() == SpvAddressingModelPhysicalStorageBuffer64) { in ConversionPass()
269 _.GetPointerTypeInfo(input_type, &input_data_type, in ConversionPass()
272 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
276 if (spvIsVulkanEnv(_.context()->target_env)) { in ConversionPass()
277 if (_.GetBitWidth(result_type) != 64) { in ConversionPass()
278 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
279 << _.VkErrorID(4710) in ConversionPass()
291 if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) in ConversionPass()
292 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
296 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
298 (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type))) in ConversionPass()
299 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
303 if (_.GetDimension(result_type) != _.GetDimension(input_type)) in ConversionPass()
304 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
311 if (!_.IsPointerType(result_type)) in ConversionPass()
312 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
316 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
317 if (!input_type || !_.IsIntScalarType(input_type)) in ConversionPass()
318 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
321 if (_.addressing_model() == SpvAddressingModelLogical) in ConversionPass()
322 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
326 if (_.addressing_model() == SpvAddressingModelPhysicalStorageBuffer64) { in ConversionPass()
329 _.GetPointerTypeInfo(result_type, &result_data_type, in ConversionPass()
332 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
336 if (spvIsVulkanEnv(_.context()->target_env)) { in ConversionPass()
337 if (_.GetBitWidth(input_type) != 64) { in ConversionPass()
338 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
339 << _.VkErrorID(4710) in ConversionPass()
352 if (!_.GetPointerTypeInfo(result_type, &result_data_type, in ConversionPass()
354 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
359 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
363 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
366 if (!_.GetPointerTypeInfo(input_type, &input_data_type, in ConversionPass()
368 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
374 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
379 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
388 if (!_.GetPointerTypeInfo(result_type, &result_data_type, in ConversionPass()
390 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
397 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
401 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
404 if (!_.GetPointerTypeInfo(input_type, &input_data_type, in ConversionPass()
406 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
410 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
415 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
424 if (!_.GetPointerTypeInfo(result_type, &result_data_type, in ConversionPass()
426 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
432 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
436 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
439 if (!_.GetPointerTypeInfo(input_type, &input_data_type, in ConversionPass()
441 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
445 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
450 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
457 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
464 const uint32_t input_type = _.GetOperandTypeId(inst, 2); in ConversionPass()
466 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
469 const bool result_is_pointer = _.IsPointerType(result_type); in ConversionPass()
470 const bool result_is_int_scalar = _.IsIntScalarType(result_type); in ConversionPass()
471 const bool input_is_pointer = _.IsPointerType(input_type); in ConversionPass()
472 const bool input_is_int_scalar = _.IsIntScalarType(input_type); in ConversionPass()
475 !_.IsIntVectorType(result_type) && in ConversionPass()
476 !_.IsFloatScalarType(result_type) && in ConversionPass()
477 !_.IsFloatVectorType(result_type)) in ConversionPass()
478 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
483 !_.IsIntVectorType(input_type) && !_.IsFloatScalarType(input_type) && in ConversionPass()
484 !_.IsFloatVectorType(input_type)) in ConversionPass()
485 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
489 if (_.version() >= SPV_SPIRV_VERSION_WORD(1, 5) || in ConversionPass()
490 _.HasExtension(kSPV_KHR_physical_storage_buffer)) { in ConversionPass()
491 const bool result_is_int_vector = _.IsIntVectorType(result_type); in ConversionPass()
493 _.ContainsSizedIntOrFloatType(result_type, SpvOpTypeInt, 32); in ConversionPass()
494 const bool input_is_int_vector = _.IsIntVectorType(input_type); in ConversionPass()
496 _.ContainsSizedIntOrFloatType(input_type, SpvOpTypeInt, 32); in ConversionPass()
499 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
506 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
512 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
518 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
526 _.GetBitWidth(result_type) * _.GetDimension(result_type); in ConversionPass()
528 _.GetBitWidth(input_type) * _.GetDimension(input_type); in ConversionPass()
530 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()
541 if (_.HasCapability(SpvCapabilityShader)) { in ConversionPass()
548 if (_.ContainsLimitedUseIntOrFloatType(inst->type_id()) || in ConversionPass()
549 _.ContainsLimitedUseIntOrFloatType(_.GetOperandTypeId(inst, 2u))) { in ConversionPass()
550 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ConversionPass()