Mesa (main): aco/tests: test copy propagation with DPP instructions
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 31 17:15:49 UTC 2021
Module: Mesa
Branch: main
Commit: 7d95f7510fa1d338789262fb178564d6bcc0d88b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d95f7510fa1d338789262fb178564d6bcc0d88b
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Fri Aug 27 17:53:48 2021 +0100
aco/tests: test copy propagation with DPP instructions
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12601>
---
src/amd/compiler/tests/test_optimizer.cpp | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/amd/compiler/tests/test_optimizer.cpp b/src/amd/compiler/tests/test_optimizer.cpp
index 9917404354c..ce4e925b779 100644
--- a/src/amd/compiler/tests/test_optimizer.cpp
+++ b/src/amd/compiler/tests/test_optimizer.cpp
@@ -1032,3 +1032,29 @@ BEGIN_TEST(optimizer.dpp)
finish_opt_test();
END_TEST
+BEGIN_TEST(optimize.dpp_prop)
+ //>> v1: %a, s1: %b = p_startpgm
+ if (!setup_cs("v1 s1", GFX10))
+ return;
+
+ //! v1: %zero = p_parallelcopy 0
+ //! v1: %res0 = v_mul_f32 %zero, %a row_shl:1 bound_ctrl:1
+ //! p_unit_test 0, %res0
+ Temp zero = bld.copy(bld.def(v1), Operand::zero());
+ writeout(0, bld.vop2_dpp(aco_opcode::v_mul_f32, bld.def(v1), zero, inputs[0], dpp_row_sl(1)));
+
+ //! v1: %literal = p_parallelcopy 0x12345678
+ //! v1: %res1 = v_mul_f32 %literal, %a row_shl:1 bound_ctrl:1
+ //! p_unit_test 1, %res1
+ Temp literal = bld.copy(bld.def(v1), Operand::c32(0x12345678u));
+ writeout(1, bld.vop2_dpp(aco_opcode::v_mul_f32, bld.def(v1), literal, inputs[0], dpp_row_sl(1)));
+
+ //! v1: %b_v = p_parallelcopy %b
+ //! v1: %res2 = v_mul_f32 %b_v, %a row_shl:1 bound_ctrl:1
+ //! p_unit_test 2, %res2
+ Temp b_v = bld.copy(bld.def(v1), inputs[1]);
+ writeout(2, bld.vop2_dpp(aco_opcode::v_mul_f32, bld.def(v1), b_v, inputs[0], dpp_row_sl(1)));
+
+ finish_opt_test();
+END_TEST
+
More information about the mesa-commit
mailing list