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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user