Lines Matching full:_
37 uint32_t GetSizeTBitWidth(const ValidationState_t& _) { in GetSizeTBitWidth() argument
38 if (_.addressing_model() == SpvAddressingModelPhysical32) return 32; in GetSizeTBitWidth()
40 if (_.addressing_model() == SpvAddressingModelPhysical64) return 64; in GetSizeTBitWidth()
47 spv_result_t ValidateExtension(ValidationState_t& _, const Instruction* inst) { in ValidateExtension() argument
48 if (spvIsWebGPUEnv(_.context()->target_env)) { in ValidateExtension()
52 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtension()
62 spv_result_t ValidateExtInstImport(ValidationState_t& _, in ValidateExtInstImport() argument
64 if (spvIsWebGPUEnv(_.context()->target_env)) { in ValidateExtInstImport()
69 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInstImport()
78 spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { in ValidateExtInst() argument
87 auto ext_inst_name = [&_, ext_inst_set, ext_inst_type, ext_inst_index]() { in ValidateExtInst()
89 if (_.grammar().lookupExtInst(ext_inst_type, ext_inst_index, &desc) != in ValidateExtInst()
95 auto* import_inst = _.FindDef(ext_inst_set); in ValidateExtInst()
132 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
133 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
140 const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); in ValidateExtInst()
142 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
162 if (!_.IsIntScalarOrVectorType(result_type)) { in ValidateExtInst()
163 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
168 const uint32_t result_type_bit_width = _.GetBitWidth(result_type); in ValidateExtInst()
169 const uint32_t result_type_dimension = _.GetDimension(result_type); in ValidateExtInst()
173 const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); in ValidateExtInst()
174 if (!_.IsIntScalarOrVectorType(operand_type)) { in ValidateExtInst()
175 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
180 if (result_type_dimension != _.GetDimension(operand_type)) { in ValidateExtInst()
181 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
187 if (result_type_bit_width != _.GetBitWidth(operand_type)) { in ValidateExtInst()
188 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
197 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
227 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
228 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
234 const uint32_t result_type_bit_width = _.GetBitWidth(result_type); in ValidateExtInst()
236 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
244 const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); in ValidateExtInst()
246 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
256 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
261 if (!_.GetMatrixTypeInfo(x_type, &num_rows, &num_cols, &col_type, in ValidateExtInst()
264 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
270 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
283 if (!_.GetMatrixTypeInfo(result_type, &num_rows, &num_cols, &col_type, in ValidateExtInst()
286 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
291 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
293 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
301 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
302 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
307 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
308 const uint32_t i_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
311 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
318 if (!_.GetPointerTypeInfo(i_type, &i_data_type, &i_storage_class)) { in ValidateExtInst()
319 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
325 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
335 if (!_.GetStructMemberTypes(result_type, &result_types) || in ValidateExtInst()
337 !_.IsFloatScalarOrVectorType(result_types[0]) || in ValidateExtInst()
339 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
345 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
347 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
356 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
357 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
362 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
363 const uint32_t exp_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
366 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
373 if (!_.GetPointerTypeInfo(exp_type, &exp_data_type, in ValidateExtInst()
375 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
380 if (!_.IsIntScalarOrVectorType(exp_data_type) || in ValidateExtInst()
381 (!_.HasExtension(kSPV_AMD_gpu_shader_int16) && in ValidateExtInst()
382 _.GetBitWidth(exp_data_type) != 32) || in ValidateExtInst()
383 (_.HasExtension(kSPV_AMD_gpu_shader_int16) && in ValidateExtInst()
384 _.GetBitWidth(exp_data_type) != 16 && in ValidateExtInst()
385 _.GetBitWidth(exp_data_type) != 32)) { in ValidateExtInst()
386 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
389 << (_.HasExtension(kSPV_AMD_gpu_shader_int16) in ValidateExtInst()
395 if (_.GetDimension(result_type) != _.GetDimension(exp_data_type)) { in ValidateExtInst()
396 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
406 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
407 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
412 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
413 const uint32_t exp_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
416 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
421 if (!_.IsIntScalarOrVectorType(exp_type)) { in ValidateExtInst()
422 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
428 if (_.GetDimension(result_type) != _.GetDimension(exp_type)) { in ValidateExtInst()
429 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
440 if (!_.GetStructMemberTypes(result_type, &result_types) || in ValidateExtInst()
442 !_.IsFloatScalarOrVectorType(result_types[0]) || in ValidateExtInst()
443 !_.IsIntScalarOrVectorType(result_types[1]) || in ValidateExtInst()
444 (!_.HasExtension(kSPV_AMD_gpu_shader_int16) && in ValidateExtInst()
445 _.GetBitWidth(result_types[1]) != 32) || in ValidateExtInst()
446 (_.HasExtension(kSPV_AMD_gpu_shader_int16) && in ValidateExtInst()
447 _.GetBitWidth(result_types[1]) != 16 && in ValidateExtInst()
448 _.GetBitWidth(result_types[1]) != 32) || in ValidateExtInst()
449 _.GetDimension(result_types[0]) != in ValidateExtInst()
450 _.GetDimension(result_types[1])) { in ValidateExtInst()
451 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
455 << (_.HasExtension(kSPV_AMD_gpu_shader_int16) in ValidateExtInst()
462 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
464 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
474 if (!_.IsIntScalarType(result_type) || in ValidateExtInst()
475 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
476 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
481 const uint32_t v_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
482 if (!_.IsFloatVectorType(v_type) || _.GetDimension(v_type) != 4 || in ValidateExtInst()
483 _.GetBitWidth(v_type) != 32) { in ValidateExtInst()
484 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
494 if (!_.IsIntScalarType(result_type) || in ValidateExtInst()
495 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
496 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
501 const uint32_t v_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
502 if (!_.IsFloatVectorType(v_type) || _.GetDimension(v_type) != 2 || in ValidateExtInst()
503 _.GetBitWidth(v_type) != 32) { in ValidateExtInst()
504 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
512 if (!_.IsFloatScalarType(result_type) || in ValidateExtInst()
513 _.GetBitWidth(result_type) != 64) { in ValidateExtInst()
514 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
519 const uint32_t v_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
520 if (!_.IsIntVectorType(v_type) || _.GetDimension(v_type) != 2 || in ValidateExtInst()
521 _.GetBitWidth(v_type) != 32) { in ValidateExtInst()
522 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
531 if (!_.IsFloatVectorType(result_type) || in ValidateExtInst()
532 _.GetDimension(result_type) != 4 || in ValidateExtInst()
533 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
534 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
540 const uint32_t v_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
541 if (!_.IsIntScalarType(v_type) || _.GetBitWidth(v_type) != 32) { in ValidateExtInst()
542 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
552 if (!_.IsFloatVectorType(result_type) || in ValidateExtInst()
553 _.GetDimension(result_type) != 2 || in ValidateExtInst()
554 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
555 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
561 const uint32_t v_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
562 if (!_.IsIntScalarType(v_type) || _.GetBitWidth(v_type) != 32) { in ValidateExtInst()
563 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
571 if (!_.IsIntVectorType(result_type) || in ValidateExtInst()
572 _.GetDimension(result_type) != 2 || in ValidateExtInst()
573 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
574 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
580 const uint32_t v_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
581 if (!_.IsFloatScalarType(v_type) || _.GetBitWidth(v_type) != 64) { in ValidateExtInst()
582 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
590 if (!_.IsFloatScalarType(result_type)) { in ValidateExtInst()
591 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
596 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
597 if (!_.IsFloatScalarOrVectorType(x_type)) { in ValidateExtInst()
598 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
603 if (result_type != _.GetComponentType(x_type)) { in ValidateExtInst()
604 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
613 if (!_.IsFloatScalarType(result_type)) { in ValidateExtInst()
614 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
619 const uint32_t p0_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
620 if (!_.IsFloatScalarOrVectorType(p0_type)) { in ValidateExtInst()
621 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
626 if (result_type != _.GetComponentType(p0_type)) { in ValidateExtInst()
627 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
633 const uint32_t p1_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
634 if (!_.IsFloatScalarOrVectorType(p1_type)) { in ValidateExtInst()
635 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
640 if (result_type != _.GetComponentType(p1_type)) { in ValidateExtInst()
641 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
647 if (_.GetDimension(p0_type) != _.GetDimension(p1_type)) { in ValidateExtInst()
648 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
657 if (!_.IsFloatVectorType(result_type)) { in ValidateExtInst()
658 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
663 if (_.GetDimension(result_type) != 3) { in ValidateExtInst()
664 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
669 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
670 const uint32_t y_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
673 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
679 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
687 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
688 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
693 const uint32_t i_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
694 const uint32_t n_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
695 const uint32_t eta_type = _.GetOperandTypeId(inst, 6); in ValidateExtInst()
698 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
704 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
709 if (!_.IsFloatScalarType(eta_type)) { in ValidateExtInst()
710 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
720 if (!_.HasCapability(SpvCapabilityInterpolationFunction)) { in ValidateExtInst()
721 return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst) in ValidateExtInst()
726 if (!_.IsFloatScalarOrVectorType(result_type) || in ValidateExtInst()
727 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
728 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
734 const uint32_t interpolant_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
737 if (!_.GetPointerTypeInfo(interpolant_type, &interpolant_data_type, in ValidateExtInst()
739 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
745 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
751 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
757 const uint32_t sample_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
758 if (!_.IsIntScalarType(sample_type) || in ValidateExtInst()
759 _.GetBitWidth(sample_type) != 32) { in ValidateExtInst()
760 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
767 const uint32_t offset_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
768 if (!_.IsFloatVectorType(offset_type) || in ValidateExtInst()
769 _.GetDimension(offset_type) != 2 || in ValidateExtInst()
770 _.GetBitWidth(offset_type) != 32) { in ValidateExtInst()
771 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
777 _.function(inst->function()->id()) in ValidateExtInst()
786 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
791 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
897 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
898 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
903 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
905 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
913 const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); in ValidateExtInst()
915 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
928 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
929 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
934 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
936 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
943 const uint32_t x_type = _.GetOperandTypeId(inst, operand_index++); in ValidateExtInst()
945 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
951 const uint32_t y_type = _.GetOperandTypeId(inst, operand_index++); in ValidateExtInst()
953 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
959 const uint32_t p_type = _.GetOperandTypeId(inst, operand_index++); in ValidateExtInst()
962 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
963 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
972 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
979 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
989 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
990 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
995 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
997 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1003 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1005 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1010 const uint32_t p_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1013 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
1014 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1023 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1029 if (!_.IsIntScalarOrVectorType(p_data_type) || in ValidateExtInst()
1030 _.GetBitWidth(p_data_type) != 32) { in ValidateExtInst()
1031 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1037 if (_.GetDimension(p_data_type) != num_components) { in ValidateExtInst()
1038 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1047 if (!_.IsIntScalarOrVectorType(result_type) || in ValidateExtInst()
1048 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
1049 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1055 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1057 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1063 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1064 if (!_.IsFloatScalarOrVectorType(x_type)) { in ValidateExtInst()
1065 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1070 if (_.GetDimension(x_type) != num_components) { in ValidateExtInst()
1071 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1082 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
1083 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1088 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1090 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1096 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1098 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1103 const uint32_t exp_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1104 if (!_.IsIntScalarOrVectorType(exp_type) || in ValidateExtInst()
1105 _.GetBitWidth(exp_type) != 32) { in ValidateExtInst()
1106 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1111 if (_.GetDimension(exp_type) != num_components) { in ValidateExtInst()
1112 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1121 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
1122 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1127 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1129 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1135 const uint32_t nancode_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1136 if (!_.IsIntScalarOrVectorType(nancode_type)) { in ValidateExtInst()
1137 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1142 if (_.GetDimension(nancode_type) != num_components) { in ValidateExtInst()
1143 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1149 if (_.GetBitWidth(result_type) != _.GetBitWidth(nancode_type)) { in ValidateExtInst()
1150 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1186 if (!_.IsIntScalarOrVectorType(result_type)) { in ValidateExtInst()
1187 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1192 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1194 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1202 const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); in ValidateExtInst()
1204 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1215 if (!_.IsIntScalarOrVectorType(result_type)) { in ValidateExtInst()
1216 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1222 const uint32_t result_num_components = _.GetDimension(result_type); in ValidateExtInst()
1225 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1231 const uint32_t result_bit_width = _.GetBitWidth(result_type); in ValidateExtInst()
1234 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1240 const uint32_t hi_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1241 const uint32_t lo_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1244 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1249 if (result_num_components != _.GetDimension(hi_type)) { in ValidateExtInst()
1250 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1256 if (result_bit_width != 2 * _.GetBitWidth(hi_type)) { in ValidateExtInst()
1257 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1269 if (!_.IsIntScalarOrVectorType(result_type) || in ValidateExtInst()
1270 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
1271 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1277 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1279 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1287 const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); in ValidateExtInst()
1289 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1299 if (!_.IsFloatVectorType(result_type)) { in ValidateExtInst()
1300 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1305 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1307 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1312 const uint32_t x_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1313 const uint32_t y_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1316 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1322 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1331 if (!_.IsFloatScalarType(result_type)) { in ValidateExtInst()
1332 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1337 const uint32_t p0_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1338 if (!_.IsFloatScalarOrVectorType(p0_type)) { in ValidateExtInst()
1339 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1344 const uint32_t num_components = _.GetDimension(p0_type); in ValidateExtInst()
1346 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1351 if (result_type != _.GetComponentType(p0_type)) { in ValidateExtInst()
1352 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1358 const uint32_t p1_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1360 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1369 if (!_.IsFloatScalarType(result_type)) { in ValidateExtInst()
1370 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1375 const uint32_t p_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1376 if (!_.IsFloatScalarOrVectorType(p_type)) { in ValidateExtInst()
1377 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1382 const uint32_t num_components = _.GetDimension(p_type); in ValidateExtInst()
1384 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1389 if (result_type != _.GetComponentType(p_type)) { in ValidateExtInst()
1390 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1400 if (!_.IsFloatScalarOrVectorType(result_type)) { in ValidateExtInst()
1401 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1406 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1408 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1413 const uint32_t p_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1415 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1423 if (!_.IsFloatScalarOrVectorType(result_type) && in ValidateExtInst()
1424 !_.IsIntScalarOrVectorType(result_type)) { in ValidateExtInst()
1425 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1431 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1433 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1441 const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); in ValidateExtInst()
1443 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1453 if (!_.IsFloatScalarOrVectorType(result_type) && in ValidateExtInst()
1454 !_.IsIntScalarOrVectorType(result_type)) { in ValidateExtInst()
1455 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1461 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1463 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1469 const uint32_t a_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1470 const uint32_t b_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1471 const uint32_t c_type = _.GetOperandTypeId(inst, 6); in ValidateExtInst()
1474 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1480 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1485 if (!_.IsIntScalarOrVectorType(c_type)) { in ValidateExtInst()
1486 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1491 if (num_components != _.GetDimension(c_type)) { in ValidateExtInst()
1492 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1498 if (_.GetBitWidth(result_type) != _.GetBitWidth(c_type)) { in ValidateExtInst()
1499 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1508 if (!_.IsFloatVectorType(result_type) && in ValidateExtInst()
1509 !_.IsIntVectorType(result_type)) { in ValidateExtInst()
1510 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1515 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1517 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1522 const uint32_t offset_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1523 const uint32_t p_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1525 const uint32_t size_t_bit_width = GetSizeTBitWidth(_); in ValidateExtInst()
1527 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1532 if (!_.IsIntScalarType(offset_type) || in ValidateExtInst()
1533 _.GetBitWidth(offset_type) != size_t_bit_width) { in ValidateExtInst()
1534 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1543 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
1544 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1551 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1557 if (_.GetComponentType(result_type) != p_data_type) { in ValidateExtInst()
1558 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1566 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1575 if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { in ValidateExtInst()
1576 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1580 const uint32_t data_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1581 const uint32_t offset_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1582 const uint32_t p_type = _.GetOperandTypeId(inst, 6); in ValidateExtInst()
1584 if (!_.IsFloatVectorType(data_type) && !_.IsIntVectorType(data_type)) { in ValidateExtInst()
1585 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1590 const uint32_t num_components = _.GetDimension(data_type); in ValidateExtInst()
1592 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1597 const uint32_t size_t_bit_width = GetSizeTBitWidth(_); in ValidateExtInst()
1599 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1604 if (!_.IsIntScalarType(offset_type) || in ValidateExtInst()
1605 _.GetBitWidth(offset_type) != size_t_bit_width) { in ValidateExtInst()
1606 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1615 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
1616 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1622 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1627 if (_.GetComponentType(data_type) != p_data_type) { in ValidateExtInst()
1628 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1637 if (!_.IsFloatScalarType(result_type)) { in ValidateExtInst()
1638 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1643 const uint32_t offset_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1644 const uint32_t p_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1646 const uint32_t size_t_bit_width = GetSizeTBitWidth(_); in ValidateExtInst()
1648 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1653 if (!_.IsIntScalarType(offset_type) || in ValidateExtInst()
1654 _.GetBitWidth(offset_type) != size_t_bit_width) { in ValidateExtInst()
1655 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1664 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
1665 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1675 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1681 if (!_.IsFloatScalarType(p_data_type) || in ValidateExtInst()
1682 _.GetBitWidth(p_data_type) != 16) { in ValidateExtInst()
1683 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1692 if (!_.IsFloatVectorType(result_type)) { in ValidateExtInst()
1693 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1698 const uint32_t num_components = _.GetDimension(result_type); in ValidateExtInst()
1700 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1705 const uint32_t offset_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1706 const uint32_t p_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1708 const uint32_t size_t_bit_width = GetSizeTBitWidth(_); in ValidateExtInst()
1710 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1715 if (!_.IsIntScalarType(offset_type) || in ValidateExtInst()
1716 _.GetBitWidth(offset_type) != size_t_bit_width) { in ValidateExtInst()
1717 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1726 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
1727 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1737 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1743 if (!_.IsFloatScalarType(p_data_type) || in ValidateExtInst()
1744 _.GetBitWidth(p_data_type) != 16) { in ValidateExtInst()
1745 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1752 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1766 if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { in ValidateExtInst()
1767 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1771 const uint32_t data_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1772 const uint32_t offset_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1773 const uint32_t p_type = _.GetOperandTypeId(inst, 6); in ValidateExtInst()
1774 const uint32_t data_type_bit_width = _.GetBitWidth(data_type); in ValidateExtInst()
1778 if (!_.IsFloatScalarType(data_type) || in ValidateExtInst()
1780 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1785 if (!_.IsFloatVectorType(data_type) || in ValidateExtInst()
1787 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1792 const uint32_t num_components = _.GetDimension(data_type); in ValidateExtInst()
1795 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1801 const uint32_t size_t_bit_width = GetSizeTBitWidth(_); in ValidateExtInst()
1803 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1808 if (!_.IsIntScalarType(offset_type) || in ValidateExtInst()
1809 _.GetBitWidth(offset_type) != size_t_bit_width) { in ValidateExtInst()
1810 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1819 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
1820 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1829 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1835 if (!_.IsFloatScalarType(p_data_type) || in ValidateExtInst()
1836 _.GetBitWidth(p_data_type) != 16) { in ValidateExtInst()
1837 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1848 if (!_.IsFloatVectorType(result_type) && in ValidateExtInst()
1849 !_.IsIntVectorType(result_type)) { in ValidateExtInst()
1850 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1855 const uint32_t result_num_components = _.GetDimension(result_type); in ValidateExtInst()
1858 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1864 const uint32_t x_type = _.GetOperandTypeId(inst, operand_index++); in ValidateExtInst()
1867 const uint32_t y_type = _.GetOperandTypeId(inst, operand_index++); in ValidateExtInst()
1869 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1876 _.GetOperandTypeId(inst, operand_index++); in ValidateExtInst()
1878 if (!_.IsFloatVectorType(x_type) && !_.IsIntVectorType(x_type)) { in ValidateExtInst()
1879 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1884 const uint32_t x_num_components = _.GetDimension(x_type); in ValidateExtInst()
1887 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1892 const uint32_t result_component_type = _.GetComponentType(result_type); in ValidateExtInst()
1894 if (result_component_type != _.GetComponentType(x_type)) { in ValidateExtInst()
1895 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1901 if (!_.IsIntVectorType(shuffle_mask_type)) { in ValidateExtInst()
1902 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1907 if (result_num_components != _.GetDimension(shuffle_mask_type)) { in ValidateExtInst()
1908 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1914 if (_.GetBitWidth(result_component_type) != in ValidateExtInst()
1915 _.GetBitWidth(shuffle_mask_type)) { in ValidateExtInst()
1916 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1925 if (!_.IsIntScalarType(result_type) || in ValidateExtInst()
1926 _.GetBitWidth(result_type) != 32) { in ValidateExtInst()
1927 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1932 const uint32_t format_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1935 if (!_.GetPointerTypeInfo(format_type, &format_data_type, in ValidateExtInst()
1937 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1943 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1948 if (!_.IsIntScalarType(format_data_type) || in ValidateExtInst()
1949 _.GetBitWidth(format_data_type) != 8) { in ValidateExtInst()
1950 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1958 if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { in ValidateExtInst()
1959 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1963 const uint32_t p_type = _.GetOperandTypeId(inst, 4); in ValidateExtInst()
1964 const uint32_t num_elements_type = _.GetOperandTypeId(inst, 5); in ValidateExtInst()
1968 if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { in ValidateExtInst()
1969 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1975 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1980 if (!_.IsFloatScalarOrVectorType(p_data_type) && in ValidateExtInst()
1981 !_.IsIntScalarOrVectorType(p_data_type)) { in ValidateExtInst()
1982 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1988 const uint32_t num_components = _.GetDimension(p_data_type); in ValidateExtInst()
1990 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
1996 const uint32_t size_t_bit_width = GetSizeTBitWidth(_); in ValidateExtInst()
1998 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
2003 if (!_.IsIntScalarType(num_elements_type) || in ValidateExtInst()
2004 _.GetBitWidth(num_elements_type) != size_t_bit_width) { in ValidateExtInst()
2005 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateExtInst()
2019 spv_result_t ExtensionPass(ValidationState_t& _, const Instruction* inst) { in ExtensionPass() argument
2021 if (opcode == SpvOpExtension) return ValidateExtension(_, inst); in ExtensionPass()
2022 if (opcode == SpvOpExtInstImport) return ValidateExtInstImport(_, inst); in ExtensionPass()
2023 if (opcode == SpvOpExtInst) return ValidateExtInst(_, inst); in ExtensionPass()