r300: set register file to none if swizzles are constant only
authorPavel Ondračka <pavel.ondracka@gmail.com>
Mon, 6 Feb 2023 17:41:24 +0000 (18:41 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 6 Feb 2023 20:31:56 +0000 (20:31 +0000)
In constant folding when converting multiply by zero to mov.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21141>

src/gallium/drivers/r300/compiler/radeon_optimize.c

index 5cb7230..02a937c 100644 (file)
@@ -298,6 +298,7 @@ static void constant_folding_mul(struct rc_instruction * inst)
                } else if (swz == RC_SWIZZLE_ZERO) {
                        inst->U.I.Opcode = RC_OPCODE_MOV;
                        inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_0000;
+                       inst->U.I.SrcReg[0].File = RC_FILE_NONE;
                        return;
                }
        }
@@ -311,6 +312,7 @@ static void constant_folding_mul(struct rc_instruction * inst)
                } else if (swz == RC_SWIZZLE_ZERO) {
                        inst->U.I.Opcode = RC_OPCODE_MOV;
                        inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_0000;
+                       inst->U.I.SrcReg[0].File = RC_FILE_NONE;
                        return;
                }
        }