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) {
210 for (unsigned i = 0; i < instr->dsts_count; i++) {
211 struct ir3_register *reg = instr->dsts[i];
213 validate_dst(ctx, instr, reg);
216 _mesa_set_add(ctx->defs, instr);
222 switch (opc_cat(instr->opc)) {
224 if (instr->opc == OPC_MOVMSK || instr->opc == OPC_BALLOT_MACRO) {
225 validate_assert(ctx, instr->dsts_count == 1);
226 validate_assert(ctx, instr->dsts[0]->flags & IR3_REG_SHARED);
227 validate_assert(ctx, !(instr->dsts[0]->flags & IR3_REG_HALF));
229 ctx, util_is_power_of_two_or_zero(instr->dsts[0]->wrmask + 1));
230 } else if (instr->opc == OPC_ANY_MACRO || instr->opc == OPC_ALL_MACRO ||
231 instr->opc == OPC_READ_FIRST_MACRO ||
232 instr->opc == OPC_READ_COND_MACRO) {
234 } else if (instr->opc == OPC_ELECT_MACRO) {
235 validate_assert(ctx, instr->dsts_count == 1);
236 validate_assert(ctx, !(instr->dsts[0]->flags & IR3_REG_SHARED));
238 foreach_dst (dst, instr)
239 validate_reg_size(ctx, dst, instr->cat1.dst_type);
240 foreach_src (src, instr) {
241 if (!src->tied && src != instr->address)
242 validate_reg_size(ctx, src, instr->cat1.src_type);
245 switch (instr->opc) {
247 validate_assert(ctx, instr->srcs_count == 2);
248 validate_assert(ctx, instr->dsts_count == 2);
251 validate_assert(ctx, instr->srcs_count == 4);
252 validate_assert(ctx, instr->dsts_count == 1);
255 validate_assert(ctx, instr->srcs_count == 1);
256 validate_assert(ctx, instr->dsts_count == 4);
263 if (instr->opc != OPC_MOV)
264 validate_assert(ctx, !instr->address);
271 if (instr->srcs[0]->flags & IR3_REG_HALF) {
272 validate_assert(ctx, instr->opc == cat3_half_opc(instr->opc));
274 validate_assert(ctx, instr->opc == cat3_full_opc(instr->opc));
279 if (instr->dsts[0]->flags & IR3_REG_HALF) {
280 validate_assert(ctx, instr->opc == cat4_half_opc(instr->opc));
282 validate_assert(ctx, instr->opc == cat4_full_opc(instr->opc));
286 validate_reg_size(ctx, instr->dsts[0], instr->cat5.type);
289 switch (instr->opc) {
292 validate_reg_size(ctx, instr->dsts[0], instr->cat6.type);
293 validate_reg_size(ctx, instr->srcs[0], instr->cat6.type);
297 validate_assert(ctx, !(instr->dsts[0]->flags & IR3_REG_HALF));
298 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
301 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
302 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
303 validate_reg_size(ctx, instr->srcs[2], instr->cat6.type);
304 validate_assert(ctx, !(instr->srcs[3]->flags & IR3_REG_HALF));
307 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
308 validate_assert(ctx, !(instr->srcs[2]->flags & IR3_REG_HALF));
309 validate_assert(ctx, !(instr->srcs[3]->flags & IR3_REG_HALF));
310 validate_reg_size(ctx, instr->srcs[4], instr->cat6.type);
311 validate_assert(ctx, !(instr->srcs[5]->flags & IR3_REG_HALF));
317 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
318 validate_reg_size(ctx, instr->srcs[1], instr->cat6.type);
319 validate_assert(ctx, !(instr->srcs[2]->flags & IR3_REG_HALF));
322 if (instr->flags & IR3_INSTR_B) {
323 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
324 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
325 validate_reg_size(ctx, instr->srcs[2], instr->cat6.type);
327 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
328 validate_reg_size(ctx, instr->srcs[1], instr->cat6.type);
329 validate_assert(ctx, !(instr->srcs[2]->flags & IR3_REG_HALF));
333 validate_reg_size(ctx, instr->dsts[0], instr->cat6.type);
334 validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
335 if (instr->srcs_count > 1)
336 validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
341 if (instr->opc == OPC_META_PARALLEL_COPY) {
342 foreach_src_n (src, n, instr) {
344 reg_class_flags(instr->dsts[n]));
387 foreach_instr (instr, &block->instr_list) {
388 ctx->current_instr = instr;
389 if (instr->opc == OPC_META_PHI) {
392 validate_phi(ctx, instr);
394 validate_instr(ctx, instr);
396 prev = instr;