diff --git a/src/amd/compiler/tests/test_isel.cpp b/src/amd/compiler/tests/test_isel.cpp index 887f827b9ca..a266276b604 100644 --- a/src/amd/compiler/tests/test_isel.cpp +++ b/src/amd/compiler/tests/test_isel.cpp @@ -234,3 +234,22 @@ BEGIN_TEST(isel.discard_early_exit.mrt0) pbld.add_vsfs(vs, fs); pbld.print_ir(VK_SHADER_STAGE_FRAGMENT_BIT, "Assembly"); END_TEST + +BEGIN_TEST(isel.s_bfe_mask_bits) + QoShaderModuleCreateInfo cs = qoShaderModuleCreateInfoGLSL(COMPUTE, + layout(local_size_x=1) in; + layout(binding=0) buffer Buf { + int res; + }; + void main() { + //>> s1: %bits, s1: (kill)%_:scc = s_and_b32 (kill)%_, 31 + //! s1: %src1 = s_pack_ll_b32_b16 0, (kill)%bits + //! s1: %_, s1: (kill)%_:scc = s_bfe_i32 0xdeadbeef, (kill)%src1 + res = bitfieldExtract(0xdeadbeef, 0, res & 0x1f); + } + ); + + PipelineBuilder pbld(get_vk_device(GFX10_3)); + pbld.add_cs(cs); + pbld.print_ir(VK_SHADER_STAGE_COMPUTE_BIT, "ACO IR", true); +END_TEST