mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
aco: fix v_writelane_b32 with two sgprs
v_writelane_b32 can take two sgprs but only if one is m0.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: 20.2 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6662>
(cherry picked from commit 36e58a14cc)
This commit is contained in:
parent
efd20aa5b2
commit
f6f1995898
2 changed files with 14 additions and 1 deletions
|
|
@ -868,7 +868,7 @@
|
|||
"description": "aco: fix v_writelane_b32 with two sgprs",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1485,6 +1485,19 @@ bool operand_can_use_reg(chip_class chip, aco_ptr<Instruction>& instr, unsigned
|
|||
if (instr->operands[idx].isFixed())
|
||||
return instr->operands[idx].physReg() == reg;
|
||||
|
||||
bool is_writelane = instr->opcode == aco_opcode::v_writelane_b32 ||
|
||||
instr->opcode == aco_opcode::v_writelane_b32_e64;
|
||||
if (chip <= GFX9 && is_writelane && idx <= 1) {
|
||||
/* v_writelane_b32 can take two sgprs but only if one is m0. */
|
||||
bool is_other_sgpr = instr->operands[!idx].isTemp() &&
|
||||
(!instr->operands[!idx].isFixed() ||
|
||||
instr->operands[!idx].physReg() != m0);
|
||||
if (is_other_sgpr && instr->operands[!idx].tempId() != instr->operands[idx].tempId()) {
|
||||
instr->operands[idx].setFixed(m0);
|
||||
return reg == m0;
|
||||
}
|
||||
}
|
||||
|
||||
if (reg.byte()) {
|
||||
unsigned stride = get_subdword_operand_stride(chip, instr, idx, rc);
|
||||
if (reg.byte() % stride)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue