aco: allow SDWA sels smaller than the operand size

p_extract_vector copy-propagation can create byte sels for v2b operands.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10315>
This commit is contained in:
Rhys Perry 2021-04-19 11:32:56 +01:00 committed by Marge Bot
parent 655ba1e3a9
commit 2d36232e62

View file

@ -549,8 +549,10 @@ bool validate_subdword_operand(chip_class chip, const aco_ptr<Instruction>& inst
return byte == 0;
if (instr->isPseudo() && chip >= GFX8)
return true;
if (instr->isSDWA() && (instr->sdwa().sel[index] & sdwa_asuint) == (sdwa_isra | op.bytes()))
return true;
if (instr->isSDWA()) {
unsigned sel = instr->sdwa().sel[index] & sdwa_asuint;
return (sel & sdwa_isra) && (sel & sdwa_rasize) <= op.bytes();
}
if (byte == 2 && can_use_opsel(chip, instr->opcode, index, 1))
return true;