summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2017-10-17 18:56:29 -0700
committerAndres Gomez <agomez@igalia.com>2017-11-21 18:16:44 +0200
commita868bd7a7c1c58844fe11925c4f66f096c4a1916 (patch)
tree88766d7d0a26035c51f5f701fcb3f02d63e266e1
parenteb14fb271974aafb0b50cd5291aa6cfdf43ef978 (diff)
downloadmesa-a868bd7a7c1c58844fe11925c4f66f096c4a1916.tar.gz
intel/fs: Fix integer multiplication lowering for src/dst hazards
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit d54f8ec744545673fd78f15ffce3cb4e47d4b5f1)
-rw-r--r--src/intel/compiler/brw_fs.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index d9c71576cf9..ef0846f5e88 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -3480,8 +3480,14 @@ fs_visitor::lower_integer_multiplication()
* schedule multi-component multiplications much better.
*/
+ bool needs_mov = false;
fs_reg orig_dst = inst->dst;
- if (orig_dst.is_null() || orig_dst.file == MRF) {
+ if (orig_dst.is_null() || orig_dst.file == MRF ||
+ regions_overlap(inst->dst, inst->size_written,
+ inst->src[0], inst->size_read(0)) ||
+ regions_overlap(inst->dst, inst->size_written,
+ inst->src[1], inst->size_read(1))) {
+ needs_mov = true;
inst->dst = fs_reg(VGRF, alloc.allocate(dispatch_width / 8),
inst->dst.type);
}
@@ -3512,7 +3518,7 @@ fs_visitor::lower_integer_multiplication()
subscript(low, BRW_REGISTER_TYPE_UW, 1),
subscript(high, BRW_REGISTER_TYPE_UW, 0));
- if (inst->conditional_mod || orig_dst.file == MRF) {
+ if (needs_mov || inst->conditional_mod) {
set_condmod(inst->conditional_mod,
ibld.MOV(orig_dst, inst->dst));
}