const char *alphabet = components;
- if (override == midgard_dest_override_upper) {
- unsigned components = 128 / bits;
- alphabet += components;
- }
+ if (override == midgard_dest_override_upper)
+ alphabet += (128 / bits);
for (unsigned i = 0; i < 8; i += skip) {
bool a = (mask & (1 << i)) != 0;
/* Output modifiers are always interpreted floatly */
print_outmod(texture->outmod, false);
- printf(" %sr%d", texture->out_full ? "" : "h",
+ printf(" %sr%u", texture->out_full ? "" : "h",
out_reg_base + texture->out_reg_select);
print_mask_4(texture->mask, texture->out_upper);
assert(!(texture->out_full && texture->out_upper));
}
print_swizzle_vec4(texture->swizzle, false, false);
- printf(", %sr%d", texture->in_reg_full ? "" : "h", in_reg_base + texture->in_reg_select);
+ printf(", %sr%u", texture->in_reg_full ? "" : "h", in_reg_base + texture->in_reg_select);
assert(!(texture->in_reg_full && texture->in_reg_upper));
/* TODO: integrate with swizzle */
bool select = texture->offset_x & 2;
bool upper = texture->offset_x & 4;
- printf("%sr%d", full ? "" : "h", in_reg_base + select);
+ printf("%sr%u", full ? "" : "h", in_reg_base + select);
assert(!(texture->out_full && texture->out_upper));
/* TODO: integrate with swizzle */
for (unsigned i = 0; i < 2; ++i) {
assert(swizzle[i] <= max_component);
- unsigned a = swizzle[i] & 1 ?
+ unsigned a = (swizzle[i] & 1) ?
(COMPONENT_W << 2) | COMPONENT_Z :
(COMPONENT_Y << 2) | COMPONENT_X;
/* Analyze the bundle for a per-byte read mask */
- for (unsigned i = 0; i < bundle->instruction_count; ++i) {
- midgard_instruction *q = bundle->instructions[i];
+ for (unsigned j = 0; j < bundle->instruction_count; ++j) {
+ midgard_instruction *q = bundle->instructions[j];
read_mask |= mir_bytemask_of_read_components(q, node);
/* The fragment colour can't be pipelined (well, it is
}
/* Now analyze for a write mask */
- for (unsigned i = 0; i < bundle->instruction_count; ++i) {
- midgard_instruction *q = bundle->instructions[i];
+ for (unsigned j = 0; j < bundle->instruction_count; ++j) {
+ midgard_instruction *q = bundle->instructions[j];
if (q->dest != node) continue;
/* Remove the written mask from the read requirements */
mir_choose_alu(&sadd, instructions, worklist, len, &predicate, UNIT_SADD);
/* Check if writeout reads its own register */
- bool bad_writeout = false;
if (branch && branch->writeout) {
midgard_instruction *stages[] = { sadd, vadd, smul };
unsigned src = (branch->src[0] == ~0) ? SSA_FIXED_REGISTER(0) : branch->src[0];
unsigned writeout_mask = 0x0;
+ bool bad_writeout = false;
for (unsigned i = 0; i < ARRAY_SIZE(stages); ++i) {
if (!stages[i])
case midgard_reg_mode_16: {
unsigned space =
- ((mask & 0x1) << (0 - 0)) |
+ (mask & 0x1) |
((mask & 0x2) << (2 - 1)) |
((mask & 0x4) << (4 - 2)) |
((mask & 0x8) << (6 - 3)) |
case midgard_reg_mode_32: {
unsigned space =
- ((mask & 0x1) << (0 - 0)) |
+ (mask & 0x1) |
((mask & 0x2) << (4 - 1)) |
((mask & 0x4) << (8 - 2)) |
((mask & 0x8) << (12 - 3));