diff options
author | Matt Turner <mattst88@gmail.com> | 2013-08-08 16:41:48 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-08-21 21:11:54 -0700 |
commit | 5114ac3f87fc691e6c4302046f760302384a3b2c (patch) | |
tree | 5891b7f28ce626d92ec275a8ec490610c9757b89 /src/mesa/drivers/dri/i965/brw_fs.cpp | |
parent | f0bc10679e1d1fa8009c8facd7a3ee87053fb27b (diff) |
i965: Don't copy propagate bitcasts with source modifiers.
Previously, copy propagation would cause bitcast_f2u(abs(float)) to
be performed in a single step, but the application of source modifiers
(abs, neg) happens after type conversion, leading to incorrect results.
That is, for bitcast_f2u(abs(float)) we would in fact generate code to
do abs(bitcast_f2u(float)).
For example, whereas bitcast_f2u(abs(float)) might result in a register
argument such as
(abs)g2.2<0,1,0>UD
v2: Set interfered = true and break in register_coalesce instead of
returning false.
Reviewed-by: Paul Berry <stereoytpe441@gmail.com>
(cherry picked from commit 9c48ae751ab28f35eb878551d24c071be0ce11b0)
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index afd29deaede..3986bf5fe6e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2118,6 +2118,20 @@ fs_visitor::register_coalesce() } } + if (has_source_modifiers) { + for (int i = 0; i < 3; i++) { + if (scan_inst->src[i].file == GRF && + scan_inst->src[i].reg == inst->dst.reg && + scan_inst->src[i].reg_offset == inst->dst.reg_offset && + inst->dst.type != scan_inst->src[i].type) + { + interfered = true; + break; + } + } + } + + /* The gen6 MATH instruction can't handle source modifiers or * unusual register regions, so avoid coalescing those for * now. We should do something more specific. |