aco/tests: add test for GFX10 0x3f bug
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 5 Aug 2020 13:53:17 +0000 (14:53 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 26 Aug 2020 13:26:58 +0000 (13:26 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6212>

src/amd/compiler/aco_builder_h.py
src/amd/compiler/tests/test_assembler.cpp

index 1e217dea11bd506c83e25063b549810a3162e695..a5338ce67efa6847bd553b65699a8cc9a0ec194f 100644 (file)
@@ -548,7 +548,7 @@ formats = [("pseudo", [Format.PSEUDO], 'Pseudo_instruction', list(itertools.prod
            ("branch", [Format.PSEUDO_BRANCH], 'Pseudo_branch_instruction', itertools.product([1], [0, 1])),
            ("barrier", [Format.PSEUDO_BARRIER], 'Pseudo_barrier_instruction', [(0, 0)]),
            ("reduction", [Format.PSEUDO_REDUCTION], 'Pseudo_reduction_instruction', [(3, 2)]),
-           ("vop1", [Format.VOP1], 'VOP1_instruction', [(1, 1), (2, 2)]),
+           ("vop1", [Format.VOP1], 'VOP1_instruction', [(0, 0), (1, 1), (2, 2)]),
            ("vop2", [Format.VOP2], 'VOP2_instruction', itertools.product([1, 2], [2, 3])),
            ("vop2_sdwa", [Format.VOP2, Format.SDWA], 'SDWA_instruction', itertools.product([1, 2], [2, 3])),
            ("vopc", [Format.VOPC], 'VOPC_instruction', itertools.product([1, 2], [2])),
index 6f493a49fa25be4d55c2d09dc5122d8d930c61c3..eb3756a0cf503b6965f5373121439c2d8c203aef 100644 (file)
@@ -39,3 +39,22 @@ BEGIN_TEST(assembler.s_memtime)
       finish_assembler_test();
    }
 END_TEST
+
+BEGIN_TEST(assembler.branch_3f)
+   if (!setup_cs(NULL, (chip_class)GFX10))
+      return;
+
+   //! BB0:
+   //! s_branch BB1                                                ; bf820040
+   //! s_nop 0                                                     ; bf800000
+   bld.sopp(aco_opcode::s_branch, Definition(PhysReg(0), s2), 1);
+
+   for (unsigned i = 0; i < 0x3f; i++)
+      bld.vop1(aco_opcode::v_nop);
+
+   bld.reset(program->create_and_insert_block());
+
+   program->blocks[1].linear_preds.push_back(0u);
+
+   finish_assembler_test();
+END_TEST