summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-10-17 18:56:29 -0700
committerJason Ekstrand <[email protected]>2017-11-07 10:37:52 -0800
commitd54f8ec744545673fd78f15ffce3cb4e47d4b5f1 (patch)
tree5a9522f8d04a14ae09700ba474fe2a386c929039 /src
parentfd1bcccc2de9ba6a1ad6171342a155091963c3b9 (diff)
intel/fs: Fix integer multiplication lowering for src/dst hazards
Reviewed-by: Iago Toral Quiroga <[email protected]> Cc: [email protected]
Diffstat (limited to 'src')
-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 965eb86f65e..fea5a145a8e 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -3487,8 +3487,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);
}
@@ -3519,7 +3525,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));
}