if (inst->dst.file == GRF && !inst->has_side_effects()) {
bool result_live[4] = { false };
- for (int c = 0; c < 4; c++) {
- result_live[c] = BITSET_TEST(live, var_from_reg(alloc, inst->dst, c));
+ for (unsigned i = 0; i < inst->regs_written; i++) {
+ for (int c = 0; c < 4; c++)
+ result_live[c] |= BITSET_TEST(
+ live, var_from_reg(alloc, offset(inst->dst, i), c));
}
/* If the instruction can't do writemasking, then it's all or
}
if (inst->dst.file == GRF && !inst->predicate) {
- for (int c = 0; c < 4; c++) {
- if (inst->dst.writemask & (1 << c)) {
- BITSET_CLEAR(live, var_from_reg(alloc, inst->dst, c));
+ for (unsigned i = 0; i < inst->regs_written; i++) {
+ for (int c = 0; c < 4; c++) {
+ if (inst->dst.writemask & (1 << c)) {
+ BITSET_CLEAR(live, var_from_reg(alloc,
+ offset(inst->dst, i), c));
+ }
}
}
}
for (int i = 0; i < 3; i++) {
if (inst->src[i].file == GRF) {
- for (int c = 0; c < 4; c++) {
- BITSET_SET(live, var_from_reg(alloc, inst->src[i], c));
+ for (unsigned j = 0; j < inst->regs_read(i); j++) {
+ for (int c = 0; c < 4; c++) {
+ BITSET_SET(live, var_from_reg(alloc,
+ offset(inst->src[i], j), c));
+ }
}
}
}