Module: Mesa
Branch: master
Commit: 8451911156cebf73d446bde5422566d650c6fa69
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8451911156cebf73d446bde5422566d650c6fa69

Author: Rhys Perry <[email protected]>
Date:   Fri Dec  4 10:26:06 2020 +0000

aco: test self-intersecting copies when src=higher

Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798>

---

 src/amd/compiler/tests/test_to_hw_instr.cpp | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/amd/compiler/tests/test_to_hw_instr.cpp 
b/src/amd/compiler/tests/test_to_hw_instr.cpp
index bca1ae22397..bf3c4988747 100644
--- a/src/amd/compiler/tests/test_to_hw_instr.cpp
+++ b/src/amd/compiler/tests/test_to_hw_instr.cpp
@@ -473,3 +473,28 @@ BEGIN_TEST(to_hw_instr.subdword_constant)
       finish_to_hw_instr_test();
    }
 END_TEST
+
+BEGIN_TEST(to_hw_instr.self_intersecting_swap)
+   if (!setup_cs(NULL, GFX9))
+      return;
+
+   PhysReg reg_v1{257};
+   PhysReg reg_v2{258};
+   PhysReg reg_v3{259};
+   PhysReg reg_v7{263};
+
+   //>> p_unit_test 0
+   //! v1: %0:v[1],  v1: %0:v[2] = v_swap_b32 %0:v[2], %0:v[1]
+   //! v1: %0:v[2],  v1: %0:v[3] = v_swap_b32 %0:v[3], %0:v[2]
+   //! v1: %0:v[3],  v1: %0:v[7] = v_swap_b32 %0:v[7], %0:v[3]
+   //! s_endpgm
+   bld.pseudo(aco_opcode::p_unit_test, Operand(0u));
+   //v[1:2] = v[2:3]
+   //v3 = v7
+   //v7 = v1
+   bld.pseudo(aco_opcode::p_parallelcopy,
+              Definition(reg_v1, v2), Definition(reg_v3, v1), 
Definition(reg_v7, v1),
+              Operand(reg_v2, v2), Operand(reg_v7, v1), Operand(reg_v1, v1));
+
+   finish_to_hw_instr_test();
+END_TEST

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to