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>
(cherry picked from commit 2d36232e62)
This commit is contained in:
Rhys Perry 2021-04-19 11:32:56 +01:00 committed by Eric Engestrom
parent 7ab251c71a
commit 0c5b2aa429
2 changed files with 5 additions and 3 deletions

View file

@ -247,7 +247,7 @@
"description": "aco: allow SDWA sels smaller than the operand size",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

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;