summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2013-08-08 16:41:48 -0700
committerMatt Turner <mattst88@gmail.com>2013-08-16 13:11:07 -0700
commit9c48ae751ab28f35eb878551d24c071be0ce11b0 (patch)
treed0022fb081565228a9623db3d460e17702e48d22 /src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
parent0ae9ca12a887a5aca47edc2a6a99eac4235bf4b0 (diff)
downloadexternal_mesa3d-9c48ae751ab28f35eb878551d24c071be0ce11b0.zip
external_mesa3d-9c48ae751ab28f35eb878551d24c071be0ce11b0.tar.gz
external_mesa3d-9c48ae751ab28f35eb878551d24c071be0ce11b0.tar.bz2
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>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index c28d0de..fdbe96c 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -206,14 +206,16 @@ vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg,
if (inst->src[arg].negate)
value.negate = !value.negate;
- bool has_source_modifiers = (value.negate || value.abs ||
- value.swizzle != BRW_SWIZZLE_XYZW ||
- value.file == UNIFORM);
+ bool has_source_modifiers = value.negate || value.abs;
/* gen6 math and gen7+ SENDs from GRFs ignore source modifiers on
* instructions.
*/
- if (has_source_modifiers && !can_do_source_mods(inst))
+ if ((has_source_modifiers || value.file == UNIFORM ||
+ value.swizzle != BRW_SWIZZLE_XYZW) && !can_do_source_mods(inst))
+ return false;
+
+ if (has_source_modifiers && value.type != inst->src[arg].type)
return false;
bool is_3src_inst = (inst->opcode == BRW_OPCODE_LRP ||