Mesa (master): aco: lower p_spill with constants correctly
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 13 18:55:19 UTC 2021
Module: Mesa
Branch: master
Commit: 13e4fed01fc4fd36f335cc2e8ada6cad3ee06d18
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=13e4fed01fc4fd36f335cc2e8ada6cad3ee06d18
Author: Daniel Schürmann <daniel at schuermann.dev>
Date: Mon Feb 22 14:55:45 2021 +0100
aco: lower p_spill with constants correctly
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9196>
---
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 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:
More information about the mesa-commit
mailing list