diff options
author | Francisco Jerez <[email protected]> | 2016-05-17 16:48:32 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2016-05-27 23:19:20 -0700 |
commit | c5f224145a41079ddcc77c0d7df8b4b75ed2d4fe (patch) | |
tree | 38a1c405f4b808670879d48dd569887246e851c0 | |
parent | 1760c24b4bcf028477404e283f5768f2b6f25123 (diff) |
i965/fs: Handle instruction predication in SIMD lowering pass.
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index bb11be157a2..71df1e57fa3 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -4764,12 +4764,12 @@ fs_visitor::lower_simd_width() * instruction. */ const fs_builder lbld = ibld.group(lower_width, i); + const fs_builder cbld = lbld.group(copy_width, 0); for (unsigned j = 0; j < inst->sources; j++) { if (inst->src[j].file != BAD_FILE && !is_periodic(inst->src[j], lower_width)) { /* Get the i-th copy_width-wide chunk of the source. */ - const fs_builder cbld = lbld.group(copy_width, 0); const fs_reg src = offset(inst->src[j], cbld, i); const unsigned src_size = inst->components_read(j); @@ -4794,6 +4794,16 @@ fs_visitor::lower_simd_width() split_inst.regs_written = DIV_ROUND_UP(type_sz(inst->dst.type) * dst_size * lower_width, REG_SIZE); + + if (inst->predicate) { + /* Handle predication by copying the original contents of + * the destination into the temporary before emitting the + * lowered instruction. + */ + for (unsigned k = 0; k < dst_size; ++k) + cbld.MOV(offset(split_inst.dst, lbld, k), + offset(inst->dst, cbld, n * k + i)); + } } lbld.emit(split_inst); |