aco/optimizer: fix signed extract of sub dword temps with SDWA
If an instruction didn't already use SDWA convert_to_SDWA in apply_extract
will add ubyte0/uword0 selections for v1b/v2b operands. This loses information
that the instruction doesn't care about the high bits and makes the next
apply_extract_twice fail.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 6cb9d39bc2 ("aco: combine extracts with sub-dword definitions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32803>
This commit is contained in:
@@ -1149,9 +1149,13 @@ apply_extract(opt_ctx& ctx, aco_ptr<Instruction>& instr, unsigned idx, ssa_info&
|
||||
instr.reset(mad);
|
||||
} else if (can_use_SDWA(ctx.program->gfx_level, instr, true) &&
|
||||
(tmp.type() == RegType::vgpr || ctx.program->gfx_level >= GFX9)) {
|
||||
convert_to_SDWA(ctx.program->gfx_level, instr);
|
||||
instr->sdwa().sel[idx] = apply_extract_twice(sel, instr->operands[idx].getTemp(),
|
||||
instr->sdwa().sel[idx], Temp(0, v1));
|
||||
if (instr->isSDWA()) {
|
||||
instr->sdwa().sel[idx] = apply_extract_twice(sel, instr->operands[idx].getTemp(),
|
||||
instr->sdwa().sel[idx], Temp(0, v1));
|
||||
} else {
|
||||
convert_to_SDWA(ctx.program->gfx_level, instr);
|
||||
instr->sdwa().sel[idx] = sel;
|
||||
}
|
||||
} else if (instr->isVALU()) {
|
||||
if (sel.offset()) {
|
||||
instr->valu().opsel[idx] = true;
|
||||
|
||||
Reference in New Issue
Block a user