if (ins->dest >= ctx->temp_count)
return false;
+ if (ins->dest == ctx->blend_src1)
+ return false;
+
if (ins->type == TAG_LOAD_STORE_4)
if (load_store_opcode_props[ins->load_store.op].props & LDST_SPECIAL_MASK)
return false;
mir_foreach_instr_in_block_rev(block, ins) {
if (can_cull_mask(ctx, ins)) {
- midgard_reg_mode mode = mir_typesize(ins);
+ unsigned type_size = nir_alu_type_get_type_size(ins->dest_type);
+ unsigned round_size = type_size;
unsigned oldmask = ins->mask;
- unsigned rounded = mir_round_bytemask_up(live[ins->dest], mode);
- unsigned cmask = mir_from_bytemask(rounded, mode);
+ /* Make sure we're packable */
+ if (type_size == 16 && ins->type == TAG_LOAD_STORE_4)
+ round_size = 32;
+
+ unsigned rounded = mir_round_bytemask_up(live[ins->dest], round_size);
+ unsigned cmask = mir_from_bytemask(rounded, type_size);
ins->mask &= cmask;
progress |= (ins->mask != oldmask);
mir_foreach_instr_in_block_safe(block, ins) {
if (ins->type != TAG_ALU_4) continue;
if (ins->compact_branch) continue;
- if (!OP_IS_MOVE(ins->alu.op)) continue;
+ if (!OP_IS_MOVE(ins->op)) continue;
/* Check if it's overwritten in this block before being read */
bool overwritten = false;