mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
aco: Fix integer overflows when emitting parallel copies during RA
32-bit shifts were accidentally used before this change despite the intended
output being 64 bits.
This was observed when compiling Dolphin's ubershaders.
Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6568>
(cherry picked from commit 2182bbf84f)
This commit is contained in:
parent
489e07d86d
commit
3c19a2cfda
2 changed files with 3 additions and 3 deletions
|
|
@ -2803,7 +2803,7 @@
|
|||
"description": "aco: Fix integer overflows when emitting parallel copies during RA",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1905,11 +1905,11 @@ void register_allocation(Program *program, std::vector<TempSet>& live_out_per_bl
|
|||
if (!sgpr_operands_alias_defs) {
|
||||
unsigned reg = parallelcopy[i].first.physReg().reg();
|
||||
unsigned size = parallelcopy[i].first.getTemp().size();
|
||||
sgpr_operands[reg / 64u] |= ((1u << size) - 1) << (reg % 64u);
|
||||
sgpr_operands[reg / 64u] |= u_bit_consecutive64(reg % 64u, size);
|
||||
|
||||
reg = parallelcopy[i].second.physReg().reg();
|
||||
size = parallelcopy[i].second.getTemp().size();
|
||||
if (sgpr_operands[reg / 64u] & ((1u << size) - 1) << (reg % 64u))
|
||||
if (sgpr_operands[reg / 64u] & u_bit_consecutive64(reg % 64u, size))
|
||||
sgpr_operands_alias_defs = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue