aco: add test for incorrect convert_to_SDWA() check

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/8577>
This commit is contained in:
Rhys Perry 2021-01-19 14:50:33 +00:00
parent fcda9b6737
commit 4c1953a9b8
1 changed files with 19 additions and 0 deletions

View File

@ -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