* 13.1 (p378).
*/
+using namespace brw;
+
namespace {
struct aeb_entry : public exec_node {
/** The instruction that generates the expression value. */
operands_match(a, b, negate);
}
-static fs_inst *
-create_copy_instr(fs_visitor *v, fs_inst *inst, fs_reg src, bool negate)
+static void
+create_copy_instr(const fs_builder &bld, fs_inst *inst, fs_reg src, bool negate)
{
int written = inst->regs_written;
int dst_width = inst->dst.width / 8;
+ const fs_builder ubld = bld.group(inst->exec_size, inst->force_sechalf)
+ .exec_all(inst->force_writemask_all);
fs_inst *copy;
if (written > dst_width) {
}
assert(src.file == GRF);
- payload = ralloc_array(v->mem_ctx, fs_reg, sources);
+ payload = ralloc_array(bld.shader->mem_ctx, fs_reg, sources);
for (int i = 0; i < header_size; i++) {
payload[i] = src;
payload[i].width = 8;
payload[i] = src;
src = offset(src, 1);
}
- copy = v->LOAD_PAYLOAD(inst->dst, payload, sources, header_size);
+ copy = ubld.LOAD_PAYLOAD(inst->dst, payload, sources, header_size);
} else {
- copy = v->MOV(inst->dst, src);
+ copy = ubld.MOV(inst->dst, src);
copy->src[0].negate = negate;
}
- copy->force_writemask_all = inst->force_writemask_all;
- copy->force_sechalf = inst->force_sechalf;
assert(copy->regs_written == written);
-
- return copy;
}
bool
entry->generator->dst.type,
entry->generator->dst.width);
- fs_inst *copy = create_copy_instr(this, entry->generator,
- entry->tmp, false);
- entry->generator->insert_after(block, copy);
+ create_copy_instr(bld.at(block, entry->generator->next),
+ entry->generator, entry->tmp, false);
entry->generator->dst = entry->tmp;
}
assert(inst->dst.width == entry->generator->dst.width);
assert(inst->dst.type == entry->tmp.type);
- fs_inst *copy = create_copy_instr(this, inst,
- entry->tmp, negate);
- inst->insert_before(block, copy);
+ create_copy_instr(bld.at(block, inst), inst, entry->tmp, negate);
}
/* Set our iterator so that next time through the loop inst->next