From fe13f9b8f5190bcf9da44c827d4bcfb4be5264bc Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 3 Sep 2020 15:41:32 +0100 Subject: [PATCH] aco: fix one-off error in Operand(uint16_t) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Fixes: 3d6f67950d9 ('aco: improve 8/16-bit constants') Part-of: (cherry picked from commit 0e9425a1b74ed7e38656eee43f72a527404bf0b6) --- .pick_status.json | 2 +- src/amd/compiler/aco_ir.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index c5969e71014..600f32f68b5 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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" }, diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 1d6220ef928..1abaae8e8a3 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -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 */