intel/fs: Fix handling of W, UW, and HF constants in combine_constants
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 24 May 2023 01:34:43 +0000 (18:34 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 6 Jun 2023 06:10:53 +0000 (06:10 +0000)
commit4f272bf001dec66d79511fc58f9f48e79ecd5fed
tree5bce8d5459b25aef6c3e06e7a1c742c77091a634
parent4cc3206218aa9b16939842a67d4a988d8e416d6d
intel/fs: Fix handling of W, UW, and HF constants in combine_constants

Sources that are already W, UW, or HF can be represented as those types
by definition. Pass them through. Previously an HF source on a MAD would
have been marked as !can_promote. I'm pretty sure this means it would
get moved out to a register, but I did not verify this.

For ADD3, a constant source could be D or UD. In this case, the value
must be tested to determine whether it can be represented as W or
UW. The patterns in opt_algebraic won't generate an ADD3 with constant
source, so this problem cannot occur yet.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
src/intel/compiler/brw_fs_combine_constants.cpp