opcode == SHADER_OPCODE_POW);
}
+bool
+fs_inst::is_send_from_grf()
+{
+ return opcode == FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7;
+}
+
+bool
+fs_visitor::can_do_source_mods(fs_inst *inst)
+{
+ if (intel->gen == 6 && inst->is_math())
+ return false;
+
+ if (inst->is_send_from_grf())
+ return false;
+
+ return true;
+}
+
void
fs_reg::init()
{
inst->dst.type != inst->src[0].type)
continue;
- bool has_source_modifiers = inst->src[0].abs || inst->src[0].negate;
+ bool has_source_modifiers = (inst->src[0].abs ||
+ inst->src[0].negate ||
+ inst->src[0].file == UNIFORM);
/* Found a move of a GRF to a GRF. Let's see if we can coalesce
* them: check for no writes to either one until the exit of the
* unusual register regions, so avoid coalescing those for
* now. We should do something more specific.
*/
- if (intel->gen == 6 &&
- scan_inst->is_math() &&
- (has_source_modifiers || inst->src[0].file == UNIFORM)) {
- interfered = true;
+ if (has_source_modifiers && !can_do_source_mods(scan_inst)) {
+ interfered = true;
break;
}
bool overwrites_reg(const fs_reg ®);
bool is_tex();
bool is_math();
+ bool is_send_from_grf();
fs_reg dst;
fs_reg src[3];
void swizzle_result(ir_texture *ir, fs_reg orig_val, int sampler);
+ bool can_do_source_mods(fs_inst *inst);
+
fs_inst *emit(fs_inst inst);
fs_inst *emit(fs_inst *inst);
bool has_source_modifiers = entry->src.abs || entry->src.negate;
- if (intel->gen == 6 && inst->is_math() &&
- (has_source_modifiers || entry->src.file == UNIFORM ||
- entry->src.smear != -1))
+ if ((has_source_modifiers || entry->src.file == UNIFORM ||
+ entry->src.smear != -1) && !can_do_source_mods(inst))
return false;
inst->src[arg].file = entry->src.file;