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>
(cherry picked from commit 9b1a296172)
This commit is contained in:
Daniel Schürmann 2021-07-19 15:01:09 +02:00 committed by Eric Engestrom
parent 9f19d52a23
commit c41e33f519
2 changed files with 3 additions and 2 deletions

View file

@ -877,7 +877,7 @@
"description": "aco/optimizer: ensure to not erase high bits when propagating packed constants",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -192,7 +192,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())