From 5fb54d1fde95f0aa1763ce84a31cd51387a141bd Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Fri, 30 Aug 2024 10:38:22 +0200 Subject: [PATCH] aco/ra: fix copying 64bit literal to sgprs Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index b1e75fd82b4..0f60342b015 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -3250,14 +3250,16 @@ register_allocation(Program* program, ra_test_policy policy) if (op.isTemp() && op.isFirstKill()) tmp_file.block(op.physReg(), op.regClass()); } - Temp tmp = program->allocateTmp(s1); + Temp tmp = program->allocateTmp(instr->operands[0].size() == 2 ? s2 : s1); ctx.assignments.emplace_back(); PhysReg reg = get_reg(ctx, tmp_file, tmp, parallelcopy, instr); update_renames(ctx, register_file, parallelcopy, instr, rename_not_killed_ops); Instruction* copy = create_instruction(aco_opcode::p_parallelcopy, Format::PSEUDO, 1, 1); - copy->operands[0] = Operand::c32(instr->operands[0].constantValue()); + copy->operands[0] = instr->operands[0]; + if (copy->operands[0].bytes() < 4) + copy->operands[0] = Operand::c32(copy->operands[0].constantValue()); copy->definitions[0] = Definition(tmp); copy->definitions[0].setFixed(reg);