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>
This commit is contained in:
Rhys Perry
2020-10-13 13:32:38 +01:00
committed by Marge Bot
parent 91d9c55f3a
commit 1a652244e4
4 changed files with 155 additions and 2 deletions
-1
View File
@@ -349,7 +349,6 @@ bool validate_ir(Program* program)
check(!is_subdword || !has_const_sgpr || program->chip_class >= GFX9,
"Sub-dword pseudo instructions can only take constants or SGPRs on GFX9+", instr.get());
check(!is_subdword || !has_literal, "Sub-dword pseudo instructions cannot take literals", instr.get());
}
if (instr->opcode == aco_opcode::p_create_vector) {