intel/fs: Don't munge source order of 3-src instructions in opt_algebraic

This only impacts ADD3, so at this point it should not have any
affect. As soon as constants are propagated into ADD3 instructions, it
will be a problem.

The worst part is, the ADD3 instrutions that are broken by the old code
aren't even "progress" on this pass.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
This commit is contained in:
Ian Romanick
2023-06-01 14:21:13 -07:00
committed by Marge Bot
parent 60a00f246b
commit 4cc3206218

View File

@@ -2828,8 +2828,13 @@ fs_visitor::opt_algebraic()
break;
}
/* Swap if src[0] is immediate. */
if (progress && inst->is_commutative()) {
/* Ensure that the correct source has the immediate value. 2-source
* instructions must have the immediate in src[1]. On Gfx12 and later,
* some 3-source instructions can have the immediate in src[0] or
* src[2]. It's complicated, so don't mess with 3-source instructions
* here.
*/
if (progress && inst->sources == 2 && inst->is_commutative()) {
if (inst->src[0].file == IMM) {
fs_reg tmp = inst->src[1];
inst->src[1] = inst->src[0];