i965: Don't copy propagate bitcasts with source modifiers.
authorMatt Turner <mattst88@gmail.com>
Thu, 8 Aug 2013 23:41:48 +0000 (16:41 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 16 Aug 2013 20:11:07 +0000 (13:11 -0700)
commit9c48ae751ab28f35eb878551d24c071be0ce11b0
treed0022fb081565228a9623db3d460e17702e48d22
parent0ae9ca12a887a5aca47edc2a6a99eac4235bf4b0
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>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp