aco/optimizer: ensure to not erase high bits when propagating packed constants

Packed constants with non-zero values in the high half
might have been propagated as 16 bit, dropping the high half.

Cc: mesa-stable
Closes: #5070
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11954>
This commit is contained in:
Daniel Schürmann 2021-07-19 15:01:09 +02:00 committed by Marge Bot
parent 66213ab2de
commit 9b1a296172
1 changed files with 2 additions and 1 deletions

View File

@ -194,7 +194,8 @@ struct ssa_info {
add_label(label_literal);
val = constant;
if (chip >= GFX8 && !op16.isLiteral())
/* check that no upper bits are lost in case of packed 16bit constants */
if (chip >= GFX8 && !op16.isLiteral() && op16.constantValue64() == constant)
add_label(label_constant_16bit);
if (!op32.isLiteral())