Another constant source of bugs. Ain't that special.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
/* Get rid of the embedded constant */
ins->has_constants = false;
- ins->ssa_args.src1 = SSA_UNUSED_0;
+ ins->ssa_args.src1 = -1;
ins->ssa_args.inline_constant = true;
ins->inline_constant = scaled_constant;
}
if (ins->ssa_args.src0 == src)
return true;
- if (!ins->ssa_args.inline_constant && ins->ssa_args.src1 == src)
+ if (ins->ssa_args.src1 == src)
return true;
return false;
ra_get_node_reg(g, iB);
if (A != B) continue;
- if (ins->ssa_args.inline_constant) continue;
/* Check we're in the work zone. TODO: promoted
* uniforms? */
.mask = ins->mask,
.ssa_args = {
.src0 = temp,
- .src1 = 0,
+ .src1 = -1,
.dest = ins->ssa_args.dest,
.inline_constant = true
},
case TAG_ALU_4:
mark_node_class(aluw, ins->ssa_args.dest);
mark_node_class(alur, ins->ssa_args.src0);
-
- if (!ins->ssa_args.inline_constant)
- mark_node_class(alur, ins->ssa_args.src1);
+ mark_node_class(alur, ins->ssa_args.src1);
break;
case TAG_LOAD_STORE_4:
mir_foreach_instr_global(ctx, ins) {
assert(check_write_class(found_class, ins->type, ins->ssa_args.dest));
assert(check_read_class(found_class, ins->type, ins->ssa_args.src0));
-
- if (!ins->ssa_args.inline_constant)
- assert(check_read_class(found_class, ins->type, ins->ssa_args.src1));
+ assert(check_read_class(found_class, ins->type, ins->ssa_args.src1));
}
for (unsigned i = 0; i < ctx->temp_count; ++i) {
for (int src = 0; src < 2; ++src) {
int s = sources[src];
- if (ins->ssa_args.inline_constant && src == 1)
- continue;
-
if (s < 0) continue;
if (s >= SSA_FIXED_MINIMUM) continue;
switch (ins->type) {
case TAG_ALU_4: {
- int adjusted_src = args.inline_constant ? -1 : args.src1;
struct phys_reg src1 = index_to_reg(ctx, g, args.src0);
- struct phys_reg src2 = index_to_reg(ctx, g, adjusted_src);
+ struct phys_reg src2 = index_to_reg(ctx, g, args.src1);
struct phys_reg dest = index_to_reg(ctx, g, args.dest);
unsigned uncomposed_mask = ins->mask;
could_scalar &= !s1.half;
- if (!ains->ssa_args.inline_constant) {
- midgard_vector_alu_src s2 =
- vector_alu_from_unsigned(ains->alu.src2);
-
- could_scalar &= !s2.half;
- }
+ midgard_vector_alu_src s2 =
+ vector_alu_from_unsigned(ains->alu.src2);
+ could_scalar &= !s2.half;
}
bool scalar = could_scalar && scalarable;
mir_foreach_instr_global(ctx, ins) {
ins->ssa_args.dest = find_or_allocate_temp(ctx, ins->ssa_args.dest);
ins->ssa_args.src0 = find_or_allocate_temp(ctx, ins->ssa_args.src0);
-
- if (!ins->ssa_args.inline_constant)
- ins->ssa_args.src1 = find_or_allocate_temp(ctx, ins->ssa_args.src1);
-
+ ins->ssa_args.src1 = find_or_allocate_temp(ctx, ins->ssa_args.src1);
}
}
if (ins->ssa_args.src0 == old)
ins->ssa_args.src0 = new;
- if (ins->ssa_args.src1 == old &&
- !ins->ssa_args.inline_constant)
+ if (ins->ssa_args.src1 == old)
ins->ssa_args.src1 = new;
}
pan_compose_swizzle(mir_get_swizzle(ins, 0), swizzle));
}
- if (ins->ssa_args.src1 == old &&
- !ins->ssa_args.inline_constant) {
+ if (ins->ssa_args.src1 == old) {
ins->ssa_args.src1 = new;
mir_set_swizzle(ins, 1,
if (ins->ssa_args.src0 == node)
mask |= mir_mask_of_read_components_single(ins->alu.src1, ins->mask);
- if (ins->ssa_args.src1 == node && !ins->ssa_args.inline_constant)
+ if (ins->ssa_args.src1 == node)
mask |= mir_mask_of_read_components_single(ins->alu.src2, ins->mask);
return mask;