i965: Add functions to abstract access to register types
authorMatt Turner <mattst88@gmail.com>
Wed, 26 Jul 2017 23:51:58 +0000 (16:51 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 21 Aug 2017 21:05:23 +0000 (14:05 -0700)
commitcb2cd462b1c66b9bace4d061bf4ff960419e83d9
treeeba15cc594d29bccb8dc577d8ab56c8a6547b9a0
parent9fb8323328684bd7fe4e8c71c7415f51acf25e5b
i965: Add functions to abstract access to register types

Previously the brw_inst{,_set}_{dst,src0,src1}_reg_type() functions
provided access to the hardware encodings for the register types. We
often mixed these with the logical BRW_REGISTER_TYPE_* enums (which
themselves used to be the hardware format!) with bad results.

With that functionality now available with the hw_ versions (see
previous commit), we now add functions that take the logical
BRW_REGISTER_TYPE_* enums and convert into the hardware format and vice
versa. To do the conversion we also have to provide the file.

Note the asymmetry between the two functions: the new getter reads the
file from the instruction word, and to ensure that is always set the
setter writes both the file and the type.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
src/intel/compiler/brw_inst.h
src/intel/compiler/test_eu_validate.cpp