</mod>
</ins>
- <ins name="+COLLECT.i32" pseudo="true"/>
+ <ins name="+COLLECT.i32" pseudo="true" variable_srcs="true"/>
- <ins name="+SPLIT.i32" pseudo="true">
+ <ins name="+SPLIT.i32" pseudo="true" variable_dests="true">
<src start="0"/>
</ins>
*/
b.cursor = bi_before_instr(I);
- bi_instr *collect = bi_collect_i32_to(&b, I->dest[0]);
- collect->nr_srcs = bi_count_write_registers(I, 0);
+ unsigned nr = bi_count_write_registers(I, 0);
+ bi_instr *collect = bi_collect_i32_to(&b, I->dest[0], nr);
/* The registers themselves must be preloaded at the start of
* the program. Preloaded registers are coalesced, so these
/* Replace the UBO load with moves from FAU */
bi_builder b = bi_init_builder(ctx, bi_after_instr(ins));
- bi_instr *vec = bi_collect_i32_to(&b, ins->dest[0]);
- vec->nr_srcs = bi_opcode_props[ins->op].sr_count;
+ unsigned nr = bi_opcode_props[ins->op].sr_count;
+ bi_instr *vec = bi_collect_i32_to(&b, ins->dest[0], nr);
bi_foreach_src(vec, w) {
/* FAU is grouped in pairs (2 x 4-byte) */
* Bypass the cache and emit an explicit split for registers.
*/
if (vec.reg) {
- bi_instr *I = bi_split_i32_to(b, bi_null(), vec);
- I->nr_dests = channel + 1;
+ bi_instr *I = bi_split_i32_to(b, channel + 1, vec);
I->dest[channel] = bi_temp(b->shader);
return I->dest[channel];
}
if (n == 1) {
bi_mov_i32_to(b, dests[0], vec);
} else {
- bi_instr *I = bi_split_i32_to(b, dests[0], vec);
- I->nr_dests = n;
+ bi_instr *I = bi_split_i32_to(b, n, vec);
- for (unsigned j = 1; j < n; ++j)
+ bi_foreach_dest(I, j)
I->dest[j] = dests[j];
}
}
if (n == 1)
return bi_mov_i32_to(b, dst, chan[0]);
- bi_instr *I = bi_collect_i32_to(b, dst);
- I->nr_srcs = n;
+ bi_instr *I = bi_collect_i32_to(b, dst, n);
- for (unsigned i = 0; i < n; ++i)
+ bi_foreach_src(I, i)
I->src[i] = chan[i];
bi_cache_collect(b, dst, chan, n);
bi_emit_split_i32(b, chans, data, src_comps);
bi_index tmp = bi_temp(b->shader);
- bi_instr *collect = bi_collect_i32_to(b, tmp);
- collect->nr_srcs = nr;
+ bi_instr *collect = bi_collect_i32_to(b, tmp, nr);
- for (unsigned w = 0; w < nr; ++w)
+ bi_foreach_src(collect, w)
collect->src[w] = chans[w];
data = tmp;
static void preload_moves(bi_builder *b, bi_index dest, int count, int idx)
{
- bi_instr *I = bi_collect_i32_to(b, dest);
- I->nr_srcs = count;
+ bi_instr *I = bi_collect_i32_to(b, dest, count);
b->cursor = bi_before_block(bi_start_block(&b->shader->blocks));
- for (int i = 0; i < count; ++i)
+ bi_foreach_src(I, i)
I->src[i] = bi_mov_i32(b, bi_register(idx*4 + i));
b->cursor = bi_after_instr(I);
bi_index x = bi_temp(b->shader);
bi_index y = bi_temp(b->shader);
- bi_instr *split = bi_split_i32_to(b, x, ld);
- split->nr_dests = 2;
+ bi_instr *split = bi_split_i32_to(b, 2, ld);
+ split->dest[0] = x;
split->dest[1] = y;
bi_texs_2d_f32_to(b, reg, x, y, false, 0, 0);
/* Allocate temporary before the instruction */
bi_builder b = bi_init_builder(ctx, bi_before_instr(I));
bi_index vec = bi_temp(ctx);
- bi_instr *collect = bi_collect_i32_to(&b, vec);
- collect->nr_srcs = 2;
-
- bi_instr *split = bi_split_i32_to(&b, bi_null(), vec);
- split->nr_dests = 2;
+ bi_instr *collect = bi_collect_i32_to(&b, vec, 2);
+ bi_instr *split = bi_split_i32_to(&b, 2, vec);
/* Emit collect */
for (unsigned w = 0; w < 2; ++w) {