mir_foreach_instr_global(ctx, ins) {
if (!(ins->compact_branch && ins->writeout)) continue;
- if (ins->src[0] < ctx->temp_count) {
- if (ins->writeout_depth)
- l->solutions[ins->src[0]] = (16 * 1) + COMPONENT_X * 4;
- else if (ins->writeout_stencil)
- l->solutions[ins->src[0]] = (16 * 1) + COMPONENT_Y * 4;
- else
- l->solutions[ins->src[0]] = 0;
- }
+ if (ins->src[0] < ctx->temp_count)
+ l->solutions[ins->src[0]] = 0;
if (ins->src[1] < ctx->temp_count)
l->solutions[ins->src[1]] = (16 * 1) + COMPONENT_Z * 4;
mir_choose_alu(&branch, instructions, worklist, len, &predicate, ALU_ENAB_BR_COMPACT);
mir_update_worklist(worklist, len, instructions, branch);
bool writeout = branch && branch->writeout;
- bool zs_writeout = writeout && (branch->writeout_depth | branch->writeout_stencil);
if (branch && branch->branch.conditional) {
midgard_instruction *cond = mir_schedule_condition(ctx, &predicate, worklist, len, instructions, branch);
bundle.last_writeout = branch->last_writeout;
}
- if (writeout && !zs_writeout) {
+ if (writeout) {
vadd = ralloc(ctx, midgard_instruction);
*vadd = v_mov(~0, make_compiler_temp(ctx));
if (writeout) {
midgard_instruction *stages[] = { sadd, vadd, smul };
- unsigned src = (branch->src[0] == ~0) ? SSA_FIXED_REGISTER(zs_writeout ? 1 : 0) : branch->src[0];
+ unsigned src = (branch->src[0] == ~0) ? SSA_FIXED_REGISTER(0) : branch->src[0];
unsigned writeout_mask = 0x0;
bool bad_writeout = false;
}
/* It's possible we'll be able to schedule something into vmul
- * to fill r0/r1. Let's peak into the future, trying to schedule
+ * to fill r0. Let's peak into the future, trying to schedule
* vmul specially that way. */
- unsigned full_mask = zs_writeout ?
- (1 << (branch->writeout_depth + branch->writeout_stencil)) - 1 :
- 0xF;
+ unsigned full_mask = 0xF;
if (!bad_writeout && writeout_mask != full_mask) {
predicate.unit = UNIT_VMUL;
/* Finally, add a move if necessary */
if (bad_writeout || writeout_mask != full_mask) {
- unsigned temp = (branch->src[0] == ~0) ? SSA_FIXED_REGISTER(zs_writeout ? 1 : 0) : make_compiler_temp(ctx);
+ unsigned temp = (branch->src[0] == ~0) ? SSA_FIXED_REGISTER(0) : make_compiler_temp(ctx);
vmul = ralloc(ctx, midgard_instruction);
*vmul = v_mov(src, temp);