Lines Matching refs:instr
72 validate_src(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr,
76 validate_assert(ctx, ir3_valid_immediate(instr, reg->iim_val));
83 validate_assert(ctx, _mesa_set_search(ctx->defs, src->instr));
90 foreach_dst (dst, instr) {
130 validate_dst(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr,
142 foreach_src (src, instr) {
153 validate_assert(ctx, reg->instr == instr);
156 validate_assert(ctx, instr->address);
164 validate_instr(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr)
168 foreach_src_n (reg, n, instr) {
170 validate_assert(ctx, instr->address);
172 validate_src(ctx, instr, reg);
185 } else if (reg == instr->address) {
187 } else if ((instr->flags & IR3_INSTR_S2EN) && (n < 2)) {
189 if (instr->flags & IR3_INSTR_B)
194 } else if (opc_cat(instr->opc) == 1 || opc_cat(instr->opc) == 6) {
196 } else if (opc_cat(instr->opc) == 0) {
198 } else if (instr->opc == OPC_META_PARALLEL_COPY) {
202 } else if (instr->opc == OPC_ANY_MACRO || instr->opc == OPC_ALL_MACRO ||
203 instr->opc == OPC_READ_FIRST_MACRO ||
204 instr->opc == OPC_READ_COND_MACRO) {
214 for (unsigned i = 0; i < instr->dsts_count; i++) {
215 struct ir3_register *reg = instr->dsts[i];
217 validate_dst(ctx, instr, reg);
220 _mesa_set_add(ctx->defs, instr);
226 switch (opc_cat(instr->opc)) {
228 if (instr->opc == OPC_MOVMSK || instr->opc == OPC_BALLOT_MACRO) {
229 validate_assert(ctx, instr->dsts_count == 1);
230 validate_assert(ctx, instr->dsts[0]->flags & IR3_REG_SHARED);
231 validate_assert(ctx, !(instr->dsts[0]->flags & IR3_REG_HALF));
233 ctx, util_is_power_of_two_or_zero(instr->dsts[0]->wrmask + 1));
234 } else if (instr->opc == OPC_ANY_MACRO || instr->opc == OPC_ALL_MACRO ||
235 instr->opc == OPC_READ_FIRST_MACRO ||
236 instr->opc == OPC_READ_COND_MACRO) {
238 } else if (instr->opc == OPC_ELECT_MACRO || instr->opc == OPC_SHPS_MACRO) {
239 validate_assert(ctx, instr->dsts_count == 1);
240 validate_assert(ctx, !(instr->dsts[0]->flags & IR3_REG_SHARED));
241 } else if (instr->opc == OPC_SCAN_MACRO) {
242 validate_assert(ctx, instr->dsts_count == 3);
243 validate_assert(ctx, instr->srcs_count == 2);
244 validate_assert(ctx, reg_class_flags(instr->dsts[0]) ==
245 reg_class_flags(instr->srcs[0]));
246 validate_assert(ctx, reg_class_flags(instr->dsts[1]) ==
247 reg_class_flags(instr->srcs[0]));
248 validate_assert(ctx, reg_class_flags(instr->dsts[2]) == IR3_REG_SHARED);
250 foreach_dst (dst, instr)
251 validate_reg_size(ctx, dst, instr->cat1.dst_type);
252 foreach_src (src, instr) {
253 if (!src->tied && src != instr->address)
254 validate_reg_size(ctx, src, instr->cat1.src_type);
257 switch (instr->opc) {
259 validate_assert(ctx, instr->srcs_count == 2);
260 validate_assert(ctx, instr->dsts_count == 2);
263 validate_assert(ctx, instr->srcs_count == 4);
264 validate_assert(ctx, instr->dsts_count == 1);
267 validate_assert(ctx, instr->srcs_count == 1);
268 validate_assert(ctx, instr->dsts_count == 4);
275 if (instr->opc != OPC_MOV)
276 validate_assert(ctx, !instr->address);
283 if (instr->srcs[0]->flags & IR3_REG_HALF) {
284 validate_assert(ctx, instr->opc == cat3_half_opc(instr->opc));
286 validate_assert(ctx, instr->opc == cat3_full_opc(instr->opc));
291 if (instr->dsts[0]->flags & IR3_REG_HALF) {
292 validate_assert(ctx, instr->opc == cat4_half_opc(instr->opc));
294 validate_assert(ctx, instr->opc == cat4_full_opc(instr->opc));
298 validate_reg_size(ctx, instr->dsts[0], instr->cat5.type);
301 switch (instr->opc) {
304 validate_reg_size(ctx, instr->dsts[0], instr->cat6.type);
305 validate_reg_size(ctx, instr->srcs[0], instr->cat6.type);
309 validate_assert(ctx, !(instr->dsts[0]->flags & IR3_REG_HALF));
310 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
313 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
314 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
315 validate_reg_size(ctx, instr->srcs[2], instr->cat6.type);
316 validate_assert(ctx, !(instr->srcs[3]->flags & IR3_REG_HALF));
319 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
320 validate_assert(ctx, !(instr->srcs[2]->flags & IR3_REG_HALF));
321 validate_assert(ctx, !(instr->srcs[3]->flags & IR3_REG_HALF));
322 validate_reg_size(ctx, instr->srcs[4], instr->cat6.type);
323 validate_assert(ctx, !(instr->srcs[5]->flags & IR3_REG_HALF));
329 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
330 validate_reg_size(ctx, instr->srcs[1], instr->cat6.type);
331 validate_assert(ctx, !(instr->srcs[2]->flags & IR3_REG_HALF));
334 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
335 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
336 validate_reg_size(ctx, instr->srcs[2], instr->cat6.type);
341 validate_reg_size(ctx, instr->dsts[0], instr->cat6.type);
344 validate_reg_size(ctx, instr->srcs[0], instr->cat6.type);
345 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
348 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
349 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
352 validate_reg_size(ctx, instr->dsts[0], instr->cat6.type);
353 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
354 if (instr->srcs_count > 1)
355 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
360 if (instr->opc == OPC_META_PARALLEL_COPY) {
361 foreach_src_n (src, n, instr) {
363 reg_class_flags(instr->dsts[n]));
406 foreach_instr (instr, &block->instr_list) {
407 ctx->current_instr = instr;
408 if (instr->opc == OPC_META_PHI) {
411 validate_phi(ctx, instr);
413 validate_instr(ctx, instr);
415 prev = instr;