Lines Matching refs:validate_assert
123 #define validate_assert(state, cond) do { \ macro
134 validate_assert(state, nir_num_components_valid(num_components)); in validate_num_components()
141 validate_assert(state, src->reg.reg != NULL); in validate_reg_src()
145 validate_assert(state, entry); in validate_reg_src()
152 validate_assert(state, state->if_stmt); in validate_reg_src()
156 validate_assert(state, reg_state->where_defined == state->impl && in validate_reg_src()
160 validate_assert(state, src->reg.reg->bit_size & bit_sizes); in validate_reg_src()
162 validate_assert(state, src->reg.reg->num_components == num_components); in validate_reg_src()
164 validate_assert(state, (src->reg.reg->num_array_elems == 0 || in validate_reg_src()
169 validate_assert(state, src->reg.reg->num_array_elems != 0); in validate_reg_src()
170 validate_assert(state, (src->reg.indirect->is_ssa || in validate_reg_src()
184 validate_assert(state, src->ssa != NULL); in validate_ssa_src()
195 validate_assert(state, entry); in validate_ssa_src()
202 validate_assert(state, src->ssa->bit_size & bit_sizes); in validate_ssa_src()
204 validate_assert(state, src->ssa->num_components == num_components); in validate_ssa_src()
214 validate_assert(state, src->parent_instr == state->instr); in validate_src()
216 validate_assert(state, src->parent_if == state->if_stmt); in validate_src()
234 validate_assert(state, src->swizzle[i] < NIR_MAX_VEC_COMPONENTS); in validate_alu_src()
237 validate_assert(state, src->swizzle[i] < num_components); in validate_alu_src()
247 validate_assert(state, dest->reg != NULL); in validate_reg_dest()
249 validate_assert(state, dest->parent_instr == state->instr); in validate_reg_dest()
254 validate_assert(state, entry2); in validate_reg_dest()
259 validate_assert(state, reg_state->where_defined == state->impl && in validate_reg_dest()
263 validate_assert(state, dest->reg->bit_size & bit_sizes); in validate_reg_dest()
265 validate_assert(state, dest->reg->num_components == num_components); in validate_reg_dest()
267 validate_assert(state, (dest->reg->num_array_elems == 0 || in validate_reg_dest()
272 validate_assert(state, dest->reg->num_array_elems != 0); in validate_reg_dest()
273 validate_assert(state, (dest->indirect->is_ssa || dest->indirect->reg.indirect == NULL) && in validate_reg_dest()
282 validate_assert(state, def->index < state->impl->ssa_alloc); in validate_ssa_def()
283 validate_assert(state, !BITSET_TEST(state->ssa_defs_found, def->index)); in validate_ssa_def()
286 validate_assert(state, def->parent_instr == state->instr); in validate_ssa_def()
291 validate_assert(state, src->is_ssa); in validate_ssa_def()
292 validate_assert(state, src->ssa == def); in validate_ssa_def()
296 validate_assert(state, !already_seen); in validate_ssa_def()
301 validate_assert(state, src->is_ssa); in validate_ssa_def()
302 validate_assert(state, src->ssa == def); in validate_ssa_def()
307 validate_assert(state, !already_seen); in validate_ssa_def()
317 validate_assert(state, dest->ssa.bit_size & bit_sizes); in validate_dest()
319 validate_assert(state, dest->ssa.num_components == num_components); in validate_dest()
339 validate_assert(state, !(dest->write_mask & ~((1 << dest_size) - 1))); in validate_alu_dest()
345 validate_assert(state, in validate_alu_dest()
356 validate_assert(state, instr->op < nir_num_opcodes); in validate_alu_instr()
363 validate_assert(state, src_bit_size == nir_alu_type_get_type_size(src_type)); in validate_alu_instr()
365 validate_assert(state, src_bit_size == instr_bit_size); in validate_alu_instr()
372 validate_assert(state, src_bit_size == 16 || src_bit_size == 32 || in validate_alu_instr()
382 validate_assert(state, dest_bit_size == nir_alu_type_get_type_size(dest_type)); in validate_alu_instr()
384 validate_assert(state, dest_bit_size == instr_bit_size); in validate_alu_instr()
391 validate_assert(state, dest_bit_size == 16 || dest_bit_size == 32 || in validate_alu_instr()
402 validate_assert(state, entry); in validate_var_use()
404 validate_assert(state, (nir_function_impl *) entry->data == state->impl); in validate_var_use()
412 validate_assert(state, instr->modes == instr->var->data.mode); in validate_deref_instr()
413 validate_assert(state, instr->type == instr->var->type); in validate_deref_instr()
423 validate_assert(state, util_bitcount(instr->modes) == 1); in validate_deref_instr()
430 validate_assert(state, instr->modes & parent->modes); in validate_deref_instr()
433 validate_assert(state, instr->modes != 0); in validate_deref_instr()
437 validate_assert(state, instr->type); in validate_deref_instr()
439 validate_assert(state, util_is_power_of_two_nonzero(instr->cast.align_mul)); in validate_deref_instr()
440 validate_assert(state, instr->cast.align_offset < instr->cast.align_mul); in validate_deref_instr()
442 validate_assert(state, instr->cast.align_offset == 0); in validate_deref_instr()
446 validate_assert(state, instr->parent.is_ssa); in validate_deref_instr()
457 validate_assert(state, parent_instr->type == nir_instr_type_deref); in validate_deref_instr()
461 validate_assert(state, instr->modes == parent->modes); in validate_deref_instr()
465 validate_assert(state, glsl_type_is_struct_or_ifc(parent->type)); in validate_deref_instr()
466 validate_assert(state, in validate_deref_instr()
468 validate_assert(state, instr->type == in validate_deref_instr()
481 validate_assert(state, glsl_type_is_array(parent->type) || in validate_deref_instr()
486 validate_assert(state, glsl_type_is_array(parent->type) || in validate_deref_instr()
489 validate_assert(state, in validate_deref_instr()
503 validate_assert(state, in validate_deref_instr()
526 validate_assert(state, list_is_empty(&instr->dest.ssa.if_uses)); in validate_deref_instr()
533 validate_assert(state, !(instr->modes & (nir_var_shader_in | in validate_deref_instr()
585 validate_assert(state, dest_bit_size != 0); in validate_intrinsic_instr()
586 validate_assert(state, src_bit_sizes[0] != 0); in validate_intrinsic_instr()
592 validate_assert(state, param_idx < state->impl->function->num_params); in validate_intrinsic_instr()
594 validate_assert(state, instr->num_components == param->num_components); in validate_intrinsic_instr()
602 validate_assert(state, glsl_type_is_vector_or_scalar(src->type) || in validate_intrinsic_instr()
605 validate_assert(state, instr->num_components == in validate_intrinsic_instr()
617 validate_assert(state, glsl_type_is_vector_or_scalar(dst->type)); in validate_intrinsic_instr()
618 validate_assert(state, instr->num_components == in validate_intrinsic_instr()
624 validate_assert(state, !nir_deref_mode_may_be(dst, nir_var_read_only_modes)); in validate_intrinsic_instr()
625 …validate_assert(state, (nir_intrinsic_write_mask(instr) & ~((1 << instr->num_components) - 1)) == … in validate_intrinsic_instr()
632 validate_assert(state, glsl_get_bare_type(dst->type) == in validate_intrinsic_instr()
634 validate_assert(state, !nir_deref_mode_may_be(dst, nir_var_read_only_modes)); in validate_intrinsic_instr()
640 validate_assert(state, bit_size >= 8); in validate_intrinsic_instr()
641 validate_assert(state, (nir_intrinsic_component(instr) + in validate_intrinsic_instr()
648 validate_assert(state, nir_intrinsic_range(instr) != 0); in validate_intrinsic_instr()
657 validate_assert(state, in validate_intrinsic_instr()
659 validate_assert(state, nir_intrinsic_align_offset(instr) < in validate_intrinsic_instr()
671 validate_assert(state, nir_dest_bit_size(instr->dest) >= 8); in validate_intrinsic_instr()
679 validate_assert(state, in validate_intrinsic_instr()
681 validate_assert(state, nir_intrinsic_align_offset(instr) < in validate_intrinsic_instr()
688 validate_assert(state, nir_src_bit_size(instr->src[0]) >= 8); in validate_intrinsic_instr()
693 validate_assert(state, in validate_intrinsic_instr()
726 validate_assert(state, format == PIPE_FORMAT_R32_UINT || in validate_intrinsic_instr()
730 validate_assert(state, nir_dest_bit_size(instr->dest) == in validate_intrinsic_instr()
741 validate_assert(state, format == PIPE_FORMAT_R32_UINT || in validate_intrinsic_instr()
746 validate_assert(state, nir_dest_bit_size(instr->dest) == in validate_intrinsic_instr()
756 validate_assert(state, format == PIPE_FORMAT_COUNT || in validate_intrinsic_instr()
758 validate_assert(state, nir_dest_bit_size(instr->dest) == 32); in validate_intrinsic_instr()
785 validate_assert(state, dest_bit_size & bit_sizes); in validate_intrinsic_instr()
793 validate_assert(state, instr->num_components == 0); in validate_intrinsic_instr()
804 validate_assert(state, !src_type_seen[instr->src[i].src_type]); in validate_tex_instr()
812 validate_assert(state, instr->src[i].src.is_ssa); in validate_tex_instr()
813 validate_assert(state, in validate_tex_instr()
822 validate_assert(state, instr->op == nir_texop_tg4); in validate_tex_instr()
823 validate_assert(state, !src_type_seen[nir_tex_src_offset]); in validate_tex_instr()
832 validate_assert(state, instr->num_params == instr->callee->num_params); in validate_call_instr()
868 validate_assert(state, !"Invalid load_const bit size"); in validate_const_value()
870 validate_assert(state, memcmp(val, &cmp_val, sizeof(cmp_val)) == 0); in validate_const_value()
899 validate_assert(state, exec_list_length(&instr->srcs) == in validate_phi_instr()
907 validate_assert(state, &instr->instr == nir_block_last_instr(block)); in validate_jump_instr()
911 validate_assert(state, block->successors[0] == state->impl->end_block); in validate_jump_instr()
912 validate_assert(state, block->successors[1] == NULL); in validate_jump_instr()
913 validate_assert(state, instr->target == NULL); in validate_jump_instr()
914 validate_assert(state, instr->else_target == NULL); in validate_jump_instr()
918 validate_assert(state, state->impl->structured); in validate_jump_instr()
919 validate_assert(state, state->loop != NULL); in validate_jump_instr()
923 validate_assert(state, block->successors[0] == after); in validate_jump_instr()
925 validate_assert(state, block->successors[1] == NULL); in validate_jump_instr()
926 validate_assert(state, instr->target == NULL); in validate_jump_instr()
927 validate_assert(state, instr->else_target == NULL); in validate_jump_instr()
931 validate_assert(state, state->impl->structured); in validate_jump_instr()
932 validate_assert(state, state->loop != NULL); in validate_jump_instr()
935 validate_assert(state, block->successors[0] == first); in validate_jump_instr()
937 validate_assert(state, block->successors[1] == NULL); in validate_jump_instr()
938 validate_assert(state, instr->target == NULL); in validate_jump_instr()
939 validate_assert(state, instr->else_target == NULL); in validate_jump_instr()
943 validate_assert(state, !state->impl->structured); in validate_jump_instr()
944 validate_assert(state, instr->target == block->successors[0]); in validate_jump_instr()
945 validate_assert(state, instr->target != NULL); in validate_jump_instr()
946 validate_assert(state, instr->else_target == NULL); in validate_jump_instr()
950 validate_assert(state, !state->impl->structured); in validate_jump_instr()
951 validate_assert(state, instr->target == block->successors[1]); in validate_jump_instr()
952 validate_assert(state, instr->else_target == block->successors[0]); in validate_jump_instr()
954 validate_assert(state, instr->target != NULL); in validate_jump_instr()
955 validate_assert(state, instr->else_target != NULL); in validate_jump_instr()
959 validate_assert(state, !"Invalid jump instruction type"); in validate_jump_instr()
967 validate_assert(state, instr->block == state->block); in validate_instr()
1009 validate_assert(state, !"Invalid ALU instruction type"); in validate_instr()
1021 validate_assert(state, instr->dest.is_ssa); in validate_phi_src()
1026 validate_assert(state, src->src.is_ssa); in validate_phi_src()
1033 validate_assert(state, !"Phi does not have a source corresponding to one " in validate_phi_src()
1102 validate_assert(state, _mesa_set_search(state->blocks, in validate_block_predecessors()
1106 validate_assert(state, in validate_block_predecessors()
1114 validate_assert(state, block->predecessors->entries == 0); in validate_block_predecessors()
1118 validate_assert(state, _mesa_set_search(state->blocks, pred)); in validate_block_predecessors()
1119 validate_assert(state, pred->successors[0] == block || in validate_block_predecessors()
1127 validate_assert(state, block->cf_node.parent == state->parent_node); in validate_block()
1134 validate_assert(state, instr == nir_block_first_instr(block) || in validate_block()
1141 validate_assert(state, block->successors[0] != NULL); in validate_block()
1142 validate_assert(state, block->successors[0] != block->successors[1]); in validate_block()
1146 validate_assert(state, nir_block_ends_in_jump(block)); in validate_block()
1153 validate_assert(state, block->successors[0] == first); in validate_block()
1163 validate_assert(state, block->successors[0] == after); in validate_block()
1164 validate_assert(state, block->successors[1] == NULL); in validate_block()
1169 validate_assert(state, block->successors[0] == state->impl->end_block); in validate_block()
1170 validate_assert(state, block->successors[1] == NULL); in validate_block()
1179 validate_assert(state, block->successors[0] == in validate_block()
1181 validate_assert(state, block->successors[1] == in validate_block()
1185 validate_assert(state, block->successors[0] == in validate_block()
1187 validate_assert(state, block->successors[1] == NULL); in validate_block()
1189 validate_assert(state, in validate_block()
1200 validate_assert(state, block->cf_node.parent == &state->impl->cf_node); in validate_end_block()
1203 validate_assert(state, exec_list_is_empty(&block->instr_list)); in validate_end_block()
1205 validate_assert(state, block->successors[0] == NULL); in validate_end_block()
1206 validate_assert(state, block->successors[1] == NULL); in validate_end_block()
1213 validate_assert(state, state->impl->structured); in validate_if()
1217 validate_assert(state, !exec_node_is_head_sentinel(if_stmt->cf_node.node.prev)); in validate_if()
1219 validate_assert(state, prev_node->type == nir_cf_node_block); in validate_if()
1221 validate_assert(state, !exec_node_is_tail_sentinel(if_stmt->cf_node.node.next)); in validate_if()
1223 validate_assert(state, next_node->type == nir_cf_node_block); in validate_if()
1227 validate_assert(state, !exec_list_is_empty(&if_stmt->then_list)); in validate_if()
1228 validate_assert(state, !exec_list_is_empty(&if_stmt->else_list)); in validate_if()
1248 validate_assert(state, state->impl->structured); in validate_loop()
1250 validate_assert(state, !exec_node_is_head_sentinel(loop->cf_node.node.prev)); in validate_loop()
1252 validate_assert(state, prev_node->type == nir_cf_node_block); in validate_loop()
1254 validate_assert(state, !exec_node_is_tail_sentinel(loop->cf_node.node.next)); in validate_loop()
1256 validate_assert(state, next_node->type == nir_cf_node_block); in validate_loop()
1258 validate_assert(state, !exec_list_is_empty(&loop->body)); in validate_loop()
1276 validate_assert(state, node->parent == state->parent_node); in validate_cf_node()
1299 validate_assert(state, reg->index < state->impl->reg_alloc); in prevalidate_reg_decl()
1300 validate_assert(state, !BITSET_TEST(state->regs_found, reg->index)); in prevalidate_reg_decl()
1328 validate_assert(state, entry); in postvalidate_reg_decl()
1331 validate_assert(state, reg_state->uses->entries == 0); in postvalidate_reg_decl()
1335 validate_assert(state, entry); in postvalidate_reg_decl()
1338 validate_assert(state, reg_state->if_uses->entries == 0); in postvalidate_reg_decl()
1342 validate_assert(state, entry); in postvalidate_reg_decl()
1345 validate_assert(state, reg_state->defs->entries == 0); in postvalidate_reg_decl()
1358 validate_assert(state, c->values[i].u64 == 0); in validate_constant()
1360 validate_assert(state, c->num_elements == glsl_get_length(type)); in validate_constant()
1371 validate_assert(state, !"Invalid type for nir_constant"); in validate_constant()
1383 validate_assert(state, util_is_power_of_two_nonzero(var->data.mode)); in validate_var_decl()
1384 validate_assert(state, var->data.mode & valid_modes); in validate_var_decl()
1401 validate_assert(state, glsl_type_is_struct_or_ifc(without_array)); in validate_var_decl()
1402 validate_assert(state, var->num_members == glsl_get_length(without_array)); in validate_var_decl()
1403 validate_assert(state, var->members != NULL); in validate_var_decl()
1407 validate_assert(state, glsl_type_is_array(var->type)); in validate_var_decl()
1429 validate_assert(state, def->index < state->impl->ssa_alloc); in validate_ssa_def_dominance()
1430 validate_assert(state, !BITSET_TEST(state->ssa_defs_found, def->index)); in validate_ssa_def_dominance()
1444 validate_assert(state, src->ssa->index < state->impl->ssa_alloc); in validate_src_dominance()
1445 validate_assert(state, BITSET_TEST(state->ssa_defs_found, in validate_src_dominance()
1448 validate_assert(state, nir_block_dominates(src->ssa->parent_instr->block, in validate_src_dominance()
1466 validate_assert(state, in validate_ssa_dominance()
1490 validate_assert(state, impl->function->impl == impl); in validate_function_impl()
1491 validate_assert(state, impl->cf_node.parent == NULL); in validate_function_impl()
1493 validate_assert(state, exec_list_is_empty(&impl->end_block->instr_list)); in validate_function_impl()
1494 validate_assert(state, impl->end_block->successors[0] == NULL); in validate_function_impl()
1495 validate_assert(state, impl->end_block->successors[1] == NULL); in validate_function_impl()
1522 validate_assert(state, !exec_list_is_empty(&impl->body)); in validate_function_impl()
1532 validate_assert(state, state->ssa_srcs->entries == 0); in validate_function_impl()
1548 validate_assert(state, func->impl->function == func); in validate_function()