Module: Mesa
Branch: master
Commit: 0e9425a1b74ed7e38656eee43f72a527404bf0b6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e9425a1b74ed7e38656eee43f72a527404bf0b6

Author: Rhys Perry <[email protected]>
Date:   Thu Sep  3 15:41:32 2020 +0100

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

Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Fixes: 3d6f67950d9 ('aco: improve 8/16-bit constants')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6583>

---

 src/amd/compiler/aco_ir.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h
index d27726d7f73..9b3f5a315ca 100644
--- a/src/amd/compiler/aco_ir.h
+++ b/src/amd/compiler/aco_ir.h
@@ -449,7 +449,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 */

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to