intel/fs: Refactor ALU source and destination handling to a separate function
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 5 Dec 2018 19:35:37 +0000 (11:35 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 1 Mar 2019 20:42:14 +0000 (12:42 -0800)
commit06eaaf2de94449f5c5a7cf3dce8894aafa1fb0ae
tree7cbce418d2b03c120e895cb2ca35d1ce7b812144
parentfb3ca9109cba6d814c2e3843e256b298cfd73661
intel/fs: Refactor ALU source and destination handling to a separate function

Other places will need to do this soon to properly handle source
swizzles.  The patch looks a little odd, but the change is pretty
straight forward.  All of the swizzle and mask handling is moved out,
but the code for handling move instructions and vecN instructions
remains in nir_emit_alu.

I'm not terribly pleased with the "need_dest" parameter, but
get_nir_dest is (somewhat surprisingly) destructive.  I am open to
suggestions of alternatives.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_fs.h
src/intel/compiler/brw_fs_nir.cpp