aco: implement 16-bit literals
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 13 Oct 2020 12:32:38 +0000 (13:32 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 15 Oct 2020 11:33:42 +0000 (11:33 +0000)
commit1a652244e4bdc0cefa907a91c81ab1efe1eafbd3
treea0e212628d1a748a52d0cc67a233771b8c65943c
parent91d9c55f3a435717224dace90b6181833ca9ea8e
aco: implement 16-bit literals

We can copy any value into a 16-bit subregister with a 3 dword
v_pack_b32_f16 on GFX10 or a v_and_b32+v_or_b32 on GFX9.

Because the generated code can depend on the register assignment and to
improve constant propagation, Builder::copy creates a p_create_vector in
the case of sub-dword literals.

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/7111>
src/amd/compiler/aco_builder_h.py
src/amd/compiler/aco_lower_to_hw_instr.cpp
src/amd/compiler/aco_validate.cpp
src/amd/compiler/tests/test_to_hw_instr.cpp