}
if (inst->dst.is_null() && inst->writes_flag()) {
- if (!BITSET_TEST(flag_live, inst->flag_subreg)) {
+ if (!(flag_live[0] & inst->flags_written())) {
inst->opcode = BRW_OPCODE_NOP;
progress = true;
}
}
}
- if (inst->writes_flag() && !inst->predicate) {
- BITSET_CLEAR(flag_live, inst->flag_subreg);
- }
+ if (!inst->predicate && inst->exec_size >= 8)
+ flag_live[0] &= ~inst->flags_written();
if (inst->opcode == BRW_OPCODE_NOP) {
inst->remove(block);
}
}
- if (inst->reads_flag()) {
- BITSET_SET(flag_live, inst->flag_subreg);
- }
+ flag_live[0] |= inst->flags_read(devinfo);
}
}
reg.reg_offset++;
}
}
- if (inst->reads_flag()) {
- /* The vertical combination predicates read f0.0 and f0.1. */
- if (inst->predicate == BRW_PREDICATE_ALIGN1_ANYV ||
- inst->predicate == BRW_PREDICATE_ALIGN1_ALLV) {
- assert(inst->flag_subreg == 0);
- if (!BITSET_TEST(bd->flag_def, 1)) {
- BITSET_SET(bd->flag_use, 1);
- }
- }
- if (!BITSET_TEST(bd->flag_def, inst->flag_subreg)) {
- BITSET_SET(bd->flag_use, inst->flag_subreg);
- }
- }
+
+ bd->flag_use[0] |= inst->flags_read(v->devinfo) & ~bd->flag_def[0];
/* Set def[] for this instruction */
if (inst->dst.file == VGRF) {
reg.reg_offset++;
}
}
- if (inst->writes_flag()) {
- if (!BITSET_TEST(bd->flag_use, inst->flag_subreg)) {
- BITSET_SET(bd->flag_def, inst->flag_subreg);
- }
- }
+
+ if (!inst->predicate && inst->exec_size >= 8)
+ bd->flag_def[0] |= inst->flags_written() & ~bd->flag_use[0];
ip++;
}