i965/fs: generalize the legalization d2x pass
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Fri, 20 Jan 2017 07:47:05 +0000 (08:47 +0100)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 14 Apr 2017 21:56:07 +0000 (14:56 -0700)
commitaeecc82d057adf43189d08214b21ca5166ad9682
treee1eb456a4d5371a10d853d12c1da9468cc968d97
parent94ffeb7fa2257af3eb416a1e720e08911835665b
i965/fs: generalize the legalization d2x pass

Generalize it to lower any unsupported narrower conversion.

v2 (Curro):
- Add supports_type_conversion()
- Reuse existing intruction instead of cloning it.
- Generalize d2x to narrower and equal size conversions.

v3 (Curro):
- Make supports_type_conversion() const and improve it.
- Use foreach_block_and_inst to process added instructions.
- Simplify code.
- Add assert and improve comments.
- Remove redundant mov.
- Remove useless comment.
- Remove saturate == false assert and add support for saturation
  when fixing the conversion.
- Add get_exec_type() function.

v4 (Curro):
- Use get_exec_type() function to get sources' type.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs_lower_d2x.cpp