aco: lower p_spill with constants correctly

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9196>
This commit is contained in:
Daniel Schürmann 2021-02-22 14:55:45 +01:00 committed by Marge Bot
parent 4a57787006
commit 13e4fed01f

View file

@ -1935,11 +1935,15 @@ void lower_to_hw_instr(Program* program)
case aco_opcode::p_spill:
{
assert(instr->operands[0].regClass() == v1.as_linear());
for (unsigned i = 0; i < instr->operands[2].size(); i++)
for (unsigned i = 0; i < instr->operands[2].size(); i++) {
Operand src = instr->operands[2].isConstant() ?
Operand(uint32_t(instr->operands[2].constantValue64() >> (32 * i))) :
Operand(PhysReg{instr->operands[2].physReg() + i}, s1);
bld.writelane(bld.def(v1, instr->operands[0].physReg()),
Operand(PhysReg{instr->operands[2].physReg() + i}, s1),
src,
Operand(instr->operands[1].constantValue() + i),
instr->operands[0]);
}
break;
}
case aco_opcode::p_reload: