diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp index 42139bd0c01..cef1dce7bb2 100644 --- a/src/amd/compiler/aco_lower_to_hw_instr.cpp +++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp @@ -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: