From 5948e7ec2e53072fb81423798cf9d5ffdbd0e9bb Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 9 Jan 2024 14:09:33 -0400 Subject: [PATCH] agx: unit test split uniform opt Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/test/test-optimizer.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/asahi/compiler/test/test-optimizer.cpp b/src/asahi/compiler/test/test-optimizer.cpp index 47fc4c8daf8..35ea97f9718 100644 --- a/src/asahi/compiler/test/test-optimizer.cpp +++ b/src/asahi/compiler/test/test-optimizer.cpp @@ -3,6 +3,7 @@ * SPDX-License-Identifier: MIT */ +#include "agx_builder.h" #include "agx_test.h" #include @@ -172,6 +173,23 @@ TEST_F(Optimizer, IntCopyprop) CASE32(agx_xor_to(b, out, agx_mov(b, wx), wy), agx_xor_to(b, out, wx, wy)); } +TEST_F(Optimizer, CopypropSplitMovedUniform64) +{ + CASE32( + { + /* emit_load_preamble puts in the move, so we do too */ + agx_index mov = agx_mov(b, agx_uniform(40, AGX_SIZE_64)); + agx_instr *spl = agx_split(b, 2, mov); + spl->dest[0] = agx_temp(b->shader, AGX_SIZE_32); + spl->dest[1] = agx_temp(b->shader, AGX_SIZE_32); + agx_xor_to(b, out, spl->dest[0], spl->dest[1]); + }, + { + agx_xor_to(b, out, agx_uniform(40, AGX_SIZE_32), + agx_uniform(42, AGX_SIZE_32)); + }); +} + TEST_F(Optimizer, IntCopypropDoesntConvert) { NEGCASE32({