From fe597d9e53f7f8edaa640888c1c3297b12fbca08 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 27 May 2025 11:37:18 +0100 Subject: [PATCH] nir: fix unpack_unorm_2x16/unpack_snorm_2x16 constant folding Signed-off-by: Rhys Perry Backport-to: 25.0 Reviewed-by: Georg Lehmann Part-of: (cherry picked from commit 6852538ba04e6550c10bf008d74d8f4054f304b4) --- .pick_status.json | 2 +- src/compiler/nir/nir_opcodes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 16d7f2f68ca..2c2bfb80074 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -744,7 +744,7 @@ "description": "nir: fix unpack_unorm_2x16/unpack_snorm_2x16 constant folding", "nominated": true, "nomination_type": 4, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 4a00b173a0d..ad73d75b000 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -366,7 +366,7 @@ dst.x |= ((uint32_t) pack_fmt_1x8(src0.w)) << 24; def unpack_2x16(fmt): unop_horiz("unpack_" + fmt + "_2x16", 2, tfloat32, 1, tuint32, """ dst.x = unpack_fmt_1x16((uint16_t)(src0.x & 0xffff)); -dst.y = unpack_fmt_1x16((uint16_t)(src0.x << 16)); +dst.y = unpack_fmt_1x16((uint16_t)(src0.x >> 16)); """.replace("fmt", fmt)) def unpack_4x8(fmt):