From d9849ac46623797a9f56fb9d46dc52460ac477de Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Mon, 5 Aug 2024 14:34:07 +0200 Subject: [PATCH] aco: test xor swap16 path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Rhys Perry Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/tests/test_to_hw_instr.cpp | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/amd/compiler/tests/test_to_hw_instr.cpp b/src/amd/compiler/tests/test_to_hw_instr.cpp index 063c7a9251a..8e26695f632 100644 --- a/src/amd/compiler/tests/test_to_hw_instr.cpp +++ b/src/amd/compiler/tests/test_to_hw_instr.cpp @@ -16,12 +16,18 @@ BEGIN_TEST(to_hw_instr.swap_subdword) PhysReg v1_hi{257}; PhysReg v1_b1{257}; PhysReg v1_b3{257}; + PhysReg v128_lo{256 + 128}; + PhysReg v128_hi{256 + 128}; + PhysReg v129_lo{256 + 129}; + PhysReg v129_hi{256 + 129}; v0_hi.reg_b += 2; v1_hi.reg_b += 2; v0_b1.reg_b += 1; v1_b1.reg_b += 1; v0_b3.reg_b += 3; v1_b3.reg_b += 3; + v128_hi.reg_b += 2; + v129_hi.reg_b += 2; for (amd_gfx_level lvl : {GFX8, GFX9, GFX11}) { if (!setup_cs(NULL, lvl)) @@ -181,6 +187,28 @@ BEGIN_TEST(to_hw_instr.swap_subdword) bld.pseudo(aco_opcode::p_parallelcopy, Definition(v0_b1, v1b), Definition(v0_b3, v1b), Operand(v0_b3, v1b), Operand(v0_b1, v1b)); + //~gfx(8|9|11)! p_unit_test 13 + //~gfx[89]! v2b: %0:v[129][16:32] = v_xor_b32 %0:v[129][16:32], %0:v[128][0:16] dst_sel:uword1 dst_preserve src0_sel:uword1 src1_sel:uword0 + //~gfx[89]! v2b: %0:v[128][0:16] = v_xor_b32 %0:v[129][16:32], %0:v[128][0:16] dst_sel:uword0 dst_preserve src0_sel:uword1 src1_sel:uword0 + //~gfx[89]! v2b: %0:v[129][16:32] = v_xor_b32 %0:v[129][16:32], %0:v[128][0:16] dst_sel:uword1 dst_preserve src0_sel:uword1 src1_sel:uword0 + //~gfx11! v2b: %0:v[128][0:16] = v_xor_b16 hi(%0:v[129][16:32]), %0:v[128][0:16] + //~gfx11! v2b: %0:v[129][16:32] = v_xor_b16 hi(%0:v[129][16:32]), %0:v[128][0:16] opsel_hi + //~gfx11! v2b: %0:v[128][0:16] = v_xor_b16 hi(%0:v[129][16:32]), %0:v[128][0:16] + bld.pseudo(aco_opcode::p_unit_test, Operand::c32(13u)); + bld.pseudo(aco_opcode::p_parallelcopy, Definition(v128_lo, v2b), Definition(v129_hi, v2b), + Operand(v129_hi, v2b), Operand(v128_lo, v2b)); + + //~gfx(8|9|11)! p_unit_test 14 + //~gfx[89]! v2b: %0:v[129][0:16] = v_xor_b32 %0:v[129][0:16], %0:v[128][16:32] dst_sel:uword0 dst_preserve src0_sel:uword0 src1_sel:uword1 + //~gfx[89]! v2b: %0:v[128][16:32] = v_xor_b32 %0:v[129][0:16], %0:v[128][16:32] dst_sel:uword1 dst_preserve src0_sel:uword0 src1_sel:uword1 + //~gfx[89]! v2b: %0:v[129][0:16] = v_xor_b32 %0:v[129][0:16], %0:v[128][16:32] dst_sel:uword0 dst_preserve src0_sel:uword0 src1_sel:uword1 + //~gfx11! v2b: %0:v[128][16:32] = v_xor_b16 %0:v[129][0:16], hi(%0:v[128][16:32]) opsel_hi + //~gfx11! v2b: %0:v[129][0:16] = v_xor_b16 %0:v[129][0:16], hi(%0:v[128][16:32]) + //~gfx11! v2b: %0:v[128][16:32] = v_xor_b16 %0:v[129][0:16], hi(%0:v[128][16:32]) opsel_hi + bld.pseudo(aco_opcode::p_unit_test, Operand::c32(14u)); + bld.pseudo(aco_opcode::p_parallelcopy, Definition(v128_hi, v2b), Definition(v129_lo, v2b), + Operand(v129_lo, v2b), Operand(v128_hi, v2b)); + //~gfx11! s_nop //~gfx11! s_sendmsg sendmsg(dealloc_vgprs) //~gfx(8|9|11)! s_endpgm