intel/eu: Use brw_set_desc() along with a helper to set common descriptor controls.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 11 Jun 2018 17:49:39 +0000 (10:49 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 10 Jul 2018 06:46:57 +0000 (23:46 -0700)
commitc3793d49e41595faa8e9443ce5c69463c2e97f94
tree9a7cb8f44a38635b0e413f477009c26ead033e46
parent20b962232b71c8f5931ddb585386725804dbd4e0
intel/eu: Use brw_set_desc() along with a helper to set common descriptor controls.

This replaces brw_set_message_descriptor() with the composition of
brw_set_desc() and a new inline helper function that packs the common
message descriptor controls into an integer.  The goal is to represent
all message descriptors as a 32-bit integer which is written at once
into the instruction, which is more flexible (SENDS anyone?), robust
(see d2eecf0b0b24d203d0f171807681dffd830d54de fixing an issue
ultimately caused by some bits of the extended message descriptor
being left undefined) and future-proof than the current approach of
specifying the individual descriptor fields directly into the
instruction.

This approach also seems more self-documenting, since it will allow
removing calls to functions with way too many arguments like
brw_set_*_message() and brw_send_indirect_message(), and instead
provide a single descriptor argument constructed from an appropriate
combination of brw_*_desc() helpers.

Note that because brw_set_message_descriptor() was (conditionally?)
overriding fields of the instruction which strictly speaking weren't
part of the message descriptor, this involves calling
brw_inst_set_sfid() and brw_inst_set_eot() in some cases in addition
to brw_set_desc().

v2: Use SET_BITS macro instead of left shift (Ken).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_eu.h
src/intel/compiler/brw_eu_emit.c
src/intel/compiler/brw_vec4_generator.cpp