From: Rhys Perry Date: Wed, 5 Aug 2020 13:53:17 +0000 (+0100) Subject: aco/tests: add test for GFX10 0x3f bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ae6330d955ed9e5a6c9a0ce12a11a08b95830bff;p=mesa.git aco/tests: add test for GFX10 0x3f bug Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- diff --git a/src/amd/compiler/aco_builder_h.py b/src/amd/compiler/aco_builder_h.py index 1e217dea11b..a5338ce67ef 100644 --- a/src/amd/compiler/aco_builder_h.py +++ b/src/amd/compiler/aco_builder_h.py @@ -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])), diff --git a/src/amd/compiler/tests/test_assembler.cpp b/src/amd/compiler/tests/test_assembler.cpp index 6f493a49fa2..eb3756a0cf5 100644 --- a/src/amd/compiler/tests/test_assembler.cpp +++ b/src/amd/compiler/tests/test_assembler.cpp @@ -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