Mesa (master): aco: add test for incorrect convert_to_SDWA() check
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jan 19 16:42:40 UTC 2021
Module: Mesa
Branch: master
Commit: 4c1953a9b8b7233af3c5798462981d3679cdffd4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c1953a9b8b7233af3c5798462981d3679cdffd4
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Tue Jan 19 14:50:33 2021 +0000
aco: add test for incorrect convert_to_SDWA() check
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8577>
---
src/amd/compiler/tests/test_regalloc.cpp | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/amd/compiler/tests/test_regalloc.cpp b/src/amd/compiler/tests/test_regalloc.cpp
index ef93f991dab..b6f07c06ae4 100644
--- a/src/amd/compiler/tests/test_regalloc.cpp
+++ b/src/amd/compiler/tests/test_regalloc.cpp
@@ -58,3 +58,22 @@ BEGIN_TEST(regalloc.subdword_alloc.reuse_16bit_operands)
}
}
END_TEST
+
+BEGIN_TEST(regalloc.32bit_partial_write)
+ //>> v1: %_:v[0], s2: %_:exec = p_startpgm
+ if (!setup_cs("v1", GFX10))
+ return;
+
+ /* ensure high 16 bits are occupied */
+ //! v2b: %_:v[0][0:16], v2b: %_:v[0][16:32] = p_split_vector %_:v[0]
+ Temp hi = bld.pseudo(aco_opcode::p_split_vector, bld.def(v2b), bld.def(v2b), inputs[0]).def(1).getTemp();
+
+ /* This test checks if this instruction uses SDWA. */
+ //! v2b: %_:v[0][0:16] = v_not_b32 0 dst_preserve
+ Temp lo = bld.vop1(aco_opcode::v_not_b32, bld.def(v2b), Operand(0u));
+
+ //! v1: %_:v[0] = p_create_vector %_:v[0][0:16], %_:v[0][16:32]
+ bld.pseudo(aco_opcode::p_create_vector, bld.def(v1), lo, hi);
+
+ finish_ra_test(ra_test_policy());
+END_TEST
More information about the mesa-commit
mailing list