From 13e4fed01fc4fd36f335cc2e8ada6cad3ee06d18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 22 Feb 2021 14:55:45 +0100 Subject: [PATCH] aco: lower p_spill with constants correctly Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_lower_to_hw_instr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp index 42139bd..cef1dce 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: -- 2.7.4