aco: fix one-off error in Operand(uint16_t)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 3d6f67950d ('aco: improve 8/16-bit constants')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6583>
(cherry picked from commit 0e9425a1b7)
This commit is contained in:
Rhys Perry 2020-09-03 15:41:32 +01:00 committed by Dylan Baker
parent 64ff6b112e
commit fe13f9b8f5
2 changed files with 2 additions and 2 deletions

View file

@ -1201,7 +1201,7 @@
"description": "aco: fix one-off error in Operand(uint16_t)",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "3d6f67950d91de1dd50b096de144e504a89ea21d"
},

View file

@ -429,7 +429,7 @@ public:
if (v <= 64)
setFixed(PhysReg{128u + v});
else if (v >= 0xFFF0) /* [-16 .. -1] */
setFixed(PhysReg{192u + (0xFFFF - v)});
setFixed(PhysReg{(unsigned)(192 - (int16_t)v)});
else if (v == 0x3800) /* 0.5 */
setFixed(PhysReg{240});
else if (v == 0xB800) /* -0.5 */